outlundo.cxx (190118d0) | outlundo.cxx (7a980842) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 30 unchanged lines hidden (view full) --- 39 40OutlinerUndoBase::OutlinerUndoBase( sal_uInt16 _nId, Outliner* pOutliner ) 41 : EditUndo( _nId, NULL ) 42{ 43 DBG_ASSERT( pOutliner, "Undo: Outliner?!" ); 44 mpOutliner = pOutliner; 45} 46 | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 30 unchanged lines hidden (view full) --- 39 40OutlinerUndoBase::OutlinerUndoBase( sal_uInt16 _nId, Outliner* pOutliner ) 41 : EditUndo( _nId, NULL ) 42{ 43 DBG_ASSERT( pOutliner, "Undo: Outliner?!" ); 44 mpOutliner = pOutliner; 45} 46 |
47OutlinerUndoChangeParaFlags::OutlinerUndoChangeParaFlags( Outliner* pOutliner, sal_uInt16 nPara, sal_uInt16 nOldFlags, sal_uInt16 nNewFlags ) | 47OutlinerUndoChangeParaFlags::OutlinerUndoChangeParaFlags( Outliner* pOutliner, sal_uInt32 nPara, sal_uInt16 nOldFlags, sal_uInt16 nNewFlags ) |
48: OutlinerUndoBase( OLUNDO_DEPTH, pOutliner ) 49{ 50 mnPara = nPara; 51 mnOldFlags = nOldFlags; 52 mnNewFlags = nNewFlags; 53} 54 55void OutlinerUndoChangeParaFlags::Undo() --- 16 unchanged lines hidden (view full) --- 72 pOutliner->mnDepthChangeHdlPrevFlags = pPara->nFlags; 73 pOutliner->pHdlParagraph = pPara; 74 75 pPara->nFlags = nFlags; 76 pOutliner->DepthChangedHdl(); 77 } 78} 79 | 48: OutlinerUndoBase( OLUNDO_DEPTH, pOutliner ) 49{ 50 mnPara = nPara; 51 mnOldFlags = nOldFlags; 52 mnNewFlags = nNewFlags; 53} 54 55void OutlinerUndoChangeParaFlags::Undo() --- 16 unchanged lines hidden (view full) --- 72 pOutliner->mnDepthChangeHdlPrevFlags = pPara->nFlags; 73 pOutliner->pHdlParagraph = pPara; 74 75 pPara->nFlags = nFlags; 76 pOutliner->DepthChangedHdl(); 77 } 78} 79 |
80OutlinerUndoChangeParaNumberingRestart::OutlinerUndoChangeParaNumberingRestart( Outliner* pOutliner, sal_uInt16 nPara, | 80OutlinerUndoChangeParaNumberingRestart::OutlinerUndoChangeParaNumberingRestart( Outliner* pOutliner, sal_uInt32 nPara, |
81 sal_Int16 nOldNumberingStartValue, sal_Int16 nNewNumberingStartValue, 82 sal_Bool bOldParaIsNumberingRestart, sal_Bool bNewParaIsNumberingRestart ) 83: OutlinerUndoBase( OLUNDO_DEPTH, pOutliner ) 84{ 85 mnPara = nPara; 86 87 maUndoData.mnNumberingStartValue = nOldNumberingStartValue; 88 maUndoData.mbParaIsNumberingRestart = bOldParaIsNumberingRestart; --- 13 unchanged lines hidden (view full) --- 102 103void OutlinerUndoChangeParaNumberingRestart::ImplApplyData( const ParaRestartData& rData ) 104{ 105 Outliner* pOutliner = GetOutliner(); 106 pOutliner->SetNumberingStartValue( mnPara, rData.mnNumberingStartValue ); 107 pOutliner->SetParaIsNumberingRestart( mnPara, rData.mbParaIsNumberingRestart ); 108} 109 | 81 sal_Int16 nOldNumberingStartValue, sal_Int16 nNewNumberingStartValue, 82 sal_Bool bOldParaIsNumberingRestart, sal_Bool bNewParaIsNumberingRestart ) 83: OutlinerUndoBase( OLUNDO_DEPTH, pOutliner ) 84{ 85 mnPara = nPara; 86 87 maUndoData.mnNumberingStartValue = nOldNumberingStartValue; 88 maUndoData.mbParaIsNumberingRestart = bOldParaIsNumberingRestart; --- 13 unchanged lines hidden (view full) --- 102 103void OutlinerUndoChangeParaNumberingRestart::ImplApplyData( const ParaRestartData& rData ) 104{ 105 Outliner* pOutliner = GetOutliner(); 106 pOutliner->SetNumberingStartValue( mnPara, rData.mnNumberingStartValue ); 107 pOutliner->SetParaIsNumberingRestart( mnPara, rData.mbParaIsNumberingRestart ); 108} 109 |
110OutlinerUndoChangeDepth::OutlinerUndoChangeDepth( Outliner* pOutliner, sal_uInt16 nPara, sal_Int16 nOldDepth, sal_Int16 nNewDepth ) | 110OutlinerUndoChangeDepth::OutlinerUndoChangeDepth( Outliner* pOutliner, sal_uInt32 nPara, sal_Int16 nOldDepth, sal_Int16 nNewDepth ) |
111 : OutlinerUndoBase( OLUNDO_DEPTH, pOutliner ) 112{ 113 mnPara = nPara; 114 mnOldDepth = nOldDepth; 115 mnNewDepth = nNewDepth; 116} 117 118void OutlinerUndoChangeDepth::Undo() --- 7 unchanged lines hidden (view full) --- 126} 127 128void OutlinerUndoChangeDepth::Repeat() 129{ 130 DBG_ERROR( "Repeat not implemented!" ); 131} 132 133 | 111 : OutlinerUndoBase( OLUNDO_DEPTH, pOutliner ) 112{ 113 mnPara = nPara; 114 mnOldDepth = nOldDepth; 115 mnNewDepth = nNewDepth; 116} 117 118void OutlinerUndoChangeDepth::Undo() --- 7 unchanged lines hidden (view full) --- 126} 127 128void OutlinerUndoChangeDepth::Repeat() 129{ 130 DBG_ERROR( "Repeat not implemented!" ); 131} 132 133 |
134OutlinerUndoCheckPara::OutlinerUndoCheckPara( Outliner* pOutliner, sal_uInt16 nPara ) | 134OutlinerUndoCheckPara::OutlinerUndoCheckPara( Outliner* pOutliner, sal_uInt32 nPara ) |
135 : OutlinerUndoBase( OLUNDO_DEPTH, pOutliner ) 136{ 137 mnPara = nPara; 138} 139 140void OutlinerUndoCheckPara::Undo() 141{ 142 Paragraph* pPara = GetOutliner()->GetParagraph( mnPara ); --- 41 unchanged lines hidden (view full) --- 184 Paragraph* pPara; 185 186 sal_Bool bExpand = sal_False; 187 sal_uInt16 _nId = GetId(); 188 if((_nId == OLUNDO_EXPAND && !bUndo) || (_nId == OLUNDO_COLLAPSE && bUndo)) 189 bExpand = sal_True; 190 if( !pParas ) 191 { | 135 : OutlinerUndoBase( OLUNDO_DEPTH, pOutliner ) 136{ 137 mnPara = nPara; 138} 139 140void OutlinerUndoCheckPara::Undo() 141{ 142 Paragraph* pPara = GetOutliner()->GetParagraph( mnPara ); --- 41 unchanged lines hidden (view full) --- 184 Paragraph* pPara; 185 186 sal_Bool bExpand = sal_False; 187 sal_uInt16 _nId = GetId(); 188 if((_nId == OLUNDO_EXPAND && !bUndo) || (_nId == OLUNDO_COLLAPSE && bUndo)) 189 bExpand = sal_True; 190 if( !pParas ) 191 { |
192 pPara = pOutliner->GetParagraph( (sal_uLong)nCount ); | 192 pPara = pOutliner->GetParagraph( nCount ); |
193 if( bExpand ) 194 pOutliner->Expand( pPara ); 195 else 196 pOutliner->Collapse( pPara ); 197 } 198 else 199 { | 193 if( bExpand ) 194 pOutliner->Expand( pPara ); 195 else 196 pOutliner->Collapse( pPara ); 197 } 198 else 199 { |
200 for( sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++ ) | 200 for( sal_uInt32 nIdx = 0; nIdx < nCount; nIdx++ ) |
201 { | 201 { |
202 pPara = pOutliner->GetParagraph( (sal_uLong)(pParas[nIdx]) ); | 202 pPara = pOutliner->GetParagraph( pParas[nIdx] ); |
203 if( bExpand ) 204 pOutliner->Expand( pPara ); 205 else 206 pOutliner->Collapse( pPara ); 207 } 208 } 209} 210 --- 20 unchanged lines hidden --- | 203 if( bExpand ) 204 pOutliner->Expand( pPara ); 205 else 206 pOutliner->Collapse( pPara ); 207 } 208 } 209} 210 --- 20 unchanged lines hidden --- |