1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
21 #include <com/sun/star/linguistic2/XSpellChecker1.hpp>
24 #include <editeng/unolingu.hxx>
25 #include <sfx2/request.hxx>
26 #include <svx/obj3d.hxx>
27 #include <svx/fmview.hxx>
28 #include <editeng/outliner.hxx>
29 #include <svx/svxids.hrc>
30 #include <svx/svdograf.hxx>
31 #include <svx/svdoole2.hxx>
32 #include <svx/svdundo.hxx>
33 #include <vcl/msgbox.hxx>
34 #include <sfx2/dispatch.hxx>
35 #include <sfx2/app.hxx>
36 #include <svx/svdpagv.hxx>
37 #include <sfx2/docfile.hxx>
38 #include <svx/svdoutl.hxx>
39 #include <svx/sdr/contact/displayinfo.hxx>
41 #include <svx/svdetc.hxx>
42 #include <editeng/editstat.hxx>
44 #include <svx/dialogs.hrc>
45 #include <sfx2/viewfrm.hxx>
46 #include <sfx2/sidebar/EnumContext.hxx>
47 #include <svx/svdopage.hxx>
48 #include <toolkit/helper/vclunohelper.hxx>
49 #include <svx/xlndsit.hxx>
50 #include <svx/xlineit0.hxx>
51 #include <svx/xlnclit.hxx>
52 #include <svx/sidebar/ContextChangeEventMultiplexer.hxx>
53 #include <vcl/virdev.hxx>
56 #include "strings.hrc"
59 #include "drawdoc.hxx"
60 #include "DrawDocShell.hxx"
64 #include "sdresid.hxx"
65 #include "DrawViewShell.hxx"
67 #include "fuinsfil.hxx"
68 #include "slideshow.hxx"
69 #include "stlpool.hxx"
70 #include "FrameView.hxx"
71 #include "ViewClipboard.hxx"
72 #include "undo/undomanager.hxx"
73 #include <svx/sdr/contact/viewobjectcontact.hxx>
74 #include <svx/sdr/contact/viewcontact.hxx>
75 #include <svx/svdotable.hxx>
76 #include "EventMultiplexer.hxx"
77 #include "ViewShellBase.hxx"
78 #include "ViewShellManager.hxx"
80 #include <basegfx/polygon/b2dpolygontools.hxx>
81 #include <basegfx/color/bcolor.hxx>
82 #include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
83 #include <drawinglayer/primitive2d/textlayoutdevice.hxx>
84 #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
85 #include <svx/sdr/contact/objectcontact.hxx>
86 #include <svx/sdr/table/tablecontroller.hxx>
87 #include <basegfx/matrix/b2dhommatrix.hxx>
88 #include <drawinglayer/primitive2d/textprimitive2d.hxx>
89 #include <svx/unoapi.hxx>
90 #include <basegfx/matrix/b2dhommatrixtools.hxx>
91 #include "DrawController.hxx"
95 using namespace com::sun::star
;
96 using namespace com::sun::star::uno
;
97 using namespace sdr::table
;
100 TYPEINIT1(View
, FmFormView
);
103 View::View(SdDrawDocument
& rDrawDoc
, OutputDevice
* pOutDev
,
104 ViewShell
* pViewShell
)
105 : FmFormView(&rDrawDoc
, pOutDev
),
107 mpDocSh(rDrawDoc
.GetDocSh()),
108 mpViewSh(pViewShell
),
109 mpDragSrcMarkList(NULL
),
110 mpDropMarkerObj(NULL
),
112 mnDragSrcPgNum(SDRPAGE_NOTFOUND
),
113 mnAction(DND_ACTION_NONE
),
115 mbIsDropAllowed(sal_True
),
117 mpClipboard (new ViewClipboard (*this))
119 // #i73602# Use default from the configuration
120 SetBufferedOverlayAllowed(getOptionsDrawinglayer().IsOverlayBuffer_DrawImpress());
122 // #i74769#, #i75172# Use default from the configuration
123 SetBufferedOutputAllowed(getOptionsDrawinglayer().IsPaintBuffer_DrawImpress());
125 EnableExtendedKeyInputDispatcher(sal_False
);
126 EnableExtendedMouseEventDispatcher(sal_False
);
127 EnableExtendedCommandEventDispatcher(sal_False
);
129 SetUseIncompatiblePathCreateInterface(sal_False
);
130 SetMarkHdlWhenTextEdit(sal_True
);
131 EnableTextEditOnObjectsWithoutTextIfTextTool(sal_True
);
133 SetMinMoveDistancePixel(2);
134 SetHitTolerancePixel(2);
135 SetMeasureLayer(String(SdResId(STR_LAYER_MEASURELINES
)));
137 // Timer for delayed drop (has to be for MAC)
138 maDropErrorTimer
.SetTimeoutHdl( LINK(this, View
, DropErrorHdl
) );
139 maDropErrorTimer
.SetTimeout(50);
140 maDropInsertFileTimer
.SetTimeoutHdl( LINK(this, View
, DropInsertFileHdl
) );
141 maDropInsertFileTimer
.SetTimeout(50);
144 void View::ImplClearDrawDropMarker()
156 maSmartTags
.Dispose();
158 // release content of selection clipboard, if we own the content
159 UpdateSelectionClipboard( sal_True
);
161 maDropErrorTimer
.Stop();
162 maDropInsertFileTimer
.Stop();
164 ImplClearDrawDropMarker();
166 while(PaintWindowCount())
168 // remove all registered OutDevs
169 DeleteWindowFromPaintView(GetFirstOutputDevice() /*GetWin(0)*/);
174 class ViewRedirector
: public ::sdr::contact::ViewObjectContactRedirector
178 virtual ~ViewRedirector();
180 // all default implementations just call the same methods at the original. To do something
181 // different, overload the method and at least do what the method does.
182 virtual drawinglayer::primitive2d::Primitive2DSequence
createRedirectedPrimitive2DSequence(
183 const sdr::contact::ViewObjectContact
& rOriginal
,
184 const sdr::contact::DisplayInfo
& rDisplayInfo
);
187 ViewRedirector::ViewRedirector()
191 ViewRedirector::~ViewRedirector()
195 drawinglayer::primitive2d::Primitive2DSequence
ViewRedirector::createRedirectedPrimitive2DSequence(
196 const sdr::contact::ViewObjectContact
& rOriginal
,
197 const sdr::contact::DisplayInfo
& rDisplayInfo
)
199 SdrObject
* pObject
= rOriginal
.GetViewContact().TryToGetSdrObject();
200 drawinglayer::primitive2d::Primitive2DSequence xRetval
;
202 if(pObject
&& pObject
->GetPage())
204 const bool bDoCreateGeometry(pObject
->GetPage()->checkVisibility( rOriginal
, rDisplayInfo
, true ));
206 if(!bDoCreateGeometry
&& !(( pObject
->GetObjInventor() == SdrInventor
) && ( pObject
->GetObjIdentifier() == OBJ_PAGE
)) )
209 PresObjKind
eKind(PRESOBJ_NONE
);
210 const bool bSubContentProcessing(rDisplayInfo
.GetSubContentActive());
211 const bool bIsMasterPageObject(pObject
->GetPage()->IsMasterPage());
212 const bool bIsPrinting(rOriginal
.GetObjectContact().isOutputToPrinter());
213 const SdrPageView
* pPageView
= rOriginal
.GetObjectContact().TryToGetSdrPageView();
214 const SdrPage
* pVisualizedPage
= GetSdrPageFromXDrawPage(rOriginal
.GetObjectContact().getViewInformation2D().getVisualizedPage());
215 const SdPage
* pObjectsSdPage
= dynamic_cast< SdPage
* >(pObject
->GetPage());
216 const bool bIsInsidePageObj(pPageView
&& pPageView
->GetPage() != pVisualizedPage
);
218 // check if we need to draw a placeholder border. Never do it for
219 // objects inside a SdrPageObj and never when printing
220 if(!bIsInsidePageObj
&& !bIsPrinting
)
222 bool bCreateOutline(false);
224 if( pObject
->IsEmptyPresObj() && pObject
->ISA(SdrTextObj
) )
226 if( !bSubContentProcessing
|| !pObject
->IsNotVisibleAsMaster() )
228 eKind
= pObjectsSdPage
? pObjectsSdPage
->GetPresObjKind(pObject
) : PRESOBJ_NONE
;
229 bCreateOutline
= true;
232 else if( ( pObject
->GetObjInventor() == SdrInventor
) && ( pObject
->GetObjIdentifier() == OBJ_TEXT
) )
236 eKind
= pObjectsSdPage
->GetPresObjKind(pObject
);
238 if((eKind
== PRESOBJ_FOOTER
) || (eKind
== PRESOBJ_HEADER
) || (eKind
== PRESOBJ_DATETIME
) || (eKind
== PRESOBJ_SLIDENUMBER
) )
240 if( !bSubContentProcessing
)
242 // only draw a boundary for header&footer objects on the masterpage itself
243 bCreateOutline
= true;
248 else if( ( pObject
->GetObjInventor() == SdrInventor
) && ( pObject
->GetObjIdentifier() == OBJ_PAGE
) )
250 // only for handout page, else this frame will be created for each
251 // page preview object in SlideSorter and PagePane
252 if(pObjectsSdPage
&& PK_HANDOUT
== pObjectsSdPage
->GetPageKind())
254 bCreateOutline
= true;
260 // empty presentation objects get a gray frame
261 const svtools::ColorConfig aColorConfig
;
262 const svtools::ColorConfigValue
aColor( aColorConfig
.GetColorValue( svtools::OBJECTBOUNDARIES
) );
264 if( aColor
.bIsVisible
)
266 // get basic object transformation
267 const basegfx::BColor
aRGBColor(Color(aColor
.nColor
).getBColor());
268 basegfx::B2DHomMatrix aObjectMatrix
;
269 basegfx::B2DPolyPolygon aObjectPolyPolygon
;
270 pObject
->TRGetBaseGeometry(aObjectMatrix
, aObjectPolyPolygon
);
272 // create dashed border
274 // create object polygon
275 basegfx::B2DPolygon
aPolygon(basegfx::tools::createUnitPolygon());
276 aPolygon
.transform(aObjectMatrix
);
278 // create line and stroke attribute
279 ::std::vector
< double > aDotDashArray
;
281 aDotDashArray
.push_back(160.0);
282 aDotDashArray
.push_back(80.0);
284 const double fFullDotDashLen(::std::accumulate(aDotDashArray
.begin(), aDotDashArray
.end(), 0.0));
285 const drawinglayer::attribute::LineAttribute
aLine(aRGBColor
);
286 const drawinglayer::attribute::StrokeAttribute
aStroke(aDotDashArray
, fFullDotDashLen
);
288 // create primitive and add
289 const drawinglayer::primitive2d::Primitive2DReference
xRef(new drawinglayer::primitive2d::PolygonStrokePrimitive2D(
293 drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval
, xRef
);
296 // now paint the placeholder description, but only when masterpage
297 // is displayed as page directly (MasterPage view)
298 if(!bSubContentProcessing
&& bIsMasterPageObject
)
300 String aObjectString
;
306 if(pObjectsSdPage
&& pObjectsSdPage
->GetPageKind() == PK_STANDARD
)
308 static String
aTitleAreaStr( SdResId( STR_PLACEHOLDER_DESCRIPTION_TITLE
) );
309 aObjectString
= aTitleAreaStr
;
314 case PRESOBJ_OUTLINE
:
316 static String
aOutlineAreaStr( SdResId( STR_PLACEHOLDER_DESCRIPTION_OUTLINE
) );
317 aObjectString
= aOutlineAreaStr
;
322 static String
aFooterAreaStr( SdResId( STR_PLACEHOLDER_DESCRIPTION_FOOTER
) );
323 aObjectString
= aFooterAreaStr
;
328 static String
aHeaderAreaStr( SdResId( STR_PLACEHOLDER_DESCRIPTION_HEADER
) );
329 aObjectString
= aHeaderAreaStr
;
332 case PRESOBJ_DATETIME
:
334 static String
aDateTimeStr( SdResId( STR_PLACEHOLDER_DESCRIPTION_DATETIME
) );
335 aObjectString
= aDateTimeStr
;
340 static String
aDateTimeStr( SdResId( STR_PLACEHOLDER_DESCRIPTION_NOTES
) );
341 aObjectString
= aDateTimeStr
;
344 case PRESOBJ_SLIDENUMBER
:
346 if(pObjectsSdPage
&& pObjectsSdPage
->GetPageKind() == PK_STANDARD
)
348 static String
aSlideAreaStr( SdResId( STR_PLACEHOLDER_DESCRIPTION_SLIDE
) );
349 aObjectString
= aSlideAreaStr
;
353 static String
aNumberAreaStr( SdResId( STR_PLACEHOLDER_DESCRIPTION_NUMBER
) );
354 aObjectString
= aNumberAreaStr
;
364 if( aObjectString
.Len() )
366 // decompose object matrix to be able to place text correctly
367 basegfx::B2DTuple aScale
;
368 basegfx::B2DTuple aTranslate
;
369 double fRotate
, fShearX
;
370 aObjectMatrix
.decompose(aScale
, aTranslate
, fRotate
, fShearX
);
373 SdrTextObj
* pTextObj
= dynamic_cast< SdrTextObj
* >( pObject
);
374 const SdrTextVertAdjust
eTVA(pTextObj
? pTextObj
->GetTextVerticalAdjust() : SDRTEXTVERTADJUST_CENTER
);
377 // use a text size factor to get more reliable text sizes from the text layouter
378 // (and from vcl), tipp from HDU
379 static sal_uInt32
nTextSizeFactor(100);
381 // use a factor to get more linear text size calculations
382 aScaledVclFont
.SetHeight( 500 * nTextSizeFactor
);
384 // get basic geometry and get text size
385 drawinglayer::primitive2d::TextLayouterDevice aTextLayouter
;
386 aTextLayouter
.setFont(aScaledVclFont
);
387 const xub_StrLen
nTextLength(aObjectString
.Len());
389 // do not forget to use the factor again to get the width for the 500
390 const double fTextWidth(aTextLayouter
.getTextWidth(aObjectString
, 0, nTextLength
) * (1.0 / nTextSizeFactor
));
391 const double fTextHeight(aTextLayouter
.getTextHeight() * (1.0 / nTextSizeFactor
));
393 // calculate text primitive position. If text is at bottom, use top for
394 // the extra text and vice versa
395 const double fHorDist(125);
396 const double fVerDist(125);
397 const double fPosX((aTranslate
.getX() + aScale
.getX()) - fTextWidth
- fHorDist
);
398 const double fPosY((SDRTEXTVERTADJUST_BOTTOM
== eTVA
)
399 ? aTranslate
.getY() - fVerDist
+ fTextHeight
400 : (aTranslate
.getY() + aScale
.getY()) - fVerDist
);
402 // get font attributes; use normally scaled font
403 const basegfx::BColor
aFontColor(aRGBColor
);
405 basegfx::B2DVector aTextSizeAttribute
;
407 aVclFont
.SetHeight( 500 );
409 const drawinglayer::attribute::FontAttribute
aFontAttribute(
410 drawinglayer::primitive2d::getFontAttributeFromVclFont(
417 const basegfx::B2DHomMatrix
aTextMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
418 aTextSizeAttribute
.getX(), aTextSizeAttribute
.getY(),
423 // create DXTextArray (can be empty one)
424 const ::std::vector
< double > aDXArray
;
426 // create locale; this may need some more information in the future
427 const ::com::sun::star::lang::Locale aLocale
;
429 // create primitive and add
430 const drawinglayer::primitive2d::Primitive2DReference
xRef(
431 new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
440 drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval
, xRef
);
447 if(bDoCreateGeometry
)
449 drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(
451 sdr::contact::ViewObjectContactRedirector::createRedirectedPrimitive2DSequence(
458 // not a SdrObject visualisation (maybe e.g. page) or no page
459 xRetval
= sdr::contact::ViewObjectContactRedirector::createRedirectedPrimitive2DSequence(rOriginal
, rDisplayInfo
);
466 * The event will be forwarded to the View
468 void View::CompleteRedraw(OutputDevice
* pOutDev
, const Region
& rReg
, sdr::contact::ViewObjectContactRedirector
* pRedirector
/*=0L*/)
471 if (mnLockRedrawSmph
== 0)
473 SdrPageView
* pPgView
= GetSdrPageView();
477 SdPage
* pPage
= (SdPage
*) pPgView
->GetPage();
480 SdrOutliner
& rOutl
= mrDoc
.GetDrawOutliner(NULL
);
481 bool bScreenDisplay(true);
483 if(bScreenDisplay
&& pOutDev
&& OUTDEV_PRINTER
== pOutDev
->GetOutDevType())
485 // #i75566# printing; suppress AutoColor BackgroundColor generation
486 // for visibility reasons by giving GetPageBackgroundColor()
488 bScreenDisplay
= false;
491 if(bScreenDisplay
&& pOutDev
&& pOutDev
->GetPDFWriter())
493 // #i75566# PDF export; suppress AutoColor BackgroundColor generation (see above)
494 bScreenDisplay
= false;
497 // #i75566# Name change GetBackgroundColor -> GetPageBackgroundColor and
498 // hint value if screen display. Only then the AutoColor mechanisms shall be applied
499 rOutl
.SetBackgroundColor( pPage
->GetPageBackgroundColor(pPgView
, bScreenDisplay
) );
503 ViewRedirector aViewRedirector
;
504 FmFormView::CompleteRedraw(pOutDev
, rReg
, pRedirector
? pRedirector
: &aViewRedirector
);
509 SdViewRedrawRec
* pRec
= new SdViewRedrawRec
;
510 pRec
->mpOut
= pOutDev
;
511 pRec
->aRect
= rReg
.GetBoundRect();
512 maLockedRedraws
.push_back(pRec
);
517 void View::MarkListHasChanged()
519 FmFormView::MarkListHasChanged();
521 if( GetMarkedObjectCount() > 0 )
522 maSmartTags
.deselect();
526 sal_Bool
View::SetAttributes(const SfxItemSet
& rSet
, sal_Bool bReplaceAll
)
528 sal_Bool bOk
= FmFormView::SetAttributes(rSet
, bReplaceAll
);
533 sal_Bool
View::GetAttributes( SfxItemSet
& rTargetSet
, sal_Bool bOnlyHardAttr
) const
535 return( FmFormView::GetAttributes( rTargetSet
, bOnlyHardAttr
) );
540 * Is a presentation object selected?
542 sal_Bool
View::IsPresObjSelected(sal_Bool bOnPage
, sal_Bool bOnMasterPage
, sal_Bool bCheckPresObjListOnly
, sal_Bool bCheckLayoutOnly
) const
544 SdrMarkList
* pMarkList
;
546 if (mnDragSrcPgNum
!= SDRPAGE_NOTFOUND
&&
547 mnDragSrcPgNum
!= GetSdrPageView()->GetPage()->GetPageNum())
549 /* Drag&Drop is in progress
550 Source and destination page are different:
551 we use the saved mark list */
552 pMarkList
= mpDragSrcMarkList
;
556 // We use the current mark list
557 pMarkList
= new SdrMarkList(GetMarkedObjectList());
564 sal_Bool bSelected
= sal_False
;
565 sal_Bool bMasterPage
= sal_False
;
567 long nMarkMax
= long(pMarkList
->GetMarkCount()) - 1;
569 for (nMark
= nMarkMax
; (nMark
>= 0) && !bSelected
; nMark
--)
571 // Backwards through mark list
572 pMark
= pMarkList
->GetMark(nMark
);
573 pObj
= pMark
->GetMarkedSdrObj();
575 if ( pObj
&& ( bCheckPresObjListOnly
|| pObj
->IsEmptyPresObj() || pObj
->GetUserCall() ) )
577 pPage
= (SdPage
*) pObj
->GetPage();
578 bMasterPage
= pPage
&& pPage
->IsMasterPage();
580 if ( (bMasterPage
&& bOnMasterPage
) || (!bMasterPage
&& bOnPage
) )
582 if ( pPage
&& pPage
->IsPresObj(pObj
) )
584 if( bCheckLayoutOnly
)
586 PresObjKind eKind
= pPage
->GetPresObjKind(pObj
);
588 if((eKind
!= PRESOBJ_FOOTER
) && (eKind
!= PRESOBJ_HEADER
) && (eKind
!= PRESOBJ_DATETIME
) && (eKind
!= PRESOBJ_SLIDENUMBER
) )
589 bSelected
= sal_True
;
593 bSelected
= sal_True
;
600 if (pMarkList
!= mpDragSrcMarkList
)
609 void View::SelectAll()
613 OutlinerView
* pOLV
= GetTextEditOutlinerView();
614 const ::Outliner
* pOutliner
= GetTextEditOutliner();
615 pOLV
->SelectRange( 0, pOutliner
->GetParagraphCount() );
625 void View::ModelHasChanged()
627 // First, notify SdrView
628 FmFormView::ModelHasChanged();
632 sal_Bool
View::SetStyleSheet(SfxStyleSheet
* pStyleSheet
, sal_Bool bDontRemoveHardAttr
)
634 // forward to SdrView
635 return FmFormView::SetStyleSheet(pStyleSheet
, bDontRemoveHardAttr
);
642 static void SetSpellOptions( const SdDrawDocument
& rDoc
, sal_uLong
& rCntrl
)
644 sal_Bool bOnlineSpell
= rDoc
.GetOnlineSpell();
647 rCntrl
|= EE_CNTRL_ONLINESPELLING
;
649 rCntrl
&= ~EE_CNTRL_ONLINESPELLING
;
652 sal_Bool
View::SdrBeginTextEdit(
653 SdrObject
* pObj
, SdrPageView
* pPV
, ::Window
* pWin
,
655 SdrOutliner
* pOutl
, OutlinerView
* pGivenOutlinerView
,
656 sal_Bool bDontDeleteOutliner
, sal_Bool bOnlyOneView
, sal_Bool bGrabFocus
)
658 GetViewShell()->GetViewShellBase().GetEventMultiplexer()->MultiplexEvent(
659 sd::tools::EventMultiplexerEvent::EID_BEGIN_TEXT_EDIT
, (void*)pObj
);
661 if( pOutl
==NULL
&& pObj
)
662 pOutl
= SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT
, pObj
->GetModel() );
664 // make draw&impress specific initialisations
667 pOutl
->SetStyleSheetPool((SfxStyleSheetPool
*) mrDoc
.GetStyleSheetPool());
668 pOutl
->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule
, CalcFieldValueHdl
));
669 sal_uLong nCntrl
= pOutl
->GetControlWord();
670 nCntrl
|= EE_CNTRL_ALLOWBIGOBJS
;
671 nCntrl
|= EE_CNTRL_URLSFXEXECUTE
;
672 nCntrl
|= EE_CNTRL_MARKFIELDS
;
673 nCntrl
|= EE_CNTRL_AUTOCORRECT
;
675 nCntrl
&= ~EE_CNTRL_ULSPACESUMMATION
;
676 if ( mrDoc
.IsSummationOfParagraphs() )
677 nCntrl
|= EE_CNTRL_ULSPACESUMMATION
;
679 SetSpellOptions( mrDoc
, nCntrl
);
681 pOutl
->SetControlWord(nCntrl
);
683 Reference
< linguistic2::XSpellChecker1
> xSpellChecker( LinguMgr::GetSpellChecker() );
684 if ( xSpellChecker
.is() )
685 pOutl
->SetSpeller( xSpellChecker
);
687 Reference
< linguistic2::XHyphenator
> xHyphenator( LinguMgr::GetHyphenator() );
688 if( xHyphenator
.is() )
689 pOutl
->SetHyphenator( xHyphenator
);
691 pOutl
->SetDefaultLanguage( Application::GetSettings().GetLanguageTag().getLanguageType() );
694 sal_Bool bReturn
= FmFormView::SdrBeginTextEdit(
695 pObj
, pPV
, pWin
, bIsNewObj
, pOutl
,
696 pGivenOutlinerView
, bDontDeleteOutliner
,
697 bOnlyOneView
, bGrabFocus
);
701 mpViewSh
->GetViewShellBase().GetDrawController().FireSelectionChangeListener();
706 ::Outliner
* pOL
= GetTextEditOutliner();
708 if( pObj
&& pObj
->GetPage() )
711 if( pObj
->GetObjInventor() == SdrInventor
&& pObj
->GetObjIdentifier() == OBJ_TABLE
)
713 aBackground
= GetTextEditBackgroundColor(*this);
717 aBackground
= pObj
->GetPage()->GetPageBackgroundColor(pPV
);
720 pOL
->SetBackgroundColor( aBackground
);
725 pOL
->SetParaInsertedHdl(LINK(this, View
, OnParagraphInsertedHdl
));
726 pOL
->SetParaRemovingHdl(LINK(this, View
, OnParagraphRemovingHdl
));
733 /** ends current text editing */
734 SdrEndTextEditKind
View::SdrEndTextEdit(sal_Bool bDontDeleteReally
)
736 SdrObjectWeakRef
xObj( GetTextEditObject() );
738 sal_Bool bDefaultTextRestored
= RestoreDefaultText( dynamic_cast< SdrTextObj
* >( GetTextEditObject() ) );
740 SdrEndTextEditKind eKind
= FmFormView::SdrEndTextEdit(bDontDeleteReally
);
742 if( bDefaultTextRestored
)
744 if( xObj
.is() && !xObj
->IsEmptyPresObj() )
746 xObj
->SetEmptyPresObj( sal_True
);
750 eKind
= SDRENDTEXTEDIT_UNCHANGED
;
753 else if( xObj
.is() && xObj
->IsEmptyPresObj() )
755 SdrTextObj
* pObj
= dynamic_cast< SdrTextObj
* >( xObj
.get() );
756 if( pObj
&& pObj
->HasText() )
758 SdrPage
* pPage
= pObj
->GetPage();
759 if( !pPage
|| !pPage
->IsMasterPage() )
760 pObj
->SetEmptyPresObj( sal_False
);
764 GetViewShell()->GetViewShellBase().GetEventMultiplexer()->MultiplexEvent(
765 sd::tools::EventMultiplexerEvent::EID_END_TEXT_EDIT
,
772 mpViewSh
->GetViewShellBase().GetDrawController().FireSelectionChangeListener();
775 SdPage
* pPage
= dynamic_cast< SdPage
* >( xObj
->GetPage() );
777 pPage
->onEndTextEdit( xObj
.get() );
783 // --------------------------------------------------------------------
785 /** restores the default text if the given text object is currently in edit mode and
786 no text has been entered already. Is only useful just before text edit ends. */
787 bool View::RestoreDefaultText( SdrTextObj
* pTextObj
)
789 bool bRestored
= false;
791 if( pTextObj
&& (pTextObj
== GetTextEditObject()) )
793 if( !pTextObj
->HasText() )
795 SdPage
* pPage
= dynamic_cast< SdPage
* >( pTextObj
->GetPage() );
799 bRestored
= pPage
->RestoreDefaultText( pTextObj
);
802 SdrOutliner
* pOutliner
= GetTextEditOutliner();
803 pTextObj
->SetTextEditOutliner( pOutliner
);
804 OutlinerParaObject
* pParaObj
= pTextObj
->GetOutlinerParaObject();
806 pOutliner
->SetText(*pParaObj
);
816 * Sets the original size of the marked objects.
818 void View::SetMarkedOriginalSize()
820 SdrUndoGroup
* pUndoGroup
= new SdrUndoGroup(mrDoc
);
821 sal_uLong nCount
= GetMarkedObjectCount();
822 sal_Bool bOK
= sal_False
;
824 for( sal_uInt32 i
= 0; i
< nCount
; i
++ )
826 SdrObject
* pObj
= GetMarkedObjectByIndex(i
);
828 if( pObj
->GetObjInventor() == SdrInventor
)
830 if( pObj
->GetObjIdentifier() == OBJ_OLE2
)
832 uno::Reference
< embed::XEmbeddedObject
> xObj
= ((SdrOle2Obj
*)pObj
)->GetObjRef();
835 // TODO/LEAN: working with VisualArea can switch object to running state
837 sal_Int64 nAspect
= ((SdrOle2Obj
*)pObj
)->GetAspect();
840 if ( nAspect
== embed::Aspects::MSOLE_ICON
)
842 MapMode
aMap100( MAP_100TH_MM
);
843 aOleSize
= ((SdrOle2Obj
*)pObj
)->GetOrigObjSize( &aMap100
);
848 MapUnit aUnit
= VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj
->getMapUnit( nAspect
) );
851 awt::Size aSz
= xObj
->getVisualAreaSize( nAspect
);
852 aOleSize
= OutputDevice::LogicToLogic( Size( aSz
.Width
, aSz
.Height
), aUnit
, MAP_100TH_MM
);
855 catch( embed::NoVisualAreaSizeException
& )
861 Rectangle
aDrawRect( pObj
->GetLogicRect() );
863 pUndoGroup
->AddAction( mrDoc
.GetSdrUndoFactory().CreateUndoGeoObject( *pObj
) );
864 pObj
->Resize( aDrawRect
.TopLeft(), Fraction( aOleSize
.Width(), aDrawRect
.GetWidth() ),
865 Fraction( aOleSize
.Height(), aDrawRect
.GetHeight() ) );
869 else if( pObj
->GetObjIdentifier() == OBJ_GRAF
)
871 const MapMode
aMap100( MAP_100TH_MM
);
874 if ( static_cast< SdrGrafObj
* >( pObj
)->GetGrafPrefMapMode().GetMapUnit() == MAP_PIXEL
)
875 aSize
= Application::GetDefaultDevice()->PixelToLogic( static_cast< SdrGrafObj
* >( pObj
)->GetGrafPrefSize(), aMap100
);
878 aSize
= OutputDevice::LogicToLogic( static_cast< SdrGrafObj
* >( pObj
)->GetGrafPrefSize(),
879 static_cast< SdrGrafObj
* >( pObj
)->GetGrafPrefMapMode(),
883 pUndoGroup
->AddAction( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj
) );
884 Rectangle
aRect( pObj
->GetLogicRect() );
885 aRect
.SetSize( aSize
);
886 pObj
->SetLogicRect( aRect
);
895 pUndoGroup
->SetComment( String(SdResId(STR_UNDO_ORIGINALSIZE
)) );
896 mpDocSh
->GetUndoManager()->AddUndoAction(pUndoGroup
);
903 * Connect OLE object to client.
905 void View::DoConnect(SdrOle2Obj
* pObj
)
909 uno::Reference
< embed::XEmbeddedObject
> xObj( pObj
->GetObjRef() );
912 ::sd::Window
* pWindow
= mpViewSh
->GetActiveWindow();
913 SfxInPlaceClient
* pSdClient
= mpViewSh
-> GetViewShellBase().FindIPClient( xObj
, pWindow
);
916 pSdClient
= new Client(pObj
, mpViewSh
, pWindow
);
917 Rectangle aRect
= pObj
->GetLogicRect();
919 // TODO/LEAN: working with visual area can switch object to running state
920 Size aDrawSize
= aRect
.GetSize();
923 MapMode
aMapMode( mrDoc
.GetScaleUnit() );
924 Size aObjAreaSize
= pObj
->GetOrigObjSize( &aMapMode
);
926 Fraction
aScaleWidth (aDrawSize
.Width(), aObjAreaSize
.Width() );
927 Fraction
aScaleHeight(aDrawSize
.Height(), aObjAreaSize
.Height() );
928 aScaleWidth
.ReduceInaccurate(10); // compatible to SdrOle2Obj
929 aScaleHeight
.ReduceInaccurate(10);
930 pSdClient
->SetSizeScale(aScaleWidth
, aScaleHeight
);
932 // visible area is only changed in-place!
933 // the object area must be set after the scaling, since it triggers resize
934 aRect
.SetSize(aObjAreaSize
);
935 pSdClient
->SetObjArea(aRect
);
942 sal_Bool
View::IsMorphingAllowed() const
944 const SdrMarkList
& rMarkList
= GetMarkedObjectList();
945 sal_Bool bRet
= sal_False
;
947 if ( rMarkList
.GetMarkCount() == 2 )
949 const SdrObject
* pObj1
= rMarkList
.GetMark( 0 )->GetMarkedSdrObj();
950 const SdrObject
* pObj2
= rMarkList
.GetMark( 1 )->GetMarkedSdrObj();
951 const sal_uInt16 nKind1
= pObj1
->GetObjIdentifier();
952 const sal_uInt16 nKind2
= pObj2
->GetObjIdentifier();
954 if ( ( nKind1
!= OBJ_TEXT
&& nKind2
!= OBJ_TEXT
) &&
955 ( nKind1
!= OBJ_TITLETEXT
&& nKind2
!= OBJ_TITLETEXT
) &&
956 ( nKind1
!= OBJ_OUTLINETEXT
&& nKind2
!= OBJ_OUTLINETEXT
) &&
957 ( nKind1
!= OBJ_GRUP
&& nKind2
!= OBJ_GRUP
) &&
958 ( nKind1
!= OBJ_LINE
&& nKind2
!= OBJ_LINE
) &&
959 ( nKind1
!= OBJ_PLIN
&& nKind2
!= OBJ_PLIN
) &&
960 ( nKind1
!= OBJ_PATHLINE
&& nKind2
!= OBJ_PATHLINE
) &&
961 ( nKind1
!= OBJ_FREELINE
&& nKind2
!= OBJ_FREELINE
) &&
962 ( nKind1
!= OBJ_PATHPLIN
&& nKind2
!= OBJ_PATHPLIN
) &&
963 ( nKind1
!= OBJ_MEASURE
&& nKind2
!= OBJ_MEASURE
) &&
964 ( nKind1
!= OBJ_EDGE
&& nKind2
!= OBJ_EDGE
) &&
965 ( nKind1
!= OBJ_GRAF
&& nKind2
!= OBJ_GRAF
) &&
966 ( nKind1
!= OBJ_OLE2
&& nKind2
!= OBJ_OLE2
) &&
967 ( nKind1
!= OBJ_CAPTION
&& nKind2
!= OBJ_CAPTION
) &&
968 !pObj1
->ISA( E3dObject
) && !pObj2
->ISA( E3dObject
) )
970 SfxItemSet
aSet1( mrDoc
.GetPool(), XATTR_FILLSTYLE
, XATTR_FILLSTYLE
);
971 SfxItemSet
aSet2( mrDoc
.GetPool(), XATTR_FILLSTYLE
, XATTR_FILLSTYLE
);
973 aSet1
.Put(pObj1
->GetMergedItemSet());
974 aSet2
.Put(pObj2
->GetMergedItemSet());
976 const XFillStyle eFillStyle1
= ( (const XFillStyleItem
&) aSet1
.Get( XATTR_FILLSTYLE
) ).GetValue();
977 const XFillStyle eFillStyle2
= ( (const XFillStyleItem
&) aSet2
.Get( XATTR_FILLSTYLE
) ).GetValue();
979 if( ( eFillStyle1
== XFILL_NONE
|| eFillStyle1
== XFILL_SOLID
) &&
980 ( eFillStyle2
== XFILL_NONE
|| eFillStyle2
== XFILL_SOLID
) )
988 sal_Bool
View::IsVectorizeAllowed() const
990 const SdrMarkList
& rMarkList
= GetMarkedObjectList();
991 sal_Bool bRet
= sal_False
;
993 if( rMarkList
.GetMarkCount() == 1 )
995 const SdrGrafObj
* pObj
= dynamic_cast< const SdrGrafObj
* >(rMarkList
.GetMark( 0 )->GetMarkedSdrObj());
999 if(GRAPHIC_BITMAP
== pObj
->GetGraphicType() && !pObj
->isEmbeddedSvg())
1009 void View::onAccessibilityOptionsChanged()
1013 ::sd::Window
* pWindow
= mpViewSh
->GetActiveWindow();
1016 const StyleSettings
& rStyleSettings
= pWindow
->GetSettings().GetStyleSettings();
1018 sal_uInt16 nOutputSlot
, nPreviewSlot
;
1020 SvtAccessibilityOptions
& aAccOptions
= getAccessibilityOptions();
1022 if( mpViewSh
->GetViewFrame() && mpViewSh
->GetViewFrame()->GetDispatcher() )
1024 if( rStyleSettings
.GetHighContrastMode() )
1026 nOutputSlot
= SID_OUTPUT_QUALITY_CONTRAST
;
1030 nOutputSlot
= SID_OUTPUT_QUALITY_COLOR
;
1033 if( rStyleSettings
.GetHighContrastMode() && aAccOptions
.GetIsForPagePreviews() )
1035 nPreviewSlot
= SID_PREVIEW_QUALITY_CONTRAST
;
1039 nPreviewSlot
= SID_PREVIEW_QUALITY_COLOR
;
1042 mpViewSh
->GetViewFrame()->GetDispatcher()->Execute( nOutputSlot
, SFX_CALLMODE_ASYNCHRON
);
1043 mpViewSh
->GetViewFrame()->GetDispatcher()->Execute( nPreviewSlot
, SFX_CALLMODE_ASYNCHRON
);
1046 mpViewSh
->Invalidate();
1051 IMPL_LINK( View
, OnParagraphInsertedHdl
, ::Outliner
*, pOutliner
)
1053 Paragraph
* pPara
= pOutliner
->GetHdlParagraph();
1054 SdrObject
* pObj
= GetTextEditObject();
1058 SdPage
* pPage
= dynamic_cast< SdPage
* >( pObj
->GetPage() );
1060 pPage
->onParagraphInserted( pOutliner
, pPara
, pObj
);
1066 * Handler for the deletion of the pages (paragraphs).
1068 IMPL_LINK( View
, OnParagraphRemovingHdl
, ::Outliner
*, pOutliner
)
1070 Paragraph
* pPara
= pOutliner
->GetHdlParagraph();
1071 SdrObject
* pObj
= GetTextEditObject();
1075 SdPage
* pPage
= dynamic_cast< SdPage
* >( pObj
->GetPage() );
1077 pPage
->onParagraphRemoving( pOutliner
, pPara
, pObj
);
1082 bool View::isRecordingUndo() const
1084 if( mrDoc
.IsUndoEnabled() )
1086 sd::UndoManager
* pUndoManager
= mrDoc
.GetUndoManager();
1087 return pUndoManager
&& pUndoManager
->IsInListAction();
1095 void View::AddCustomHdl()
1097 maSmartTags
.addCustomHandles( aHdl
);
1100 void View::updateHandles()
1105 SdrViewContext
View::GetContext() const
1107 SdrViewContext eContext
= SDRCONTEXT_STANDARD
;
1108 if( maSmartTags
.getContext( eContext
) )
1111 return FmFormView::GetContext();
1114 sal_Bool
View::HasMarkablePoints() const
1116 if( maSmartTags
.HasMarkablePoints() )
1119 return FmFormView::HasMarkablePoints();
1122 sal_uLong
View::GetMarkablePointCount() const
1124 sal_uLong nCount
= FmFormView::GetMarkablePointCount();
1125 nCount
+= maSmartTags
.GetMarkablePointCount();
1129 sal_Bool
View::HasMarkedPoints() const
1131 if( maSmartTags
.HasMarkedPoints() )
1134 return FmFormView::HasMarkedPoints();
1137 sal_uLong
View::GetMarkedPointCount() const
1139 sal_uLong nCount
= FmFormView::GetMarkedPointCount();
1140 nCount
+= maSmartTags
.GetMarkedPointCount();
1144 sal_Bool
View::IsPointMarkable(const SdrHdl
& rHdl
) const
1146 if( maSmartTags
.IsPointMarkable( rHdl
) )
1149 return FmFormView::IsPointMarkable( rHdl
);
1152 sal_Bool
View::MarkPoint(SdrHdl
& rHdl
, sal_Bool bUnmark
)
1154 if( maSmartTags
.MarkPoint( rHdl
, bUnmark
) )
1157 return FmFormView::MarkPoint( rHdl
, bUnmark
);
1160 sal_Bool
View::MarkPoints(const Rectangle
* pRect
, sal_Bool bUnmark
)
1162 if( maSmartTags
.MarkPoints( pRect
, bUnmark
) )
1165 return FmFormView::MarkPoints( pRect
, bUnmark
);
1168 void View::CheckPossibilities()
1170 FmFormView::CheckPossibilities();
1171 maSmartTags
.CheckPossibilities();
1174 void View::OnBeginPasteOrDrop( PasteOrDropInfos
* /*pInfos*/ )
1178 /** this is called after a paste or drop operation, make sure that the newly inserted paragraphs
1179 get the correct style sheet. */
1180 void View::OnEndPasteOrDrop( PasteOrDropInfos
* pInfos
)
1182 SdrTextObj
* pTextObj
= dynamic_cast< SdrTextObj
* >( GetTextEditObject() );
1183 SdrOutliner
* pOutliner
= GetTextEditOutliner();
1184 if( pOutliner
&& pTextObj
&& pTextObj
->GetPage() )
1186 SdPage
* pPage
= static_cast< SdPage
* >( pTextObj
->GetPage() );
1188 SfxStyleSheet
* pStyleSheet
= 0;
1190 const PresObjKind eKind
= pPage
->GetPresObjKind(pTextObj
);
1191 if( eKind
!= PRESOBJ_NONE
)
1192 pStyleSheet
= pPage
->GetStyleSheetForPresObj(eKind
);
1194 pStyleSheet
= pTextObj
->GetStyleSheet();
1196 if( eKind
== PRESOBJ_OUTLINE
)
1198 // for outline shapes, set the correct outline style sheet for each
1199 // new paragraph, depending on the paragraph depth
1200 SfxStyleSheetBasePool
* pStylePool
= GetDoc().GetStyleSheetPool();
1202 for ( sal_Int32 nPara
= pInfos
->nStartPara
; nPara
<= pInfos
->nEndPara
; nPara
++ )
1204 sal_Int16 nDepth
= pOutliner
->GetDepth( nPara
);
1206 SfxStyleSheet
* pStyle
= 0;
1209 String
aStyleSheetName( pStyleSheet
->GetName() );
1210 aStyleSheetName
.Erase( aStyleSheetName
.Len() - 1, 1 );
1211 aStyleSheetName
+= OUString::number( nDepth
);
1212 pStyle
= static_cast<SfxStyleSheet
*>( pStylePool
->Find( aStyleSheetName
, pStyleSheet
->GetFamily() ) );
1213 DBG_ASSERT( pStyle
, "sd::View::OnEndPasteOrDrop(), Style not found!" );
1217 pStyle
= pStyleSheet
;
1219 pOutliner
->SetStyleSheet( nPara
, pStyle
);
1224 // just put the object style on each new paragraph
1225 for ( sal_Int32 nPara
= pInfos
->nStartPara
; nPara
<= pInfos
->nEndPara
; nPara
++ )
1227 pOutliner
->SetStyleSheet( nPara
, pStyleSheet
);
1233 bool View::ShouldToggleOn(
1234 const bool bBulletOnOffMode
,
1235 const bool bNormalBullet
)
1237 // If setting bullets/numbering by the dialog, always should toggle on.
1238 if (!bBulletOnOffMode
)
1240 SdrModel
* pSdrModel
= GetModel();
1244 sal_Bool bToggleOn
= sal_False
;
1245 SdrOutliner
* pOutliner
= SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT
, pSdrModel
);
1246 sal_uInt32 nMarkCount
= GetMarkedObjectCount();
1247 for (sal_uInt32 nIndex
= 0; nIndex
< nMarkCount
&& !bToggleOn
; nIndex
++)
1249 SdrTextObj
* pTextObj
= dynamic_cast< SdrTextObj
* >(GetMarkedObjectByIndex(nIndex
));
1250 if (!pTextObj
|| pTextObj
->IsTextEditActive())
1252 if (pTextObj
->ISA(SdrTableObj
))
1254 SdrTableObj
* pTableObj
= dynamic_cast< SdrTableObj
* >(pTextObj
);
1257 CellPos aStart
, aEnd
;
1258 SvxTableController
* pTableController
= dynamic_cast< SvxTableController
* >(getSelectionController().get());
1259 if (pTableController
)
1261 pTableController
->getSelectedCells(aStart
, aEnd
);
1265 aStart
= pTableObj
->getFirstCell();
1266 aEnd
= pTableObj
->getLastCell();
1268 sal_Int32 nColCount
= pTableObj
->getColumnCount();
1269 for (sal_Int32 nRow
= aStart
.mnRow
; nRow
<= aEnd
.mnRow
&& !bToggleOn
; nRow
++)
1271 for (sal_Int32 nCol
= aStart
.mnCol
; nCol
<= aEnd
.mnCol
&& !bToggleOn
; nCol
++)
1273 sal_Int32 nCellIndex
= nRow
* nColCount
+ nCol
;
1274 SdrText
* pText
= pTableObj
->getText(nCellIndex
);
1275 if (!pText
|| !pText
->GetOutlinerParaObject())
1277 pOutliner
->SetText(*(pText
->GetOutlinerParaObject()));
1278 sal_Int16 nStatus
= pOutliner
->GetBulletsNumberingStatus();
1279 bToggleOn
= ((bNormalBullet
&& nStatus
!= 0) || (!bNormalBullet
&& nStatus
!= 1)) ? sal_True
: bToggleOn
;
1286 OutlinerParaObject
* pParaObj
= pTextObj
->GetOutlinerParaObject();
1289 pOutliner
->SetText(*pParaObj
);
1290 sal_Int16 nStatus
= pOutliner
->GetBulletsNumberingStatus();
1291 bToggleOn
= ((bNormalBullet
&& nStatus
!= 0) || (!bNormalBullet
&& nStatus
!= 1)) ? sal_True
: bToggleOn
;
1299 void View::ChangeMarkedObjectsBulletsNumbering(
1301 const bool bHandleBullets
,
1302 const SvxNumRule
* pNumRule
,
1303 const bool bSwitchOff
)
1305 SdrModel
* pSdrModel
= GetModel();
1306 Window
* pWindow
= dynamic_cast< Window
* >(GetFirstOutputDevice());
1307 if (!pSdrModel
|| !pWindow
)
1310 const bool bUndoEnabled
= pSdrModel
->IsUndoEnabled();
1311 SdrUndoGroup
* pUndoGroup
= bUndoEnabled
? new SdrUndoGroup(*pSdrModel
) : 0;
1313 const bool bToggleOn
=
1316 : ShouldToggleOn( bToggle
, bHandleBullets
);
1318 SdrOutliner
* pOutliner
= SdrMakeOutliner(OUTLINERMODE_TEXTOBJECT
, pSdrModel
);
1319 OutlinerView
* pOutlinerView
= new OutlinerView(pOutliner
, pWindow
);
1321 const sal_uInt32 nMarkCount
= GetMarkedObjectCount();
1322 for (sal_uInt32 nIndex
= 0; nIndex
< nMarkCount
; nIndex
++)
1324 SdrTextObj
* pTextObj
= dynamic_cast< SdrTextObj
* >(GetMarkedObjectByIndex(nIndex
));
1325 if (!pTextObj
|| pTextObj
->IsTextEditActive())
1327 if (pTextObj
->ISA(SdrTableObj
))
1329 SdrTableObj
* pTableObj
= dynamic_cast< SdrTableObj
* >(pTextObj
);
1332 CellPos aStart
, aEnd
;
1333 SvxTableController
* pTableController
= dynamic_cast< SvxTableController
* >(getSelectionController().get());
1334 if (pTableController
)
1336 pTableController
->getSelectedCells(aStart
, aEnd
);
1340 aStart
= pTableObj
->getFirstCell();
1341 aEnd
= pTableObj
->getLastCell();
1343 sal_Int32 nColCount
= pTableObj
->getColumnCount();
1344 for (sal_Int32 nRow
= aStart
.mnRow
; nRow
<= aEnd
.mnRow
; nRow
++)
1346 for (sal_Int32 nCol
= aStart
.mnCol
; nCol
<= aEnd
.mnCol
; nCol
++)
1348 sal_Int32 nCellIndex
= nRow
* nColCount
+ nCol
;
1349 SdrText
* pText
= pTableObj
->getText(nCellIndex
);
1350 if (!pText
|| !pText
->GetOutlinerParaObject())
1353 pOutliner
->SetText(*(pText
->GetOutlinerParaObject()));
1356 SdrUndoObjSetText
* pTxtUndo
= dynamic_cast< SdrUndoObjSetText
* >(pSdrModel
->GetSdrUndoFactory().CreateUndoObjectSetText(*pTextObj
, nCellIndex
));
1357 pUndoGroup
->AddAction(pTxtUndo
);
1361 pOutlinerView
->SwitchOffBulletsNumbering();
1365 pOutlinerView
->ApplyBulletsNumbering( bHandleBullets
, pNumRule
, bToggle
);
1367 sal_uInt32 nParaCount
= pOutliner
->GetParagraphCount();
1368 pText
->SetOutlinerParaObject(pOutliner
->CreateParaObject(0, (sal_uInt16
)nParaCount
));
1372 // Broadcast the object change event.
1373 if (!pTextObj
->AdjustTextFrameWidthAndHeight())
1375 pTextObj
->SetChanged();
1376 pTextObj
->BroadcastObjectChange();
1381 OutlinerParaObject
* pParaObj
= pTextObj
->GetOutlinerParaObject();
1384 pOutliner
->SetText(*pParaObj
);
1387 SdrUndoObjSetText
* pTxtUndo
= dynamic_cast< SdrUndoObjSetText
* >(pSdrModel
->GetSdrUndoFactory().CreateUndoObjectSetText(*pTextObj
, 0));
1388 pUndoGroup
->AddAction(pTxtUndo
);
1392 pOutlinerView
->SwitchOffBulletsNumbering();
1396 pOutlinerView
->ApplyBulletsNumbering( bHandleBullets
, pNumRule
, bToggle
);
1398 sal_uInt32 nParaCount
= pOutliner
->GetParagraphCount();
1399 pTextObj
->SetOutlinerParaObject(pOutliner
->CreateParaObject(0, (sal_uInt16
)nParaCount
));
1404 if ( bUndoEnabled
&& pUndoGroup
->GetActionCount() > 0 )
1406 pSdrModel
->BegUndo();
1407 pSdrModel
->AddUndo(pUndoGroup
);
1408 pSdrModel
->EndUndo();
1412 delete pOutlinerView
;
1415 } // end of namespace sd
1417 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */