wrtsh1.cxx (34760e49) wrtsh1.cxx (f6675432)
1/**************************************************************
1/**************************************************************
2 *
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
9 * with the License. You may obtain a copy of the License at
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
9 * with the License. You may obtain a copy of the License at
10 *
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
19 *
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_sw.hxx"
26
27#include <com/sun/star/container/XChild.hpp>

--- 39 unchanged lines hidden (view full) ---

67#include <wrtsh.hxx>
68#include <view.hxx>
69#include <uitool.hxx>
70#include <cmdid.h>
71#include <cfgitems.hxx>
72#include <pagedesc.hxx>
73#include <frmmgr.hxx>
74#include <shellio.hxx>
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_sw.hxx"
26
27#include <com/sun/star/container/XChild.hpp>

--- 39 unchanged lines hidden (view full) ---

67#include <wrtsh.hxx>
68#include <view.hxx>
69#include <uitool.hxx>
70#include <cmdid.h>
71#include <cfgitems.hxx>
72#include <pagedesc.hxx>
73#include <frmmgr.hxx>
74#include <shellio.hxx>
75#include <uinums.hxx> // fuer Anwenden einer
76#include <swundo.hxx> // fuer Undo-Ids
75#include <uinums.hxx> // fuer Anwenden einer
76#include <swundo.hxx> // fuer Undo-Ids
77#include <swcli.hxx>
78#include <poolfmt.hxx>
79#include <wview.hxx>
80#include <edtwin.hxx>
81#include <fmtcol.hxx>
82#include <swtable.hxx>
83#include <caption.hxx>
84#include <viscrs.hxx>

--- 22 unchanged lines hidden (view full) ---

107#include "PostItMgr.hxx"
108#include <sfx2/msgpool.hxx>
109
110using namespace sw::mark;
111using namespace com::sun::star;
112
113#define COMMON_INI_LIST \
114 fnDrag(&SwWrtShell::BeginDrag),\
77#include <swcli.hxx>
78#include <poolfmt.hxx>
79#include <wview.hxx>
80#include <edtwin.hxx>
81#include <fmtcol.hxx>
82#include <swtable.hxx>
83#include <caption.hxx>
84#include <viscrs.hxx>

--- 22 unchanged lines hidden (view full) ---

107#include "PostItMgr.hxx"
108#include <sfx2/msgpool.hxx>
109
110using namespace sw::mark;
111using namespace com::sun::star;
112
113#define COMMON_INI_LIST \
114 fnDrag(&SwWrtShell::BeginDrag),\
115 fnSetCrsr(&SwWrtShell::SetCrsr),\
115 fnSetCrsr(&SwWrtShell::SetCrsr),\
116 fnEndDrag(&SwWrtShell::EndDrag),\
117 fnKillSel(&SwWrtShell::Ignore),\
116 fnEndDrag(&SwWrtShell::EndDrag),\
117 fnKillSel(&SwWrtShell::Ignore),\
118 pModeStack(0), \
119 ePageMove(MV_NO),\
120 pCrsrStack(0), \
121 rView(rShell),\
122 bDestOnStack(sal_False), \
123 fnLeaveSelect(&SwWrtShell::SttLeaveSelect)
118 pModeStack(0), \
119 ePageMove(MV_NO),\
120 pCrsrStack(0),\
121 rView(rShell),\
122 bDestOnStack(sal_False), \
123 fnLeaveSelect(&SwWrtShell::SttLeaveSelect)
124
125#define BITFLD_INI_LIST \
126 bClearMark = \
127 bIns = sal_True;\
128 bAddMode = \
129 bBlockMode = \
130 bExtMode = \
131 bInSelect = \
132 bCopy = \
133 bLayoutMode = \
134 bNoEdit = \
135 bSelWrd = \
136 bSelLn = \
137 bIsInClickToEdit = \
138 mbRetainSelection = sal_False;
139
140
141SvxAutoCorrect* lcl_IsAutoCorr()
142{
124
125#define BITFLD_INI_LIST \
126 bClearMark = \
127 bIns = sal_True;\
128 bAddMode = \
129 bBlockMode = \
130 bExtMode = \
131 bInSelect = \
132 bCopy = \
133 bLayoutMode = \
134 bNoEdit = \
135 bSelWrd = \
136 bSelLn = \
137 bIsInClickToEdit = \
138 mbRetainSelection = sal_False;
139
140
141SvxAutoCorrect* lcl_IsAutoCorr()
142{
143 SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
144 if( pACorr && !pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd |
143 SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
144 if( pACorr && !pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd |
145 AddNonBrkSpace | ChgOrdinalNumber |
145 AddNonBrkSpace | ChgOrdinalNumber |
146 ChgToEnEmDash | SetINetAttr | Autocorrect ))
146 ChgToEnEmDash | SetINetAttr | Autocorrect ))
147 pACorr = 0;
148 return pACorr;
149}
150
151void SwWrtShell::NoEdit(sal_Bool bHideCrsr)
152{
153 if(bHideCrsr)
154 HideCrsr();

--- 24 unchanged lines hidden (view full) ---

179
180
181/*------------------------------------------------------------------------
182 Beschreibung: Abfrage, ob Einfuegen moeglich ist; gfs. Beep
183------------------------------------------------------------------------*/
184
185bool SwWrtShell::_CanInsert()
186{
147 pACorr = 0;
148 return pACorr;
149}
150
151void SwWrtShell::NoEdit(sal_Bool bHideCrsr)
152{
153 if(bHideCrsr)
154 HideCrsr();

--- 24 unchanged lines hidden (view full) ---

179
180
181/*------------------------------------------------------------------------
182 Beschreibung: Abfrage, ob Einfuegen moeglich ist; gfs. Beep
183------------------------------------------------------------------------*/
184
185bool SwWrtShell::_CanInsert()
186{
187 if(!CanInsert())
188 {
189 Sound::Beep();
190 return false;
191 }
187 if(!CanInsert())
188 {
189 Sound::Beep();
190 return false;
191 }
192
192
193 return true;
193 return true;
194}
195
196/*------------------------------------------------------------------------
197 Beschreibung: String einfuegen
198------------------------------------------------------------------------*/
199
200void SwWrtShell::InsertByWord( const String & rStr)
201{
202 if( rStr.Len() )
203 {
204 sal_Bool bDelim = GetAppCharClass().isLetterNumeric( rStr, 0 );
205 xub_StrLen nPos = 0, nStt = 0;
206 for( ; nPos < rStr.Len(); nPos++ )
194}
195
196/*------------------------------------------------------------------------
197 Beschreibung: String einfuegen
198------------------------------------------------------------------------*/
199
200void SwWrtShell::InsertByWord( const String & rStr)
201{
202 if( rStr.Len() )
203 {
204 sal_Bool bDelim = GetAppCharClass().isLetterNumeric( rStr, 0 );
205 xub_StrLen nPos = 0, nStt = 0;
206 for( ; nPos < rStr.Len(); nPos++ )
207 {
207 {
208 sal_Bool bTmpDelim = GetAppCharClass().isLetterNumeric( rStr, nPos );
209 if( bTmpDelim != bDelim )
210 {
211 Insert( rStr.Copy( nStt, nPos - nStt ));
212 nStt = nPos;
213 }
214 }
215 if( nStt != nPos )

--- 5 unchanged lines hidden (view full) ---

221void SwWrtShell::Insert( const String &rStr )
222{
223 ResetCursorStack();
224 if( !_CanInsert() )
225 return;
226
227 sal_Bool bStarted = sal_False, bHasSel = HasSelection(),
228 bCallIns = bIns /*|| bHasSel*/;
208 sal_Bool bTmpDelim = GetAppCharClass().isLetterNumeric( rStr, nPos );
209 if( bTmpDelim != bDelim )
210 {
211 Insert( rStr.Copy( nStt, nPos - nStt ));
212 nStt = nPos;
213 }
214 }
215 if( nStt != nPos )

--- 5 unchanged lines hidden (view full) ---

221void SwWrtShell::Insert( const String &rStr )
222{
223 ResetCursorStack();
224 if( !_CanInsert() )
225 return;
226
227 sal_Bool bStarted = sal_False, bHasSel = HasSelection(),
228 bCallIns = bIns /*|| bHasSel*/;
229 bool bDeleted = false;
229 bool bDeleted = false;
230
230
231 if( bHasSel || ( !bIns && SelectHiddenRange() ) )
231 if( bHasSel || ( !bIns && SelectHiddenRange() ) )
232 {
233 // nur hier klammern, da das normale Insert schon an der
234 // Editshell geklammert ist
235 StartAllAction();
236
232 {
233 // nur hier klammern, da das normale Insert schon an der
234 // Editshell geklammert ist
235 StartAllAction();
236
237 // #111827#
238 SwRewriter aRewriter;
237 // #111827#
238 SwRewriter aRewriter;
239
239
240 aRewriter.AddRule(UNDO_ARG1, GetCrsrDescr());
241 aRewriter.AddRule(UNDO_ARG2, String(SW_RES(STR_YIELDS)));
242 {
243 String aTmpStr;
244 aTmpStr += String(SW_RES(STR_START_QUOTE));
245 aTmpStr += rStr;
246 aTmpStr += String(SW_RES(STR_END_QUOTE));
240 aRewriter.AddRule(UNDO_ARG1, GetCrsrDescr());
241 aRewriter.AddRule(UNDO_ARG2, String(SW_RES(STR_YIELDS)));
242 {
243 String aTmpStr;
244 aTmpStr += String(SW_RES(STR_START_QUOTE));
245 aTmpStr += rStr;
246 aTmpStr += String(SW_RES(STR_END_QUOTE));
247
247
248 aRewriter.AddRule(UNDO_ARG3, rStr);
249 }
248 aRewriter.AddRule(UNDO_ARG3, rStr);
249 }
250
251 StartUndo(UNDO_REPLACE, &aRewriter);
252 bStarted = sal_True;
250
251 StartUndo(UNDO_REPLACE, &aRewriter);
252 bStarted = sal_True;
253 bDeleted = DelRight() != 0;
253 bDeleted = DelRight() != 0;
254 }
255
254 }
255
256 /*
256 /*
257JP 21.01.98: Ueberschreiben ueberschreibt nur die Selektion, nicht das
258 naechste Zeichen.
259 if( bHasSel && !bIns && 1 < rStr.Len() )
260 {
261 // falls mehrere Zeichen anstehen, nur das erste einfuegen,
262 // der Rest muss dann aber Ueberschrieben werden.
263 SwEditShell::Insert( rStr.GetChar( 0 ) );
264 SwEditShell::Overwrite( rStr.Copy( 1 ) );
265 }
266 else
267*/
257JP 21.01.98: Ueberschreiben ueberschreibt nur die Selektion, nicht das
258 naechste Zeichen.
259 if( bHasSel && !bIns && 1 < rStr.Len() )
260 {
261 // falls mehrere Zeichen anstehen, nur das erste einfuegen,
262 // der Rest muss dann aber Ueberschrieben werden.
263 SwEditShell::Insert( rStr.GetChar( 0 ) );
264 SwEditShell::Overwrite( rStr.Copy( 1 ) );
265 }
266 else
267*/
268 bCallIns ?
269 SwEditShell::Insert2( rStr, bDeleted ) : SwEditShell::Overwrite( rStr );
268 bCallIns ?
269 SwEditShell::Insert2( rStr, bDeleted ) : SwEditShell::Overwrite( rStr );
270
271
272 if( bStarted )
273 {
274 EndAllAction();
270
271
272 if( bStarted )
273 {
274 EndAllAction();
275 EndUndo();
275 EndUndo();
276 }
276 }
277// delete pChgFlg;
277// delete pChgFlg;
278}
279
280/* Begrenzung auf maximale Hoehe geht nicht, da die maximale Hoehe
281 * des aktuellen Frames nicht erfragt werden kann. */
282
283
284
285void SwWrtShell::Insert( const String &rPath, const String &rFilter,
286 const Graphic &rGrf, SwFlyFrmAttrMgr *pFrmMgr,
287 sal_Bool bRule )
288{
289 ResetCursorStack();
290 if ( !_CanInsert() )
291 return;
292
293 StartAllAction();
294
278}
279
280/* Begrenzung auf maximale Hoehe geht nicht, da die maximale Hoehe
281 * des aktuellen Frames nicht erfragt werden kann. */
282
283
284
285void SwWrtShell::Insert( const String &rPath, const String &rFilter,
286 const Graphic &rGrf, SwFlyFrmAttrMgr *pFrmMgr,
287 sal_Bool bRule )
288{
289 ResetCursorStack();
290 if ( !_CanInsert() )
291 return;
292
293 StartAllAction();
294
295 SwRewriter aRewriter;
296 aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_GRAPHIC));
295 SwRewriter aRewriter;
296 aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_GRAPHIC));
297
298 StartUndo(UNDO_INSERT, &aRewriter);
299
300 if ( HasSelection() )
301 DelRight();
302 // eingefuegte Grafik in eigenen Absatz, falls am Ende
303 // eines nichtleeren Absatzes
304 //For i120928,avoid to split node

--- 23 unchanged lines hidden (view full) ---

328 if ( !aSz.Width() || !aSz.Height() )
329 {
330 aSz.Width() = aSz.Height() = 567;
331 pFrmMgr->SetSize( aSz );
332 }
333 else if ( aSz.Width() != DFLT_WIDTH && aSz.Height() != DFLT_HEIGHT )
334 bSetGrfSize = sal_False;
335
297
298 StartUndo(UNDO_INSERT, &aRewriter);
299
300 if ( HasSelection() )
301 DelRight();
302 // eingefuegte Grafik in eigenen Absatz, falls am Ende
303 // eines nichtleeren Absatzes
304 //For i120928,avoid to split node

--- 23 unchanged lines hidden (view full) ---

328 if ( !aSz.Width() || !aSz.Height() )
329 {
330 aSz.Width() = aSz.Height() = 567;
331 pFrmMgr->SetSize( aSz );
332 }
333 else if ( aSz.Width() != DFLT_WIDTH && aSz.Height() != DFLT_HEIGHT )
334 bSetGrfSize = sal_False;
335
336 pFrmMgr->SetHeightSizeType(ATT_FIX_SIZE);
336 pFrmMgr->SetHeightSizeType(ATT_FIX_SIZE);
337
338 }
339
340 // Einfuegen der Grafik
341 SwFEShell::Insert(rPath, rFilter, &rGrf, &pFrmMgr->GetAttrSet());
342 if ( bOwnMgr )
343 pFrmMgr->UpdateAttrMgr();
344

--- 23 unchanged lines hidden (view full) ---

368 aGrfSize.Width() = ((BigInt)aBound.Height()) * aTempWidth / aTempHeight;
369 }
370 pFrmMgr->SetSize( aGrfSize );
371 pFrmMgr->UpdateFlyFrm();
372 }
373 if ( bOwnMgr )
374 delete pFrmMgr;
375
337
338 }
339
340 // Einfuegen der Grafik
341 SwFEShell::Insert(rPath, rFilter, &rGrf, &pFrmMgr->GetAttrSet());
342 if ( bOwnMgr )
343 pFrmMgr->UpdateAttrMgr();
344

--- 23 unchanged lines hidden (view full) ---

368 aGrfSize.Width() = ((BigInt)aBound.Height()) * aTempWidth / aTempHeight;
369 }
370 pFrmMgr->SetSize( aGrfSize );
371 pFrmMgr->UpdateFlyFrm();
372 }
373 if ( bOwnMgr )
374 delete pFrmMgr;
375
376 EndUndo();
376 EndUndo();
377 EndAllAction();
378}
379
380
381/*------------------------------------------------------------------------
382 Beschreibung: Fuegt ein OLE-Objekt in die CORE ein.
383 Wenn kein Object uebergeben wird, so wird eins erzeugt.
384------------------------------------------------------------------------*/
385
386
387void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName *pName,
377 EndAllAction();
378}
379
380
381/*------------------------------------------------------------------------
382 Beschreibung: Fuegt ein OLE-Objekt in die CORE ein.
383 Wenn kein Object uebergeben wird, so wird eins erzeugt.
384------------------------------------------------------------------------*/
385
386
387void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName *pName,
388 sal_Bool bActivate, sal_uInt16 nSlotId )
388 sal_Bool bActivate, sal_uInt16 nSlotId )
389{
390 ResetCursorStack();
391 if( !_CanInsert() )
392 return;
393
389{
390 ResetCursorStack();
391 if( !_CanInsert() )
392 return;
393
394 if( !xRef.is() )
394 if( !xRef.is() )
395 {
395 {
396 // temporary storage
397 svt::EmbeddedObjectRef xObj;
398 uno::Reference < embed::XStorage > xStor = comphelper::OStorageHelper::GetTemporaryStorage();
396 // temporary storage
397 svt::EmbeddedObjectRef xObj;
398 uno::Reference < embed::XStorage > xStor = comphelper::OStorageHelper::GetTemporaryStorage();
399 sal_Bool bDoVerb = sal_True;
400 if ( pName )
401 {
399 sal_Bool bDoVerb = sal_True;
400 if ( pName )
401 {
402 comphelper::EmbeddedObjectContainer aCnt( xStor );
403 ::rtl::OUString aName;
404 // TODO/LATER: get aspect?
405 xObj.Assign( aCnt.CreateEmbeddedObject( pName->GetByteSequence(), aName ), embed::Aspects::MSOLE_CONTENT );
402 comphelper::EmbeddedObjectContainer aCnt( xStor );
403 ::rtl::OUString aName;
404 // TODO/LATER: get aspect?
405 xObj.Assign( aCnt.CreateEmbeddedObject( pName->GetByteSequence(), aName ), embed::Aspects::MSOLE_CONTENT );
406 }
407 else
408 {
406 }
407 else
408 {
409 SvObjectServerList aServerList;
409 SvObjectServerList aServerList;
410 switch (nSlotId)
411 {
412 case SID_INSERT_OBJECT:
413 {
410 switch (nSlotId)
411 {
412 case SID_INSERT_OBJECT:
413 {
414 aServerList.FillInsertObjects();
415 aServerList.Remove( SwDocShell::Factory().GetClassId() );
416 // Intentionally no break!
414 aServerList.FillInsertObjects();
415 aServerList.Remove( SwDocShell::Factory().GetClassId() );
416 // Intentionally no break!
417 }
418
417 }
418
419 // TODO/LATER: recording! Convert properties to items
420 case SID_INSERT_PLUGIN:
421 case SID_INSERT_FLOATINGFRAME:
422 {
423 SfxSlotPool* pSlotPool = SW_MOD()->GetSlotPool();
424 const SfxSlot* pSlot = pSlotPool->GetSlot(nSlotId);
425 rtl::OString aCmd(".uno:");
426 aCmd += pSlot->GetUnoName();
427 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
428 SfxAbstractInsertObjectDialog* pDlg =
429 pFact->CreateInsertObjectDialog( GetWin(), rtl::OStringToOUString( aCmd, RTL_TEXTENCODING_UTF8 ), xStor, &aServerList );
430 if ( pDlg )
431 {
432 pDlg->Execute();
433 bDoVerb = pDlg->IsCreateNew();
419 // TODO/LATER: recording! Convert properties to items
420 case SID_INSERT_PLUGIN:
421 case SID_INSERT_FLOATINGFRAME:
422 {
423 SfxSlotPool* pSlotPool = SW_MOD()->GetSlotPool();
424 const SfxSlot* pSlot = pSlotPool->GetSlot(nSlotId);
425 rtl::OString aCmd(".uno:");
426 aCmd += pSlot->GetUnoName();
427 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
428 SfxAbstractInsertObjectDialog* pDlg =
429 pFact->CreateInsertObjectDialog( GetWin(), rtl::OStringToOUString( aCmd, RTL_TEXTENCODING_UTF8 ), xStor, &aServerList );
430 if ( pDlg )
431 {
432 pDlg->Execute();
433 bDoVerb = pDlg->IsCreateNew();
434 ::rtl::OUString aIconMediaType;
435 uno::Reference< io::XInputStream > xIconMetaFile = pDlg->GetIconIfIconified( &aIconMediaType );
434 ::rtl::OUString aIconMediaType;
435 uno::Reference< io::XInputStream > xIconMetaFile = pDlg->GetIconIfIconified( &aIconMediaType );
436 xObj.Assign( pDlg->GetObject(),
436 xObj.Assign( pDlg->GetObject(),
437 xIconMetaFile.is() ? embed::Aspects::MSOLE_ICON : embed::Aspects::MSOLE_CONTENT );
438 if ( xIconMetaFile.is() )
439 xObj.SetGraphicStream( xIconMetaFile, aIconMediaType );
440
437 xIconMetaFile.is() ? embed::Aspects::MSOLE_ICON : embed::Aspects::MSOLE_CONTENT );
438 if ( xIconMetaFile.is() )
439 xObj.SetGraphicStream( xIconMetaFile, aIconMediaType );
440
441 DELETEZ( pDlg );
442 }
441 DELETEZ( pDlg );
442 }
443
443
444 break;
445 }
444 break;
445 }
446
447 default:
448 break;
449 }
450 }
451
446
447 default:
448 break;
449 }
450 }
451
452 if ( xObj.is() )
452 if ( xObj.is() )
453 {
453 {
454 if( InsertOleObject( xObj ) && bActivate && bDoVerb )
454 if( InsertOleObject( xObj ) && bActivate && bDoVerb )
455 {
455 {
456 SfxInPlaceClient* pClient = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
457 if ( !pClient )
456 SfxInPlaceClient* pClient = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
457 if ( !pClient )
458 {
458 {
459 pClient = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
459 pClient = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
460 SetCheckForOLEInCaption( sal_True );
461 }
462
463 if ( xObj.GetViewAspect() == embed::Aspects::MSOLE_ICON )
464 {
465 SwRect aArea = GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() );
466 aArea.Pos() += GetAnyCurRect( RECT_FLY_EMBEDDED, 0, xObj.GetObject() ).Pos();
467 MapMode aMapMode( MAP_TWIP );
468 Size aSize = xObj.GetSize( &aMapMode );
469 aArea.Width( aSize.Width() );
470 aArea.Height( aSize.Height() );
471 RequestObjectResize( aArea, xObj.GetObject() );
472 }
473 else
460 SetCheckForOLEInCaption( sal_True );
461 }
462
463 if ( xObj.GetViewAspect() == embed::Aspects::MSOLE_ICON )
464 {
465 SwRect aArea = GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() );
466 aArea.Pos() += GetAnyCurRect( RECT_FLY_EMBEDDED, 0, xObj.GetObject() ).Pos();
467 MapMode aMapMode( MAP_TWIP );
468 Size aSize = xObj.GetSize( &aMapMode );
469 aArea.Width( aSize.Width() );
470 aArea.Height( aSize.Height() );
471 RequestObjectResize( aArea, xObj.GetObject() );
472 }
473 else
474 CalcAndSetScale( xObj );
474 CalcAndSetScale( xObj );
475
475
476 //#50270# Error brauchen wir nicht handeln, das erledigt das
477 //DoVerb in der SfxViewShell
478 pClient->DoVerb( SVVERB_SHOW );
476 //#50270# Error brauchen wir nicht handeln, das erledigt das
477 //DoVerb in der SfxViewShell
478 pClient->DoVerb( SVVERB_SHOW );
479
479
480 // TODO/LATER: set document name - should be done in Client
481 //if ( !ERRCODE_TOERROR( nErr ) )
482 // xIPObj->SetDocumentName( GetView().GetDocShell()->GetTitle() );
480 // TODO/LATER: set document name - should be done in Client
481 //if ( !ERRCODE_TOERROR( nErr ) )
482 // xIPObj->SetDocumentName( GetView().GetDocShell()->GetTitle() );
483 }
484 }
485 }
486 else
487 {
488 if( HasSelection() )
489 DelRight();
483 }
484 }
485 }
486 else
487 {
488 if( HasSelection() )
489 DelRight();
490 InsertOleObject( xRef );
490 InsertOleObject( xRef );
491 }
492}
493
494/*------------------------------------------------------------------------
495 Beschreibung: Object in die Core einfuegen.
496 Vom ClipBoard oder Insert
497------------------------------------------------------------------------*/
498
499sal_Bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyFrmFmt **pFlyFrmFmt )
500{
491 }
492}
493
494/*------------------------------------------------------------------------
495 Beschreibung: Object in die Core einfuegen.
496 Vom ClipBoard oder Insert
497------------------------------------------------------------------------*/
498
499sal_Bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyFrmFmt **pFlyFrmFmt )
500{
501 ResetCursorStack();
501 ResetCursorStack();
502 StartAllAction();
503
504 StartUndo(UNDO_INSERT);
505
502 StartAllAction();
503
504 StartUndo(UNDO_INSERT);
505
506 //Some differences between StarMath and any other objects:
507 //1. Selections should be deleted. For StarMath the Text should be
506 //Some differences between Math and any other objects:
507 //1. Selections should be deleted. For Math the Text should be
508 // passed to the Object
509 //2. If the cursor is at the end of an non empty paragraph a paragraph
508 // passed to the Object
509 //2. If the cursor is at the end of an non empty paragraph a paragraph
510 // break should be insertet. StarMath objects are character bound and
510 // break should be inserted. Math objects are character bound and
511 // no break should be inserted.
511 // no break should be inserted.
512 //3. If an selektion is passed to a StarMath object, this object should
512 //3. If an selection is passed to a Math object, this object should
513 // not be activated. sal_False should be returned then.
513 // not be activated. sal_False should be returned then.
514 sal_Bool bStarMath = sal_True;
515 sal_Bool bActivate = sal_True;
514 sal_Bool bStarMath = sal_True;
515 sal_Bool bActivate = sal_True;
516
517 // set parent to get correct VisArea(in case of object needing parent printer)
518 uno::Reference < container::XChild > xChild( xRef.GetObject(), uno::UNO_QUERY );
519 if ( xChild.is() )
520 xChild->setParent( pDoc->GetDocShell()->GetModel() );
521
522 SvGlobalName aCLSID( xRef->getClassID() );
523 bStarMath = ( SotExchange::IsMath( aCLSID ) != 0 );

--- 7 unchanged lines hidden (view full) ---

531 if( aMathData.Len() && svt::EmbeddedObjectRef::TryRunningState( xRef.GetObject() ) )
532 {
533 uno::Reference < beans::XPropertySet > xSet( xRef->getComponent(), uno::UNO_QUERY );
534 if ( xSet.is() )
535 {
536 try
537 {
538 xSet->setPropertyValue( ::rtl::OUString::createFromAscii("Formula"), uno::makeAny( ::rtl::OUString( aMathData ) ) );
516
517 // set parent to get correct VisArea(in case of object needing parent printer)
518 uno::Reference < container::XChild > xChild( xRef.GetObject(), uno::UNO_QUERY );
519 if ( xChild.is() )
520 xChild->setParent( pDoc->GetDocShell()->GetModel() );
521
522 SvGlobalName aCLSID( xRef->getClassID() );
523 bStarMath = ( SotExchange::IsMath( aCLSID ) != 0 );

--- 7 unchanged lines hidden (view full) ---

531 if( aMathData.Len() && svt::EmbeddedObjectRef::TryRunningState( xRef.GetObject() ) )
532 {
533 uno::Reference < beans::XPropertySet > xSet( xRef->getComponent(), uno::UNO_QUERY );
534 if ( xSet.is() )
535 {
536 try
537 {
538 xSet->setPropertyValue( ::rtl::OUString::createFromAscii("Formula"), uno::makeAny( ::rtl::OUString( aMathData ) ) );
539 bActivate = sal_False;
539 bActivate = sal_False;
540 }
541 catch ( uno::Exception& )
542 {
543 }
544 }
545 }
546 }
547 DelRight();

--- 5 unchanged lines hidden (view full) ---

553 EnterSelFrmMode();
554
555 SwFlyFrmAttrMgr aFrmMgr( sal_True, this, FRMMGR_TYPE_OLE );
556 aFrmMgr.SetHeightSizeType(ATT_FIX_SIZE);
557
558 SwRect aBound;
559 CalcBoundRect( aBound, aFrmMgr.GetAnchor() );
560
540 }
541 catch ( uno::Exception& )
542 {
543 }
544 }
545 }
546 }
547 DelRight();

--- 5 unchanged lines hidden (view full) ---

553 EnterSelFrmMode();
554
555 SwFlyFrmAttrMgr aFrmMgr( sal_True, this, FRMMGR_TYPE_OLE );
556 aFrmMgr.SetHeightSizeType(ATT_FIX_SIZE);
557
558 SwRect aBound;
559 CalcBoundRect( aBound, aFrmMgr.GetAnchor() );
560
561 //The Size should be suggested by the OLE server
561 // The Size should be suggested by the OLE server
562 MapMode aMapMode( MAP_TWIP );
563 Size aSz = xRef.GetSize( &aMapMode );
564
562 MapMode aMapMode( MAP_TWIP );
563 Size aSz = xRef.GetSize( &aMapMode );
564
565 //Object size can be limited
565 // Object size can be limited
566 if ( aSz.Width() > aBound.Width() )
567 {
568 //Immer proportional begrenzen.
569 aSz.Height() = aSz.Height() * aBound.Width() / aSz.Width();
570 aSz.Width() = aBound.Width();
571 }
572 aFrmMgr.SetSize( aSz );
566 if ( aSz.Width() > aBound.Width() )
567 {
568 //Immer proportional begrenzen.
569 aSz.Height() = aSz.Height() * aBound.Width() / aSz.Width();
570 aSz.Width() = aBound.Width();
571 }
572 aFrmMgr.SetSize( aSz );
573 SwFlyFrmFmt *pFmt = SwFEShell::InsertObject( xRef, &aFrmMgr.GetAttrSet() );
573 SwFlyFrmFmt *pFmt = SwFEShell::InsertObject( xRef, &aFrmMgr.GetAttrSet() );
574
574
575 // --> #i972#
576 if ( bStarMath && pDoc->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) )
577 AlignFormulaToBaseline( xRef.GetObject() );
578 // <--
575 // --> #i972#
576 if ( bStarMath && pDoc->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) )
577 AlignFormulaToBaseline( xRef.GetObject() );
578 // <--
579
579
580 if (pFlyFrmFmt)
581 *pFlyFrmFmt = pFmt;
580 if (pFlyFrmFmt)
581 *pFlyFrmFmt = pFmt;
582
582
583 if ( SotExchange::IsChart( aCLSID ) )
584 {
585 uno::Reference< embed::XEmbeddedObject > xEmbeddedObj( xRef.GetObject(), uno::UNO_QUERY );
586 if ( xEmbeddedObj.is() )
587 {
583 if ( SotExchange::IsChart( aCLSID ) )
584 {
585 uno::Reference< embed::XEmbeddedObject > xEmbeddedObj( xRef.GetObject(), uno::UNO_QUERY );
586 if ( xEmbeddedObj.is() )
587 {
588 bool bDisableDataTableDialog = false;
589 svt::EmbeddedObjectRef::TryRunningState( xEmbeddedObj );
590 uno::Reference< beans::XPropertySet > xProps( xEmbeddedObj->getComponent(), uno::UNO_QUERY );
591 if ( xProps.is() &&
592 ( xProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisableDataTableDialog" ) ) ) >>= bDisableDataTableDialog ) &&
593 bDisableDataTableDialog )
594 {
595 xProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisableDataTableDialog" ) ),
596 uno::makeAny( sal_False ) );
597 xProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisableComplexChartTypes" ) ),
598 uno::makeAny( sal_False ) );
599 uno::Reference< util::XModifiable > xModifiable( xProps, uno::UNO_QUERY );
600 if ( xModifiable.is() )
601 {
602 xModifiable->setModified( sal_True );
603 }
604 }
588 bool bDisableDataTableDialog = false;
589 svt::EmbeddedObjectRef::TryRunningState( xEmbeddedObj );
590 uno::Reference< beans::XPropertySet > xProps( xEmbeddedObj->getComponent(), uno::UNO_QUERY );
591 if ( xProps.is() &&
592 ( xProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisableDataTableDialog" ) ) ) >>= bDisableDataTableDialog ) &&
593 bDisableDataTableDialog )
594 {
595 xProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisableDataTableDialog" ) ),
596 uno::makeAny( sal_False ) );
597 xProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisableComplexChartTypes" ) ),
598 uno::makeAny( sal_False ) );
599 uno::Reference< util::XModifiable > xModifiable( xProps, uno::UNO_QUERY );
600 if ( xModifiable.is() )
601 {
602 xModifiable->setModified( sal_True );
603 }
604 }
605 }
606 }
605 }
606 }
607
608 EndAllAction();
609 GetView().AutoCaption(OLE_CAP, &aCLSID);
610
607
608 EndAllAction();
609 GetView().AutoCaption(OLE_CAP, &aCLSID);
610
611 SwRewriter aRewriter;
611 SwRewriter aRewriter;
612
613 if ( bStarMath )
614 aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_MATH_FORMULA));
615 else if ( SotExchange::IsChart( aCLSID ) )
616 aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_CHART));
617 else
618 aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_OLE));
619
612
613 if ( bStarMath )
614 aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_MATH_FORMULA));
615 else if ( SotExchange::IsChart( aCLSID ) )
616 aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_CHART));
617 else
618 aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_OLE));
619
620 EndUndo(UNDO_INSERT, &aRewriter);
620 EndUndo(UNDO_INSERT, &aRewriter);
621
621
622 return bActivate;
622 return bActivate;
623}
624
625/*------------------------------------------------------------------------
626 Beschreibung: Das aktuelle selektierte OLE-Objekt wird mit dem
627 Verb in den Server geladen.
628------------------------------------------------------------------------*/
629
630
631
632void SwWrtShell::LaunchOLEObj( long nVerb )
633{
634 if ( GetCntType() == CNT_OLE &&
623}
624
625/*------------------------------------------------------------------------
626 Beschreibung: Das aktuelle selektierte OLE-Objekt wird mit dem
627 Verb in den Server geladen.
628------------------------------------------------------------------------*/
629
630
631
632void SwWrtShell::LaunchOLEObj( long nVerb )
633{
634 if ( GetCntType() == CNT_OLE &&
635 !GetView().GetViewFrame()->GetFrame().IsInPlace() )
635 !GetView().GetViewFrame()->GetFrame().IsInPlace() )
636 {
636 {
637 svt::EmbeddedObjectRef& xRef = GetOLEObject();
638 ASSERT( xRef.is(), "OLE not found" );
639 SfxInPlaceClient* pCli=0;
637 svt::EmbeddedObjectRef& xRef = GetOLEObject();
638 ASSERT( xRef.is(), "OLE not found" );
639 SfxInPlaceClient* pCli=0;
640
640
641 pCli = GetView().FindIPClient( xRef.GetObject(), &GetView().GetEditWin() );
642 if ( !pCli )
643 pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xRef );
641 pCli = GetView().FindIPClient( xRef.GetObject(), &GetView().GetEditWin() );
642 if ( !pCli )
643 pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xRef );
644
644
645 ((SwOleClient*)pCli)->SetInDoVerb( sal_True );
645 ((SwOleClient*)pCli)->SetInDoVerb( sal_True );
646
646
647 CalcAndSetScale( xRef );
648 pCli->DoVerb( nVerb );
647 CalcAndSetScale( xRef );
648 pCli->DoVerb( nVerb );
649
649
650 ((SwOleClient*)pCli)->SetInDoVerb( sal_False );
651 CalcAndSetScale( xRef );
650 ((SwOleClient*)pCli)->SetInDoVerb( sal_False );
651 CalcAndSetScale( xRef );
652 }
653}
654
655void SwWrtShell::MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset )
656{
652 }
653}
654
655void SwWrtShell::MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset )
656{
657 try
658 {
659 sal_Int32 nState = xObj->getCurrentState();
660 if ( nState == ::com::sun::star::embed::EmbedStates::INPLACE_ACTIVE
661 || nState == ::com::sun::star::embed::EmbedStates::UI_ACTIVE )
662 {
663 SfxInPlaceClient* pCli =
657 try
658 {
659 sal_Int32 nState = xObj->getCurrentState();
660 if ( nState == ::com::sun::star::embed::EmbedStates::INPLACE_ACTIVE
661 || nState == ::com::sun::star::embed::EmbedStates::UI_ACTIVE )
662 {
663 SfxInPlaceClient* pCli =
664 GetView().FindIPClient( xObj.GetObject(), &(GetView().GetEditWin()) );
664 GetView().FindIPClient( xObj.GetObject(), &(GetView().GetEditWin()) );
665 if ( pCli )
666 {
665 if ( pCli )
666 {
667 Rectangle aArea = pCli->GetObjArea();
668 aArea += rOffset;
669 pCli->SetObjArea( aArea );
667 Rectangle aArea = pCli->GetObjArea();
668 aArea += rOffset;
669 pCli->SetObjArea( aArea );
670 }
671 }
672 }
673 catch( uno::Exception& )
674 {}
670 }
671 }
672 }
673 catch( uno::Exception& )
674 {}
675}
676
677
678void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
679 const SwRect *pFlyPrtRect,
680 const SwRect *pFlyFrmRect,
681 const bool bNoTxtFrmPrtAreaChanged )
682{
683 //Einstellen der Skalierung am Client. Diese ergibt sich aus der Differenz
684 //zwischen der VisArea des Objektes und der ObjArea.
675}
676
677
678void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
679 const SwRect *pFlyPrtRect,
680 const SwRect *pFlyFrmRect,
681 const bool bNoTxtFrmPrtAreaChanged )
682{
683 //Einstellen der Skalierung am Client. Diese ergibt sich aus der Differenz
684 //zwischen der VisArea des Objektes und der ObjArea.
685 ASSERT( xObj.is(), "ObjectRef not valid" );
685 ASSERT( xObj.is(), "ObjectRef not valid" );
686
686
687 sal_Int64 nAspect = xObj.GetViewAspect();
688 if ( nAspect == embed::Aspects::MSOLE_ICON )
689 return; // the replacement image is completely controlled by container in this case
687 sal_Int64 nAspect = xObj.GetViewAspect();
688 if ( nAspect == embed::Aspects::MSOLE_ICON )
689 return; // the replacement image is completely controlled by container in this case
690
690
691 sal_Int64 nMisc = 0;
692 sal_Bool bLinkingChart = sal_False;
691 sal_Int64 nMisc = 0;
692 sal_Bool bLinkingChart = sal_False;
693
693
694 try
695 {
696 nMisc = xObj->getStatus( nAspect );
694 try
695 {
696 nMisc = xObj->getStatus( nAspect );
697
697
698 //Das kann ja wohl nur ein nicht aktives Objekt sein. Diese bekommen
699 //auf Wunsch die neue Groesse als VisArea gesetzt (StarChart)
700 if( embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE & nMisc )
701 {
698 //Das kann ja wohl nur ein nicht aktives Objekt sein. Diese bekommen
699 //auf Wunsch die neue Groesse als VisArea gesetzt (Chart)
700 if( embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE & nMisc )
701 {
702 // TODO/MBA: testing
703 SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
704 : GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() ));
705 if( !aRect.IsEmpty() )
706 {
707 // TODO/LEAN: getMapUnit can switch object to running state
708 // xObj.TryRunningState();
709

--- 35 unchanged lines hidden (view full) ---

745 }
746 // <--
747 }
748
749 // TODO/LATER: this is only a workaround,
750 uno::Reference< chart2::XChartDocument > xChartDocument( xObj->getComponent(), uno::UNO_QUERY );
751 bLinkingChart = ( xChartDocument.is() && !xChartDocument->hasInternalDataProvider() );
752 }
702 // TODO/MBA: testing
703 SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
704 : GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() ));
705 if( !aRect.IsEmpty() )
706 {
707 // TODO/LEAN: getMapUnit can switch object to running state
708 // xObj.TryRunningState();
709

--- 35 unchanged lines hidden (view full) ---

745 }
746 // <--
747 }
748
749 // TODO/LATER: this is only a workaround,
750 uno::Reference< chart2::XChartDocument > xChartDocument( xObj->getComponent(), uno::UNO_QUERY );
751 bLinkingChart = ( xChartDocument.is() && !xChartDocument->hasInternalDataProvider() );
752 }
753 }
754 catch ( uno::Exception& )
755 {
753 }
754 catch ( uno::Exception& )
755 {
756 // TODO/LATER: handle the error
757 return;
756 // TODO/LATER: handle the error
757 return;
758 }
758 }
759
759
760 SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
761 if ( !pCli )
762 {
763 if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc)
760 SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
761 if ( !pCli )
762 {
763 if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc)
764 || bLinkingChart
765 // TODO/LATER: ResizeOnPrinterChange
766 //|| SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & xObj->GetMiscStatus()
764 || bLinkingChart
765 // TODO/LATER: ResizeOnPrinterChange
766 //|| SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & xObj->GetMiscStatus()
767 // --> OD #i117189# - refine condition for non-resizable objects
767 // --> OD #i117189# - refine condition for non-resizable objects
768 // non-resizable objects need to be set the size back by this method
769 || ( bNoTxtFrmPrtAreaChanged && nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
770 {
771 pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
772 }
773 else
774 return;
768 // non-resizable objects need to be set the size back by this method
769 || ( bNoTxtFrmPrtAreaChanged && nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
770 {
771 pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
772 }
773 else
774 return;
775 }
775 }
776
776
777 // TODO/LEAN: getMapUnit can switch object to running state
778 // xObj.TryRunningState();
777 // TODO/LEAN: getMapUnit can switch object to running state
778 // xObj.TryRunningState();
779
780 awt::Size aSize;
781 try
782 {
783 aSize = xObj->getVisualAreaSize( nAspect );
784 }
785 catch( embed::NoVisualAreaSizeException& )
786 {
787 DBG_ERROR( "Can't get visual area size!\n" );
788 // the scaling will not be done
789 }
790 catch( uno::Exception& )
791 {
792 // TODO/LATER: handle the error
793 DBG_ERROR( "Can't get visual area size!\n" );
794 return;
795 }
796
779
780 awt::Size aSize;
781 try
782 {
783 aSize = xObj->getVisualAreaSize( nAspect );
784 }
785 catch( embed::NoVisualAreaSizeException& )
786 {
787 DBG_ERROR( "Can't get visual area size!\n" );
788 // the scaling will not be done
789 }
790 catch( uno::Exception& )
791 {
792 // TODO/LATER: handle the error
793 DBG_ERROR( "Can't get visual area size!\n" );
794 return;
795 }
796
797 Size _aVisArea( aSize.Width, aSize.Height );
797 Size _aVisArea( aSize.Width, aSize.Height );
798
799 Fraction aScaleWidth( 1, 1 );
800 Fraction aScaleHeight( 1, 1 );
801
802 sal_Bool bUseObjectSize = sal_False;
803
804 // solange keine vernuenftige Size vom Object kommt, kann nichts
805 // skaliert werden
798
799 Fraction aScaleWidth( 1, 1 );
800 Fraction aScaleHeight( 1, 1 );
801
802 sal_Bool bUseObjectSize = sal_False;
803
804 // solange keine vernuenftige Size vom Object kommt, kann nichts
805 // skaliert werden
806 if( _aVisArea.Width() && _aVisArea.Height() )
806 if( _aVisArea.Width() && _aVisArea.Height() )
807 {
808 const MapMode aTmp( MAP_TWIP );
807 {
808 const MapMode aTmp( MAP_TWIP );
809 MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
810 _aVisArea = OutputDevice::LogicToLogic( _aVisArea, aUnit, aTmp);
809 MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
810 _aVisArea = OutputDevice::LogicToLogic( _aVisArea, aUnit, aTmp);
811 Size aObjArea;
812 if ( pFlyPrtRect )
813 aObjArea = pFlyPrtRect->SSize();
814 else
815 aObjArea = GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() ).SSize();
816
811 Size aObjArea;
812 if ( pFlyPrtRect )
813 aObjArea = pFlyPrtRect->SSize();
814 else
815 aObjArea = GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() ).SSize();
816
817 // differ the aObjArea and _aVisArea by 1 Pixel then set new VisArea
817 // differ the aObjArea and _aVisArea by 1 Pixel then set new VisArea
818 long nX, nY;
819 SwSelPaintRects::Get1PixelInLogic( *this, &nX, &nY );
818 long nX, nY;
819 SwSelPaintRects::Get1PixelInLogic( *this, &nX, &nY );
820 if( !( _aVisArea.Width() - nX <= aObjArea.Width() &&
820 if( !( _aVisArea.Width() - nX <= aObjArea.Width() &&
821 _aVisArea.Width() + nX >= aObjArea.Width() &&
822 _aVisArea.Height()- nY <= aObjArea.Height()&&
823 _aVisArea.Height()+ nY >= aObjArea.Height() ))
824 {
825 // TODO/LATER: MISCSTATUS_RESIZEONPRINTERCHANGE
826 /*
827 if( SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & nMisc )
828 {

--- 4 unchanged lines hidden (view full) ---

833 //in the Writer core should be resized.
834 if ( pFlyPrtRect ) //Request from core?
835 {
836 xObj->SetVisArea( OutputDevice::LogicToLogic(
837 pFlyPrtRect->SVRect(), MAP_TWIP, xObj->GetMapUnit() ));
838 }
839 else
840 {
821 _aVisArea.Width() + nX >= aObjArea.Width() &&
822 _aVisArea.Height()- nY <= aObjArea.Height()&&
823 _aVisArea.Height()+ nY >= aObjArea.Height() ))
824 {
825 // TODO/LATER: MISCSTATUS_RESIZEONPRINTERCHANGE
826 /*
827 if( SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & nMisc )
828 {

--- 4 unchanged lines hidden (view full) ---

833 //in the Writer core should be resized.
834 if ( pFlyPrtRect ) //Request from core?
835 {
836 xObj->SetVisArea( OutputDevice::LogicToLogic(
837 pFlyPrtRect->SVRect(), MAP_TWIP, xObj->GetMapUnit() ));
838 }
839 else
840 {
841 SwRect aTmp( Point( LONG_MIN, LONG_MIN ), _aVisArea );
841 SwRect aTmp( Point( LONG_MIN, LONG_MIN ), _aVisArea );
842 RequestObjectResize( aTmp, xObj );
843 }
844 //Der Rest erledigt sich, weil wir eh wiederkommen sollten, evtl.
845 //sogar rekursiv.
846 return;
847 }
842 RequestObjectResize( aTmp, xObj );
843 }
844 //Der Rest erledigt sich, weil wir eh wiederkommen sollten, evtl.
845 //sogar rekursiv.
846 return;
847 }
848 else*/
848 else*/
849
850 if ( nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE )
851 {
852 // the object must not be scaled, the size stored in object must be used for restoring
853 bUseObjectSize = sal_True;
854 }
855 else
856 {
849
850 if ( nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE )
851 {
852 // the object must not be scaled, the size stored in object must be used for restoring
853 bUseObjectSize = sal_True;
854 }
855 else
856 {
857 aScaleWidth = Fraction( aObjArea.Width(), _aVisArea.Width() );
858 aScaleHeight = Fraction( aObjArea.Height(), _aVisArea.Height());
857 aScaleWidth = Fraction( aObjArea.Width(), _aVisArea.Width() );
858 aScaleHeight = Fraction( aObjArea.Height(), _aVisArea.Height());
859 }
860 }
861 }
862
863 //Jetzt ist auch der guenstige Zeitpunkt die ObjArea einzustellen.
859 }
860 }
861 }
862
863 //Jetzt ist auch der guenstige Zeitpunkt die ObjArea einzustellen.
864 //Die Scalierung muss beruecksichtigt werden.
864 //Die Skalierung muss beruecksichtigt werden.
865 SwRect aArea;
866 if ( pFlyPrtRect )
867 {
868 aArea = *pFlyPrtRect;
869 aArea += pFlyFrmRect->Pos();
870 }
871 else
872 {
865 SwRect aArea;
866 if ( pFlyPrtRect )
867 {
868 aArea = *pFlyPrtRect;
869 aArea += pFlyFrmRect->Pos();
870 }
871 else
872 {
873 aArea = GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() );
874 aArea.Pos() += GetAnyCurRect( RECT_FLY_EMBEDDED, 0, xObj.GetObject() ).Pos();
873 aArea = GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() );
874 aArea.Pos() += GetAnyCurRect( RECT_FLY_EMBEDDED, 0, xObj.GetObject() ).Pos();
875 }
876
877 if ( bUseObjectSize )
878 {
875 }
876
877 if ( bUseObjectSize )
878 {
879 // --> this moves non-resizable object so that when adding borders the baseline remains the same
880 const SwFlyFrmFmt *pFlyFrmFmt = dynamic_cast< const SwFlyFrmFmt * >( GetFlyFrmFmt() );
881 ASSERT( pFlyFrmFmt, "Could not find fly frame." );
882 if ( pFlyFrmFmt )
883 {
884 const Point &rPoint = pFlyFrmFmt->GetLastFlyFrmPrtRectPos();
885 SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
886 : GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() ));
887 aArea += rPoint - aRect.Pos(); // adjust area by diff of printing area position in order to keep baseline alignment correct.
888 }
889 // <--
890 aArea.Width ( _aVisArea.Width() );
891 aArea.Height( _aVisArea.Height() );
879 // --> this moves non-resizable object so that when adding borders the baseline remains the same
880 const SwFlyFrmFmt *pFlyFrmFmt = dynamic_cast< const SwFlyFrmFmt * >( GetFlyFrmFmt() );
881 ASSERT( pFlyFrmFmt, "Could not find fly frame." );
882 if ( pFlyFrmFmt )
883 {
884 const Point &rPoint = pFlyFrmFmt->GetLastFlyFrmPrtRectPos();
885 SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
886 : GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() ));
887 aArea += rPoint - aRect.Pos(); // adjust area by diff of printing area position in order to keep baseline alignment correct.
888 }
889 // <--
890 aArea.Width ( _aVisArea.Width() );
891 aArea.Height( _aVisArea.Height() );
892 RequestObjectResize( aArea, xObj.GetObject() );
893 }
894 else
895 {
896 aArea.Width ( Fraction( aArea.Width() ) / pCli->GetScaleWidth() );
897 aArea.Height( Fraction( aArea.Height() ) / pCli->GetScaleHeight());
898 }
899
892 RequestObjectResize( aArea, xObj.GetObject() );
893 }
894 else
895 {
896 aArea.Width ( Fraction( aArea.Width() ) / pCli->GetScaleWidth() );
897 aArea.Height( Fraction( aArea.Height() ) / pCli->GetScaleHeight());
898 }
899
900 pCli->SetObjAreaAndScale( aArea.SVRect(), aScaleWidth, aScaleHeight );
900 pCli->SetObjAreaAndScale( aArea.SVRect(), aScaleWidth, aScaleHeight );
901}
902
903
904
905void SwWrtShell::ConnectObj( svt::EmbeddedObjectRef& xObj, const SwRect &rPrt,
906 const SwRect &rFrm )
907{
901}
902
903
904
905void SwWrtShell::ConnectObj( svt::EmbeddedObjectRef& xObj, const SwRect &rPrt,
906 const SwRect &rFrm )
907{
908 SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin());
909 if ( !pCli )
910 pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
911 CalcAndSetScale( xObj, &rPrt, &rFrm );
908 SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin());
909 if ( !pCli )
910 pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
911 CalcAndSetScale( xObj, &rPrt, &rFrm );
912}
913
914/*------------------------------------------------------------------------
915 Beschreibung: Einfuegen harter Seitenumbruch;
916 Selektionen werden ueberschrieben
917------------------------------------------------------------------------*/
918
919
920
921void SwWrtShell::InsertPageBreak(const String *pPageDesc, sal_uInt16 nPgNum )
922{
923 ResetCursorStack();
924 if( _CanInsert() )
925 {
926 ACT_KONTEXT(this);
912}
913
914/*------------------------------------------------------------------------
915 Beschreibung: Einfuegen harter Seitenumbruch;
916 Selektionen werden ueberschrieben
917------------------------------------------------------------------------*/
918
919
920
921void SwWrtShell::InsertPageBreak(const String *pPageDesc, sal_uInt16 nPgNum )
922{
923 ResetCursorStack();
924 if( _CanInsert() )
925 {
926 ACT_KONTEXT(this);
927 StartUndo(UNDO_UI_INSERT_PAGE_BREAK);
927 StartUndo(UNDO_UI_INSERT_PAGE_BREAK);
928
929 if ( !IsCrsrInTbl() )
930 {
931 if(HasSelection())
932 DelRight();
933 SwFEShell::SplitNode();
934 }
935
936 const SwPageDesc *pDesc = pPageDesc
937 ? FindPageDescByName( *pPageDesc, sal_True ) : 0;
938 if( pDesc )
939 {
940 SwFmtPageDesc aDesc( pDesc );
941 aDesc.SetNumOffset( nPgNum );
942 SetAttrItem( aDesc );
943 }
944 else
928
929 if ( !IsCrsrInTbl() )
930 {
931 if(HasSelection())
932 DelRight();
933 SwFEShell::SplitNode();
934 }
935
936 const SwPageDesc *pDesc = pPageDesc
937 ? FindPageDescByName( *pPageDesc, sal_True ) : 0;
938 if( pDesc )
939 {
940 SwFmtPageDesc aDesc( pDesc );
941 aDesc.SetNumOffset( nPgNum );
942 SetAttrItem( aDesc );
943 }
944 else
945 SetAttrItem( SvxFmtBreakItem(SVX_BREAK_PAGE_BEFORE, RES_BREAK) );
946 EndUndo(UNDO_UI_INSERT_PAGE_BREAK);
945 SetAttrItem( SvxFmtBreakItem(SVX_BREAK_PAGE_BEFORE, RES_BREAK) );
946 EndUndo(UNDO_UI_INSERT_PAGE_BREAK);
947 }
948}
949/*------------------------------------------------------------------------
950 Beschreibung: Einfuegen harter Zeilenumbruch;
951 Selektionen werden ueberschrieben
952------------------------------------------------------------------------*/
953
954
955void SwWrtShell::InsertLineBreak()
956{
957 ResetCursorStack();
958 if( _CanInsert() )
959 {
960 if(HasSelection())
961 DelRight();
962
963 const sal_Unicode cIns = 0x0A;
964 SvxAutoCorrect* pACorr = lcl_IsAutoCorr();
947 }
948}
949/*------------------------------------------------------------------------
950 Beschreibung: Einfuegen harter Zeilenumbruch;
951 Selektionen werden ueberschrieben
952------------------------------------------------------------------------*/
953
954
955void SwWrtShell::InsertLineBreak()
956{
957 ResetCursorStack();
958 if( _CanInsert() )
959 {
960 if(HasSelection())
961 DelRight();
962
963 const sal_Unicode cIns = 0x0A;
964 SvxAutoCorrect* pACorr = lcl_IsAutoCorr();
965 if( pACorr )
965 if( pACorr )
966 AutoCorrect( *pACorr, cIns );
967 else
968 SwWrtShell::Insert( String( cIns ) );
969 }
970}
971/*------------------------------------------------------------------------
972 Beschreibung: Einfuegen harter Spaltenumbruch;
973 Selektionen werden ueberschrieben
974------------------------------------------------------------------------*/
975
976
977void SwWrtShell::InsertColumnBreak()
978{
979 ACT_KONTEXT(this);
980 ResetCursorStack();
981 if( _CanInsert() )
982 {
966 AutoCorrect( *pACorr, cIns );
967 else
968 SwWrtShell::Insert( String( cIns ) );
969 }
970}
971/*------------------------------------------------------------------------
972 Beschreibung: Einfuegen harter Spaltenumbruch;
973 Selektionen werden ueberschrieben
974------------------------------------------------------------------------*/
975
976
977void SwWrtShell::InsertColumnBreak()
978{
979 ACT_KONTEXT(this);
980 ResetCursorStack();
981 if( _CanInsert() )
982 {
983 StartUndo(UNDO_UI_INSERT_COLUMN_BREAK);
983 StartUndo(UNDO_UI_INSERT_COLUMN_BREAK);
984
985 if ( !IsCrsrInTbl() )
986 {
987 if(HasSelection())
988 DelRight();
989 SwFEShell::SplitNode( sal_False, sal_False );
990 }
984
985 if ( !IsCrsrInTbl() )
986 {
987 if(HasSelection())
988 DelRight();
989 SwFEShell::SplitNode( sal_False, sal_False );
990 }
991 SetAttrItem(SvxFmtBreakItem(SVX_BREAK_COLUMN_BEFORE, RES_BREAK));
991 SetAttrItem(SvxFmtBreakItem(SVX_BREAK_COLUMN_BEFORE, RES_BREAK));
992
992
993 EndUndo(UNDO_UI_INSERT_COLUMN_BREAK);
993 EndUndo(UNDO_UI_INSERT_COLUMN_BREAK);
994 }
995}
996
997/*------------------------------------------------------------------------
998 Beschreibung: Einfuegen Fussnote
999 Parameter: rStr -- optionales Fussnotenzeichen
1000------------------------------------------------------------------------*/
1001
1002
1003void SwWrtShell::InsertFootnote(const String &rStr, sal_Bool bEndNote, sal_Bool bEdit )
1004{
1005 ResetCursorStack();
1006 if( _CanInsert() )
1007 {
1008 if(HasSelection())
994 }
995}
996
997/*------------------------------------------------------------------------
998 Beschreibung: Einfuegen Fussnote
999 Parameter: rStr -- optionales Fussnotenzeichen
1000------------------------------------------------------------------------*/
1001
1002
1003void SwWrtShell::InsertFootnote(const String &rStr, sal_Bool bEndNote, sal_Bool bEdit )
1004{
1005 ResetCursorStack();
1006 if( _CanInsert() )
1007 {
1008 if(HasSelection())
1009 {
1010 //collapse cursor to the end
1011 if(!IsCrsrPtAtEnd())
1012 SwapPam();
1013 ClearMark();
1014 }
1009 {
1010 //collapse cursor to the end
1011 if(!IsCrsrPtAtEnd())
1012 SwapPam();
1013 ClearMark();
1014 }
1015
1016 SwFmtFtn aFootNote( bEndNote );
1017 if(rStr.Len())
1018 aFootNote.SetNumStr( rStr );
1019
1020 SetAttrItem(aFootNote);
1021
1022 if( bEdit )

--- 13 unchanged lines hidden (view full) ---

1036
1037void SwWrtShell::SplitNode( sal_Bool bAutoFmt, sal_Bool bCheckTableStart )
1038{
1039 ResetCursorStack();
1040 if( _CanInsert() )
1041 {
1042 ACT_KONTEXT(this);
1043
1015
1016 SwFmtFtn aFootNote( bEndNote );
1017 if(rStr.Len())
1018 aFootNote.SetNumStr( rStr );
1019
1020 SetAttrItem(aFootNote);
1021
1022 if( bEdit )

--- 13 unchanged lines hidden (view full) ---

1036
1037void SwWrtShell::SplitNode( sal_Bool bAutoFmt, sal_Bool bCheckTableStart )
1038{
1039 ResetCursorStack();
1040 if( _CanInsert() )
1041 {
1042 ACT_KONTEXT(this);
1043
1044 rView.GetEditWin().FlushInBuffer();
1044 rView.GetEditWin().FlushInBuffer();
1045 sal_Bool bHasSel = HasSelection();
1046 if( bHasSel )
1047 {
1048 StartUndo( UNDO_INSERT );
1049 DelRight();
1050 }
1051
1052 SwFEShell::SplitNode( bAutoFmt, bCheckTableStart );

--- 17 unchanged lines hidden (view full) ---

1070// --> OD 2005-10-25 #b6340308#
1071// Preconditions (as far as OD has figured out):
1072// - <SwEditShell::HasNumber()> is sal_False, if <bNum> is sal_True
1073// - <SwEditShell::HasBullet()> is sal_False, if <bNum> is sal_False
1074// Behavior of method is determined by the current situation at the current
1075// cursor position in the document.
1076void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
1077{
1045 sal_Bool bHasSel = HasSelection();
1046 if( bHasSel )
1047 {
1048 StartUndo( UNDO_INSERT );
1049 DelRight();
1050 }
1051
1052 SwFEShell::SplitNode( bAutoFmt, bCheckTableStart );

--- 17 unchanged lines hidden (view full) ---

1070// --> OD 2005-10-25 #b6340308#
1071// Preconditions (as far as OD has figured out):
1072// - <SwEditShell::HasNumber()> is sal_False, if <bNum> is sal_True
1073// - <SwEditShell::HasBullet()> is sal_False, if <bNum> is sal_False
1074// Behavior of method is determined by the current situation at the current
1075// cursor position in the document.
1076void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
1077{
1078 // determine numbering rule found at current cursor position in the docment.
1079 const SwNumRule* pCurRule = GetNumRuleAtCurrCrsrPos();
1078 // determine numbering rule found at current cursor position in the document.
1079 const SwNumRule* pCurRule = GetNumRuleAtCurrCrsrPos();
1080
1080
1081 StartUndo(UNDO_NUMORNONUM);
1081 StartUndo(UNDO_NUMORNONUM);
1082
1082
1083 const SwNumRule * pNumRule = pCurRule;
1083 const SwNumRule * pNumRule = pCurRule;
1084
1084
1085 // --> OD 2005-10-25 #b6340308#
1086 // - activate outline rule respectively turning on outline rule for
1087 // current text node. But, only for turning on a numbering (<bNum> == sal_True).
1088 // - overwrite found numbering rule at current cursor position, if
1089 // no numbering rule can be retrieved from the paragraph style.
1090 bool bContinueFoundNumRule( false );
1091 bool bActivateOutlineRule( false );
1092 int nActivateOutlineLvl( MAXLEVEL ); // only relevant, if <bActivateOutlineRule> == sal_True
1093 SwTxtFmtColl * pColl = GetCurTxtFmtColl();
1094 if ( pColl )
1095 {
1096 // --> OD 2005-10-25 #b6340308# - retrieve numbering rule at paragraph
1097 // style, which is found at current cursor position in the document.
1098 SwNumRule* pCollRule = pDoc->FindNumRulePtr(pColl->GetNumRule().GetValue());
1099 // --> OD 2005-10-25 #125993# - The outline numbering rule isn't allowed
1100 // to be derived from a parent paragraph style to a derived one.
1101 // Thus check, if the found outline numbering rule is directly
1102 // set at the paragraph style <pColl>. If not, set <pCollRule> to NULL
1103 if ( pCollRule && pCollRule == GetDoc()->GetOutlineNumRule() )
1104 {
1105 const SwNumRule* pDirectCollRule =
1106 pDoc->FindNumRulePtr(pColl->GetNumRule( sal_False ).GetValue());
1107 if ( !pDirectCollRule )
1108 {
1109 pCollRule = 0;
1110 }
1111 }
1112 // --> OD 2006-11-20 #i71764#
1113 // Document setting OUTLINE_LEVEL_YIELDS_OUTLINE_RULE has no influence
1114 // any more.
1115// if ( pCollRule == NULL &&
1116// NO_NUMBERING != pColl->GetOutlineLevel() &&
1117// GetDoc()->get(IDocumentSettingAccess::OUTLINE_LEVEL_YIELDS_OUTLINE_RULE) )
1118// {
1119// pCollRule = GetDoc()->GetOutlineNumRule();
1120// }
1121 // <--
1085 // --> OD 2005-10-25 #b6340308#
1086 // - activate outline rule respectively turning on outline rule for
1087 // current text node. But, only for turning on a numbering (<bNum> == sal_True).
1088 // - overwrite found numbering rule at current cursor position, if
1089 // no numbering rule can be retrieved from the paragraph style.
1090 bool bContinueFoundNumRule( false );
1091 bool bActivateOutlineRule( false );
1092 int nActivateOutlineLvl( MAXLEVEL ); // only relevant, if <bActivateOutlineRule> == sal_True
1093 SwTxtFmtColl * pColl = GetCurTxtFmtColl();
1094 if ( pColl )
1095 {
1096 // --> OD 2005-10-25 #b6340308# - retrieve numbering rule at paragraph
1097 // style, which is found at current cursor position in the document.
1098 SwNumRule* pCollRule = pDoc->FindNumRulePtr(pColl->GetNumRule().GetValue());
1099 // --> OD 2005-10-25 #125993# - The outline numbering rule isn't allowed
1100 // to be derived from a parent paragraph style to a derived one.
1101 // Thus check, if the found outline numbering rule is directly
1102 // set at the paragraph style <pColl>. If not, set <pCollRule> to NULL
1103 if ( pCollRule && pCollRule == GetDoc()->GetOutlineNumRule() )
1104 {
1105 const SwNumRule* pDirectCollRule =
1106 pDoc->FindNumRulePtr(pColl->GetNumRule( sal_False ).GetValue());
1107 if ( !pDirectCollRule )
1108 {
1109 pCollRule = 0;
1110 }
1111 }
1112 // --> OD 2006-11-20 #i71764#
1113 // Document setting OUTLINE_LEVEL_YIELDS_OUTLINE_RULE has no influence
1114 // any more.
1115// if ( pCollRule == NULL &&
1116// NO_NUMBERING != pColl->GetOutlineLevel() &&
1117// GetDoc()->get(IDocumentSettingAccess::OUTLINE_LEVEL_YIELDS_OUTLINE_RULE) )
1118// {
1119// pCollRule = GetDoc()->GetOutlineNumRule();
1120// }
1121 // <--
1122
1122
1123 // <--
1124 // --> OD 2005-10-25 #b6340308#
1125 if ( !pCollRule )
1126 {
1127 pNumRule = pCollRule;
1128 }
1129 // --> OD 2006-06-12 #b6435904#
1130 // no activation or continuation of outline numbering in Writer/Web document
1131 else if ( bNum &&
1123 // <--
1124 // --> OD 2005-10-25 #b6340308#
1125 if ( !pCollRule )
1126 {
1127 pNumRule = pCollRule;
1128 }
1129 // --> OD 2006-06-12 #b6435904#
1130 // no activation or continuation of outline numbering in Writer/Web document
1131 else if ( bNum &&
1132 !dynamic_cast<SwWebDocShell*>(GetDoc()->GetDocShell()) &&
1133 pCollRule == GetDoc()->GetOutlineNumRule() )
1134 // <--
1135 {
1136 if ( pNumRule == pCollRule )
1137 {
1138 // check, if text node at current cursor positioned is counted.
1139 // If not, let it been counted. Then it has to be checked,
1140 // of the outline numbering has to be activated or continued.
1141 SwTxtNode* pTxtNode =
1142 GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode();
1143 if ( pTxtNode && !pTxtNode->IsCountedInList() )
1144 {
1132 !dynamic_cast<SwWebDocShell*>(GetDoc()->GetDocShell()) &&
1133 pCollRule == GetDoc()->GetOutlineNumRule() )
1134 // <--
1135 {
1136 if ( pNumRule == pCollRule )
1137 {
1138 // check, if text node at current cursor positioned is counted.
1139 // If not, let it been counted. Then it has to be checked,
1140 // of the outline numbering has to be activated or continued.
1141 SwTxtNode* pTxtNode =
1142 GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode();
1143 if ( pTxtNode && !pTxtNode->IsCountedInList() )
1144 {
1145 // check, if numbering of the outline level of the pararaph
1145 // check, if numbering of the outline level of the paragraph
1146 // style is active. If not, activate this outline level.
1147 nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
1148 ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(), //<-end,zhaojianwei
1149 "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
1150 if ( pColl->IsAssignedToListLevelOfOutlineStyle() && //<-end,zhaojianwei
1151 pCollRule->Get( static_cast<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
1152 == SVX_NUM_NUMBER_NONE )
1153 {

--- 32 unchanged lines hidden (view full) ---

1186 {
1187 // turning on outline numbering at current cursor position
1188 bContinueFoundNumRule = true;
1189 }
1190 // <--
1191 }
1192 else
1193 {
1146 // style is active. If not, activate this outline level.
1147 nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
1148 ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(), //<-end,zhaojianwei
1149 "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
1150 if ( pColl->IsAssignedToListLevelOfOutlineStyle() && //<-end,zhaojianwei
1151 pCollRule->Get( static_cast<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
1152 == SVX_NUM_NUMBER_NONE )
1153 {

--- 32 unchanged lines hidden (view full) ---

1186 {
1187 // turning on outline numbering at current cursor position
1188 bContinueFoundNumRule = true;
1189 }
1190 // <--
1191 }
1192 else
1193 {
1194 // check, if numbering of the outline level of the pararaph
1194 // check, if numbering of the outline level of the paragraph
1195 // style is active. If not, activate this outline level.
1196 nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//#outline level,zhaojianwei
1197 ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(),//#outline level,zhaojianwei
1198 "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
1199 if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&//#outline level,zhaojianwei
1200 pCollRule->Get( static_cast<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
1201 == SVX_NUM_NUMBER_NONE )
1202 {

--- 480 unchanged lines hidden (view full) ---

1683 RES_FRMATR_BEGIN, RES_FRMATR_END - 1,
1684 SID_ATTR_TABSTOP_POS, SID_ATTR_TABSTOP_POS,
1685 SID_ATTR_TABSTOP_DEFAULTS, SID_ATTR_TABSTOP_DEFAULTS,
1686 SID_ATTR_TABSTOP_OFFSET, SID_ATTR_TABSTOP_OFFSET,
1687 SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
1688 SID_ATTR_PARA_MODEL, SID_ATTR_PARA_KEEP,
1689 SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM,
1690 0 );
1195 // style is active. If not, activate this outline level.
1196 nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//#outline level,zhaojianwei
1197 ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(),//#outline level,zhaojianwei
1198 "<SwWrtShell::NumOrBulletOn(..)> - paragraph style with outline rule, but no outline level" );
1199 if ( pColl->IsAssignedToListLevelOfOutlineStyle() &&//#outline level,zhaojianwei
1200 pCollRule->Get( static_cast<sal_uInt16>(nActivateOutlineLvl) ).GetNumberingType()
1201 == SVX_NUM_NUMBER_NONE )
1202 {

--- 480 unchanged lines hidden (view full) ---

1683 RES_FRMATR_BEGIN, RES_FRMATR_END - 1,
1684 SID_ATTR_TABSTOP_POS, SID_ATTR_TABSTOP_POS,
1685 SID_ATTR_TABSTOP_DEFAULTS, SID_ATTR_TABSTOP_DEFAULTS,
1686 SID_ATTR_TABSTOP_OFFSET, SID_ATTR_TABSTOP_OFFSET,
1687 SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
1688 SID_ATTR_PARA_MODEL, SID_ATTR_PARA_KEEP,
1689 SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM,
1690 0 );
1691 GetCurAttr( aCoreSet );
1691 GetCurAttr( aCoreSet );
1692 sal_Bool bReset = sal_False;
1693 SfxItemIter aParaIter( aCoreSet );
1694 const SfxPoolItem* pParaItem = aParaIter.FirstItem();
1695 while( pParaItem )
1696 {
1697 if(!IsInvalidItem(pParaItem))
1698 {
1699 sal_uInt16 nWhich = pParaItem->Which();

--- 20 unchanged lines hidden (view full) ---

1720
1721--------------------------------------------------*/
1722
1723void SwWrtShell::AutoUpdateFrame( SwFrmFmt* pFmt, const SfxItemSet& rStyleSet )
1724{
1725 StartAction();
1726
1727 ResetFlyFrmAttr( 0, &rStyleSet );
1692 sal_Bool bReset = sal_False;
1693 SfxItemIter aParaIter( aCoreSet );
1694 const SfxPoolItem* pParaItem = aParaIter.FirstItem();
1695 while( pParaItem )
1696 {
1697 if(!IsInvalidItem(pParaItem))
1698 {
1699 sal_uInt16 nWhich = pParaItem->Which();

--- 20 unchanged lines hidden (view full) ---

1720
1721--------------------------------------------------*/
1722
1723void SwWrtShell::AutoUpdateFrame( SwFrmFmt* pFmt, const SfxItemSet& rStyleSet )
1724{
1725 StartAction();
1726
1727 ResetFlyFrmAttr( 0, &rStyleSet );
1728 pFmt->SetFmtAttr( rStyleSet );
1728 pFmt->SetFmtAttr( rStyleSet );
1729
1730 EndAction();
1731}
1732
1733
1734void SwWrtShell::AutoCorrect( SvxAutoCorrect& rACorr, sal_Unicode cChar )
1735{
1736 ResetCursorStack();

--- 20 unchanged lines hidden (view full) ---

1757}
1758
1759
1760/*
1761 * eine Art kontrollierter copy ctor
1762 */
1763
1764SwWrtShell::SwWrtShell( SwWrtShell& rSh, Window *_pWin, SwView &rShell )
1729
1730 EndAction();
1731}
1732
1733
1734void SwWrtShell::AutoCorrect( SvxAutoCorrect& rACorr, sal_Unicode cChar )
1735{
1736 ResetCursorStack();

--- 20 unchanged lines hidden (view full) ---

1757}
1758
1759
1760/*
1761 * eine Art kontrollierter copy ctor
1762 */
1763
1764SwWrtShell::SwWrtShell( SwWrtShell& rSh, Window *_pWin, SwView &rShell )
1765 : SwFEShell( rSh, _pWin ),
1765 : SwFEShell( rSh, _pWin ),
1766 COMMON_INI_LIST
1767{
1768 BITFLD_INI_LIST
1769 SET_CURR_SHELL( this );
1770
1771 SetSfxViewShell( (SfxViewShell *)&rShell );
1772 SetFlyMacroLnk( LINK(this, SwWrtShell, ExecFlyMac) );
1773

--- 44 unchanged lines hidden (view full) ---

1818}
1819
1820/*--------------------------------------------------------------------
1821 Beschreibung:
1822 --------------------------------------------------------------------*/
1823bool SwWrtShell::CanInsert()
1824{
1825 // #123922# The original expression looks sleek, but it is not. Using the mathematical or ('|')
1766 COMMON_INI_LIST
1767{
1768 BITFLD_INI_LIST
1769 SET_CURR_SHELL( this );
1770
1771 SetSfxViewShell( (SfxViewShell *)&rShell );
1772 SetFlyMacroLnk( LINK(this, SwWrtShell, ExecFlyMac) );
1773

--- 44 unchanged lines hidden (view full) ---

1818}
1819
1820/*--------------------------------------------------------------------
1821 Beschreibung:
1822 --------------------------------------------------------------------*/
1823bool SwWrtShell::CanInsert()
1824{
1825 // #123922# The original expression looks sleek, but it is not. Using the mathematical or ('|')
1826 // instead of the logical one ('||') forces the compiler to evaluate all conditions to allow or-ing
1827 // them together (yes, he could do better). Using the logical or allows to return on the first
1826 // instead of the logical one ('||') forces the compiler to evaluate all conditions to allow or-ing
1827 // them together (yes, he could do better). Using the logical or allows to return on the first
1828 // failing statement instead.
1829 //
1830 // return (!(IsSelFrmMode() | IsObjSelected() | (GetView().GetDrawFuncPtr() != NULL) | (GetView().GetPostItMgr()->GetActiveSidebarWin()!= NULL)));
1831
1832 if(IsSelFrmMode())
1833 {
1834 return false;
1835 }

--- 59 unchanged lines hidden (view full) ---

1895
1896void SwWrtShell::ApplyViewOptions( const SwViewOption &rOpt )
1897{
1898 SwFEShell::ApplyViewOptions( rOpt );
1899 //#i115062# invalidate meta character slot
1900 GetView().GetViewFrame()->GetBindings().Invalidate( FN_VIEW_META_CHARS );
1901}
1902
1828 // failing statement instead.
1829 //
1830 // return (!(IsSelFrmMode() | IsObjSelected() | (GetView().GetDrawFuncPtr() != NULL) | (GetView().GetPostItMgr()->GetActiveSidebarWin()!= NULL)));
1831
1832 if(IsSelFrmMode())
1833 {
1834 return false;
1835 }

--- 59 unchanged lines hidden (view full) ---

1895
1896void SwWrtShell::ApplyViewOptions( const SwViewOption &rOpt )
1897{
1898 SwFEShell::ApplyViewOptions( rOpt );
1899 //#i115062# invalidate meta character slot
1900 GetView().GetViewFrame()->GetBindings().Invalidate( FN_VIEW_META_CHARS );
1901}
1902
1903
1903/* vim: set noet sw=4 ts=4: */