Files
libreoffice/sd/source/ui/view/sdview.cxx

1328 lines
44 KiB
C++
Raw Normal View History

2000-09-18 16:07:07 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 16:07:07 +00:00
*
* Copyright 2008 by Sun Microsystems, Inc.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 16:07:07 +00:00
*
* $RCSfile: sdview.cxx,v $
* $Revision: 1.65 $
2000-09-18 16:07:07 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2000-09-18 16:07:07 +00:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2000-09-18 16:07:07 +00:00
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sd.hxx"
#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
#include "View.hxx"
#include <svx/unolingu.hxx>
2002-04-24 06:17:33 +00:00
#include <sfx2/request.hxx>
2000-09-18 16:07:07 +00:00
#include <svx/obj3d.hxx>
#include <svx/fmview.hxx>
#include <svx/outliner.hxx>
#ifndef _SVX_SVXIDS_HRC
#include <svx/svxids.hrc>
#endif
#include <svx/svdograf.hxx>
#include <svx/svdoole2.hxx>
#include <svx/svdundo.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/app.hxx>
#include <svx/svdpagv.hxx>
#include <sfx2/docfile.hxx>
#include <svx/svdoutl.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
2000-09-18 16:07:07 +00:00
#include <svx/svdetc.hxx>
#include <svx/editstat.hxx>
2002-04-24 06:17:33 +00:00
#include <svx/dialogs.hrc>
#include <sfx2/viewfrm.hxx>
#include <svx/xoutx.hxx>
#include <svx/svdopage.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <svx/xlndsit.hxx>
#include <svx/xlineit0.hxx>
#include <svx/xlnclit.hxx>
#include <vcl/virdev.hxx>
2000-09-18 16:07:07 +00:00
#include "app.hrc"
2001-03-08 10:28:38 +00:00
#include "strings.hrc"
#include "Window.hxx"
#include "Client.hxx"
2000-09-18 16:07:07 +00:00
#include "drawdoc.hxx"
#include "DrawDocShell.hxx"
2000-09-18 16:07:07 +00:00
#include "app.hxx"
#include "sdpage.hxx"
#include "glob.hrc"
#include "sdresid.hxx"
#include "DrawViewShell.hxx"
2000-09-18 16:07:07 +00:00
#include "futext.hxx"
#include "fuinsfil.hxx"
#include "slideshow.hxx"
2000-09-18 16:07:07 +00:00
#include "stlpool.hxx"
#include "FrameView.hxx"
#include "ViewClipboard.hxx"
#include "undo/undomanager.hxx"
#include <svx/sdr/contact/viewobjectcontact.hxx>
#include <svx/sdr/contact/viewcontact.hxx>
#include <svx/sdr/contact/displayinfo.hxx>
#include "EventMultiplexer.hxx"
#include "ViewShellBase.hxx"
#include "ViewShellManager.hxx"
using namespace com::sun::star;
using namespace com::sun::star::uno;
namespace sd {
2000-09-18 16:07:07 +00:00
#ifndef SO2_DECL_SVINPLACEOBJECT_DEFINED
#define SO2_DECL_SVINPLACEOBJECT_DEFINED
SO2_DECL_REF(SvInPlaceObject)
#endif
TYPEINIT1(View, FmFormView);
2000-09-18 16:07:07 +00:00
/*************************************************************************
|*
|* Ctor
|*
\************************************************************************/
View::View(SdDrawDocument* pDrawDoc, OutputDevice* pOutDev,
ViewShell* pViewShell)
2000-09-18 16:07:07 +00:00
: FmFormView(pDrawDoc, pOutDev),
mpDoc(pDrawDoc),
mpDocSh( pDrawDoc->GetDocSh() ),
mpViewSh(pViewShell),
mpDragSrcMarkList(NULL),
mpDropMarkerObj(NULL),
mpDropMarker(NULL),
mnDragSrcPgNum(SDRPAGE_NOTFOUND),
mnAction(DND_ACTION_NONE),
mnLockRedrawSmph(0),
mpLockedRedraws(NULL),
mbIsDropAllowed(TRUE),
maSmartTags(*this),
mpClipboard (new ViewClipboard (*this))
2000-09-18 16:07:07 +00:00
{
// #i73602# Use default from the configuration
SetBufferedOverlayAllowed(getOptionsDrawinglayer().IsOverlayBuffer_DrawImpress());
// #i74769#, #i75172# Use default from the configuration
SetBufferedOutputAllowed(getOptionsDrawinglayer().IsPaintBuffer_DrawImpress());
2000-09-18 16:07:07 +00:00
EnableExtendedKeyInputDispatcher(FALSE);
EnableExtendedMouseEventDispatcher(FALSE);
EnableExtendedCommandEventDispatcher(FALSE);
SetUseIncompatiblePathCreateInterface(FALSE);
SetMarkHdlWhenTextEdit(TRUE);
EnableTextEditOnObjectsWithoutTextIfTextTool(TRUE);
SetMinMoveDistancePixel(2);
SetHitTolerancePixel(2);
SetMeasureLayer(String(SdResId(STR_LAYER_MEASURELINES)));
// Timer fuer verzoegertes Drop (muss fuer MAC sein)
maDropErrorTimer.SetTimeoutHdl( LINK(this, View, DropErrorHdl) );
maDropErrorTimer.SetTimeout(50);
maDropInsertFileTimer.SetTimeoutHdl( LINK(this, View, DropInsertFileHdl) );
maDropInsertFileTimer.SetTimeout(50);
2000-09-18 16:07:07 +00:00
}
void View::ImplClearDrawDropMarker()
{
if(mpDropMarker)
{
delete mpDropMarker;
mpDropMarker = 0L;
}
}
2000-09-18 16:07:07 +00:00
/*************************************************************************
|*
|* Dtor
|*
\************************************************************************/
View::~View()
2000-09-18 16:07:07 +00:00
{
maSmartTags.Dispose();
// release content of selection clipboard, if we own the content
UpdateSelectionClipboard( TRUE );
maDropErrorTimer.Stop();
maDropInsertFileTimer.Stop();
2000-09-18 16:07:07 +00:00
ImplClearDrawDropMarker();
2000-09-18 16:07:07 +00:00
while(PaintWindowCount())
2000-09-18 16:07:07 +00:00
{
// Alle angemeldeten OutDevs entfernen
DeleteWindowFromPaintView(GetFirstOutputDevice() /*GetWin(0)*/);
2000-09-18 16:07:07 +00:00
}
// gespeicherte Redraws loeschen
if (mpLockedRedraws)
2000-09-18 16:07:07 +00:00
{
SdViewRedrawRec* pRec = (SdViewRedrawRec*)mpLockedRedraws->First();
2000-09-18 16:07:07 +00:00
while (pRec)
{
delete pRec;
pRec = (SdViewRedrawRec*)mpLockedRedraws->Next();
2000-09-18 16:07:07 +00:00
}
delete mpLockedRedraws;
2000-09-18 16:07:07 +00:00
}
}
class ViewRedirector : public ::sdr::contact::ViewObjectContactRedirector
{
public:
ViewRedirector();
virtual ~ViewRedirector();
// all default implementations just call the same methods at the original. To do something
// different, overload the method and at least do what the method does.
virtual void PaintObject(::sdr::contact::ViewObjectContact& rOriginal, ::sdr::contact::DisplayInfo& rDisplayInfo);
};
ViewRedirector::ViewRedirector()
{
}
ViewRedirector::~ViewRedirector()
{
}
// all default implementations just call the same methods at the original. To do something
// different, overload the method and at least do what the method does.
void ViewRedirector::PaintObject(::sdr::contact::ViewObjectContact& rOriginal, ::sdr::contact::DisplayInfo& rDisplayInfo)
{
bool bDoPaintObject = true;
SdrObject* pObject = rOriginal.GetViewContact().TryToGetSdrObject();
if(pObject && pObject->GetPage() )
{
OutputDevice* pOutDev = rDisplayInfo.GetOutputDevice();
bDoPaintObject = pObject->GetPage()->checkVisibility( rOriginal, rDisplayInfo, true );
if(!bDoPaintObject && !(( pObject->GetObjInventor() == SdrInventor ) && ( pObject->GetObjIdentifier() == OBJ_PAGE )) )
return;
bool bPaintOutline = false;
PresObjKind eKind = PRESOBJ_NONE;
const bool bMasterObj(rDisplayInfo.GetMasterPagePainting());
const bool bIsPrinting(rDisplayInfo.OutputToPrinter());
// check if we need to draw a placeholder border
if(rDisplayInfo.GetProcessedPage() == rDisplayInfo.GetPageView()->GetPage())
{
// we never draw for objects inside SdrPageObj
if( pObject->IsEmptyPresObj() && pObject->ISA(SdrTextObj) )
{
if( !bMasterObj || !pObject->IsNotVisibleAsMaster() )
{
SdPage* pPage = (SdPage*)pObject->GetPage();
eKind = pPage ? pPage->GetPresObjKind(pObject) : PRESOBJ_NONE;
if( eKind != PRESOBJ_BACKGROUND )
bPaintOutline = true;
}
}
else if( ( pObject->GetObjInventor() == SdrInventor ) && ( pObject->GetObjIdentifier() == OBJ_TEXT ) )
{
SdPage* pPage = (SdPage*)pObject->GetPage();
if( pPage )
{
eKind = pPage->GetPresObjKind(pObject);
if((eKind == PRESOBJ_FOOTER) || (eKind == PRESOBJ_HEADER) || (eKind == PRESOBJ_DATETIME) || (eKind == PRESOBJ_SLIDENUMBER) )
{
if( !bMasterObj )
{
// only draw a boundary for header&footer objects on the masterpage itself
bPaintOutline = true;
}
}
}
}
else if( ( pObject->GetObjInventor() == SdrInventor ) && ( pObject->GetObjIdentifier() == OBJ_PAGE ) )
{
if( !bIsPrinting )
bPaintOutline = true;
}
if( bPaintOutline && !bIsPrinting )
{
// SdrTextObj* pTextObj = (SdrTextObj*)pObject;
// leere Praesentationsobjekte bekommen einen grauen Rahmen
svtools::ColorConfig aColorConfig;
svtools::ColorConfigValue aColor( aColorConfig.GetColorValue( svtools::OBJECTBOUNDARIES ) );
if( aColor.bIsVisible )
{
pOutDev->Push();
pOutDev->SetFillColor();
pOutDev->SetLineColor( aColor.nColor );
{
XDash aDash( XDASH_RECT, 1, 80, 1, 80, 80);
SfxItemSet aSet( pObject->GetModel()->GetItemPool() );
String aEmpty;
aSet.Put( XLineDashItem( aEmpty, aDash ) );
aSet.Put( XLineStyleItem( XLINE_DASH ) );
aSet.Put( XLineColorItem(aEmpty,Color(aColor.nColor)) );
aSet.Put( XFillStyleItem( XFILL_NONE ) );
rDisplayInfo.GetExtendedOutputDevice()->SetLineAttr(aSet);
rDisplayInfo.GetExtendedOutputDevice()->SetFillAttr(aSet);
}
pOutDev->Pop();
Rectangle aRect;
GeoStat aGeo;
SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( pObject );
if( pTextObj )
{
aGeo = pTextObj->GetGeoStat();
aRect = pTextObj->GetGeoRect();
}
else
{
aRect = pObject->GetCurrentBoundRect();
}
if( aGeo.nDrehWink!=0 || aGeo.nShearWink!=0 )
{
Polygon aPoly(aRect);
if(aGeo.nShearWink!=0)
ShearPoly(aPoly,aRect.TopLeft(),aGeo.nTan);
if(aGeo.nDrehWink!=0)
RotatePoly(aPoly,aRect.TopLeft(),aGeo.nSin,aGeo.nCos);
rDisplayInfo.GetExtendedOutputDevice()->DrawPolyLine(aPoly);
}
else
{
rDisplayInfo.GetExtendedOutputDevice()->DrawRect(aRect);
// now paint the placeholder description, but only on the masterpage
if( !bMasterObj && (pObject->GetPage()->IsMasterPage()) )
{
String aOut;
switch( eKind )
{
case PRESOBJ_TITLE:
{
static String aTitleAreaStr( SdResId( STR_PLACEHOLDER_DESCRIPTION_TITLE ) );
if( ((SdPage*)pObject->GetPage())->GetPageKind() == PK_STANDARD)
aOut = aTitleAreaStr;
break;
}
case PRESOBJ_OUTLINE:
{
static String aOutlineAreaStr( SdResId( STR_PLACEHOLDER_DESCRIPTION_OUTLINE ) );
aOut = aOutlineAreaStr;
break;
}
case PRESOBJ_FOOTER:
{
static String aFooterAreaStr( SdResId( STR_PLACEHOLDER_DESCRIPTION_FOOTER ) );
aOut = aFooterAreaStr;
break;
}
case PRESOBJ_HEADER:
{
static String aHeaderAreaStr( SdResId( STR_PLACEHOLDER_DESCRIPTION_HEADER ) );
aOut = aHeaderAreaStr;
break;
}
case PRESOBJ_DATETIME:
{
static String aDateTimeStr( SdResId( STR_PLACEHOLDER_DESCRIPTION_DATETIME ) );
aOut = aDateTimeStr;
break;
}
case PRESOBJ_NOTES:
{
static String aDateTimeStr( SdResId( STR_PLACEHOLDER_DESCRIPTION_NOTES ) );
aOut = aDateTimeStr;
break;
}
case PRESOBJ_SLIDENUMBER:
{
static String aNumberAreaStr( SdResId( STR_PLACEHOLDER_DESCRIPTION_NUMBER ) );
static String aSlideAreaStr( SdResId( STR_PLACEHOLDER_DESCRIPTION_SLIDE ) );
if( ((SdPage*)pObject->GetPage())->GetPageKind() == PK_STANDARD)
aOut = aSlideAreaStr;
else
aOut = aNumberAreaStr;
break;
}
default:
break;
}
if( aOut.Len() )
{
SdrTextVertAdjust eTVA = (SdrTextVertAdjust)((const SdrTextVertAdjustItem&)pObject->GetMergedItem(SDRATTR_TEXT_VERTADJUST)).GetValue();
pOutDev->Push();
Font aFont;
aFont.SetHeight( 500 );
aFont.SetAlign( (eTVA == SDRTEXTVERTADJUST_BOTTOM) ? ALIGN_TOP : ALIGN_BOTTOM );
pOutDev->SetFont( aFont );
pOutDev->SetTextColor( Color(aColor.nColor) );
pOutDev->SetBackground();
Point aPos;
if(eTVA == SDRTEXTVERTADJUST_BOTTOM)
aPos = aRect.TopRight();
else
aPos = aRect.BottomRight();
aPos.X() -= pOutDev->GetTextWidth( aOut );
pOutDev->DrawText( aPos, aOut );
pOutDev->Pop();
}
}
}
}
}
}
}
// draw object in any case
if( bDoPaintObject )
rOriginal.PaintObject(rDisplayInfo);
}
2000-09-18 16:07:07 +00:00
/*************************************************************************
|*
|* Paint-Methode: das Ereignis wird an die View weitergeleitet
|*
\************************************************************************/
void View::CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, USHORT nPaintMode, ::sdr::contact::ViewObjectContactRedirector* pRedirector /*=0L*/)
2000-09-18 16:07:07 +00:00
{
// ausfuehren ??
if (mnLockRedrawSmph == 0)
2000-09-18 16:07:07 +00:00
{
SdrPageView* pPgView = GetSdrPageView();
if (pPgView)
{
SdPage* pPage = (SdPage*) pPgView->GetPage();
if( pPage )
{
SdrOutliner& rOutl=mpDoc->GetDrawOutliner(NULL);
bool bScreenDisplay(true);
if(bScreenDisplay && pOutDev && OUTDEV_PRINTER == pOutDev->GetOutDevType())
{
// #i75566# printing; suppress AutoColor BackgroundColor generation
// for visibility reasons by giving GetPageBackgroundColor()
// the needed hint
bScreenDisplay = false;
}
if(bScreenDisplay && pOutDev && pOutDev->GetPDFWriter())
{
// #i75566# PDF export; suppress AutoColor BackgroundColor generation (see above)
bScreenDisplay = false;
}
// #i75566# Name change GetBackgroundColor -> GetPageBackgroundColor and
// hint value if screen display. Only then the AutoColor mechanisms shall be applied
rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor(pPgView, bScreenDisplay) );
}
}
ViewRedirector aViewRedirector;
FmFormView::CompleteRedraw(pOutDev, rReg, nPaintMode, pRedirector ? pRedirector : &aViewRedirector);
2000-09-18 16:07:07 +00:00
}
// oder speichern?
else
{
if (!mpLockedRedraws)
mpLockedRedraws = new List;
2000-09-18 16:07:07 +00:00
SdViewRedrawRec* pRec = new SdViewRedrawRec;
pRec->mpOut = pOutDev;
2000-09-18 16:07:07 +00:00
pRec->aRect = rReg.GetBoundRect();
mpLockedRedraws->Insert(pRec, LIST_APPEND);
2000-09-18 16:07:07 +00:00
}
}
2000-09-18 16:07:07 +00:00
/*************************************************************************
|*
|* Selektion hat sich geaendert
|*
\************************************************************************/
void View::MarkListHasChanged()
2000-09-18 16:07:07 +00:00
{
FmFormView::MarkListHasChanged();
if( GetMarkedObjectCount() > 0 )
maSmartTags.deselect();
2000-09-18 16:07:07 +00:00
}
/*************************************************************************
|*
|* Attribute setzen
|*
\************************************************************************/
BOOL View::SetAttributes(const SfxItemSet& rSet, BOOL bReplaceAll)
2000-09-18 16:07:07 +00:00
{
BOOL bOk = FmFormView::SetAttributes(rSet, bReplaceAll);
return (bOk);
}
/*************************************************************************
|*
|* Attribute holen
|*
\************************************************************************/
BOOL View::GetAttributes( SfxItemSet& rTargetSet, BOOL bOnlyHardAttr ) const
2000-09-18 16:07:07 +00:00
{
return( FmFormView::GetAttributes( rTargetSet, bOnlyHardAttr ) );
}
/*************************************************************************
|*
|* Ist ein Praesentationsobjekt selektiert?
|*
\************************************************************************/
BOOL View::IsPresObjSelected(BOOL bOnPage, BOOL bOnMasterPage, BOOL bCheckPresObjListOnly, BOOL bCheckLayoutOnly) const
2000-09-18 16:07:07 +00:00
{
/**************************************************************************
* Ist ein Presentationsobjekt selektiert?
**************************************************************************/
SdrMarkList* pMarkList;
if (mnDragSrcPgNum != SDRPAGE_NOTFOUND &&
mnDragSrcPgNum != GetSdrPageView()->GetPage()->GetPageNum())
2000-09-18 16:07:07 +00:00
{
// Es laeuft gerade Drag&Drop
// Source- und Destination-Page unterschiedlich:
// es wird die gemerkte MarkList verwendet
pMarkList = mpDragSrcMarkList;
2000-09-18 16:07:07 +00:00
}
else
{
// Es wird die aktuelle MarkList verwendet
pMarkList = new SdrMarkList(GetMarkedObjectList());
2000-09-18 16:07:07 +00:00
}
SdrMark* pMark;
SdPage* pPage;
SdrObject* pObj;
BOOL bSelected = FALSE;
BOOL bMasterPage = FALSE;
long nMark;
long nMarkMax = long(pMarkList->GetMarkCount()) - 1;
2000-09-18 16:07:07 +00:00
for (nMark = nMarkMax; (nMark >= 0) && !bSelected; nMark--)
2000-09-18 16:07:07 +00:00
{
// Rueckwaerts durch die Marklist
pMark = pMarkList->GetMark(nMark);
pObj = pMark->GetMarkedSdrObj();
2000-09-18 16:07:07 +00:00
if ( pObj && ( bCheckPresObjListOnly || pObj->IsEmptyPresObj() || pObj->GetUserCall() ) )
2000-09-18 16:07:07 +00:00
{
pPage = (SdPage*) pObj->GetPage();
bMasterPage = pPage->IsMasterPage();
if (bMasterPage && bOnMasterPage || !bMasterPage && bOnPage)
{
if ( pPage && pPage->IsPresObj(pObj) )
2000-09-18 16:07:07 +00:00
{
if( bCheckLayoutOnly )
{
PresObjKind eKind = pPage->GetPresObjKind(pObj);
if((eKind != PRESOBJ_FOOTER) && (eKind != PRESOBJ_HEADER) && (eKind != PRESOBJ_DATETIME) && (eKind != PRESOBJ_SLIDENUMBER) )
bSelected = TRUE;
}
else
{
bSelected = TRUE;
}
2000-09-18 16:07:07 +00:00
}
}
}
}
if (pMarkList != mpDragSrcMarkList)
2000-09-18 16:07:07 +00:00
{
delete pMarkList;
}
return (bSelected);
}
/*************************************************************************
|*
|* Alles selektieren
|*
\************************************************************************/
void View::SelectAll()
2000-09-18 16:07:07 +00:00
{
if ( IsTextEdit() )
{
OutlinerView* pOLV = GetTextEditOutlinerView();
const ::Outliner* pOutliner = GetTextEditOutliner();
2001-03-08 10:28:38 +00:00
pOLV->SelectRange( 0, (USHORT) pOutliner->GetParagraphCount() );
2000-09-18 16:07:07 +00:00
}
else
{
MarkAll();
}
}
/*************************************************************************
|*
|* Dokument hat sich geaendert
|*
\************************************************************************/
void View::ModelHasChanged()
2000-09-18 16:07:07 +00:00
{
// Erst SdrView benachrichtigen
FmFormView::ModelHasChanged();
}
/*************************************************************************
|*
|* StyleSheet setzen
|*
\************************************************************************/
BOOL View::SetStyleSheet(SfxStyleSheet* pStyleSheet, BOOL bDontRemoveHardAttr)
2000-09-18 16:07:07 +00:00
{
// weiter an SdrView
return FmFormView::SetStyleSheet(pStyleSheet, bDontRemoveHardAttr);
}
/*************************************************************************
|*
|* Texteingabe beginnen
|*
\************************************************************************/
static void SetSpellOptions( SdDrawDocument* pDoc, ULONG& rCntrl )
{
BOOL bHideSpell = pDoc->GetHideSpell();
BOOL bOnlineSpell = pDoc->GetOnlineSpell();
if( bHideSpell )
rCntrl |= EE_CNTRL_NOREDLINES;
else
rCntrl &= ~EE_CNTRL_NOREDLINES;
if( bOnlineSpell )
rCntrl |= EE_CNTRL_ONLINESPELLING;
else
rCntrl &= ~EE_CNTRL_ONLINESPELLING;
}
sal_Bool View::SdrBeginTextEdit(
SdrObject* pObj, SdrPageView* pPV, ::Window* pWin,
sal_Bool bIsNewObj,
SdrOutliner* pOutl, OutlinerView* pGivenOutlinerView,
sal_Bool bDontDeleteOutliner, sal_Bool bOnlyOneView, sal_Bool bGrabFocus )
2000-09-18 16:07:07 +00:00
{
GetViewShell()->GetViewShellBase().GetEventMultiplexer()->MultiplexEvent(
sd::tools::EventMultiplexerEvent::EID_BEGIN_TEXT_EDIT, (void*)pObj );
if( pOutl==NULL && pObj )
pOutl = SdrMakeOutliner( OUTLINERMODE_TEXTOBJECT, pObj->GetModel() );
// make draw&impress specific initialisations
if( pOutl )
{
pOutl->SetStyleSheetPool((SfxStyleSheetPool*) mpDoc->GetStyleSheetPool());
pOutl->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl));
ULONG nCntrl = pOutl->GetControlWord();
nCntrl |= EE_CNTRL_ALLOWBIGOBJS;
nCntrl |= EE_CNTRL_URLSFXEXECUTE;
nCntrl |= EE_CNTRL_MARKFIELDS;
nCntrl |= EE_CNTRL_AUTOCORRECT;
nCntrl &= ~EE_CNTRL_ULSPACESUMMATION;
if ( mpDoc->IsSummationOfParagraphs() )
nCntrl |= EE_CNTRL_ULSPACESUMMATION;
SetSpellOptions( mpDoc, nCntrl );
pOutl->SetControlWord(nCntrl);
Reference< linguistic2::XSpellChecker1 > xSpellChecker( LinguMgr::GetSpellChecker() );
if ( xSpellChecker.is() )
pOutl->SetSpeller( xSpellChecker );
Reference< linguistic2::XHyphenator > xHyphenator( LinguMgr::GetHyphenator() );
if( xHyphenator.is() )
pOutl->SetHyphenator( xHyphenator );
pOutl->SetDefaultLanguage( Application::GetSettings().GetLanguage() );
}
sal_Bool bReturn = FmFormView::SdrBeginTextEdit(
pObj, pPV, pWin, bIsNewObj, pOutl,
pGivenOutlinerView, bDontDeleteOutliner,
bOnlyOneView, bGrabFocus);
2000-09-18 16:07:07 +00:00
if (bReturn)
{
::Outliner* pOL = GetTextEditOutliner();
if( pObj && pObj->GetPage() )
{
Color aBackground;
if( pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_TABLE )
{
aBackground = ImpGetTextEditBackgroundColor();
}
else
{
aBackground = pObj->GetPage()->GetPageBackgroundColor(pPV);
}
pOL->SetBackgroundColor( aBackground );
}
pOL->SetParaInsertedHdl(LINK(this, View, OnParagraphInsertedHdl));
pOL->SetParaRemovingHdl(LINK(this, View, OnParagraphRemovingHdl));
2000-09-18 16:07:07 +00:00
}
return(bReturn);
}
/** ends current text editing */
SdrEndTextEditKind View::SdrEndTextEdit(BOOL bDontDeleteReally )
2000-09-18 16:07:07 +00:00
{
SdrObjectWeakRef xObj( GetTextEditObject() );
BOOL bDefaultTextRestored = RestoreDefaultText( dynamic_cast< SdrTextObj* >( GetTextEditObject() ) );
2000-09-18 16:07:07 +00:00
SdrEndTextEditKind eKind = FmFormView::SdrEndTextEdit(bDontDeleteReally);
2000-09-18 16:07:07 +00:00
if( bDefaultTextRestored )
2000-09-18 16:07:07 +00:00
{
if( xObj.is() && !xObj->IsEmptyPresObj() )
2000-09-18 16:07:07 +00:00
{
xObj->SetEmptyPresObj( TRUE );
}
else
{
eKind = SDRENDTEXTEDIT_UNCHANGED;
}
}
else if( xObj.is() && xObj->IsEmptyPresObj() )
{
SdrTextObj* pObj = dynamic_cast< SdrTextObj* >( xObj.get() );
if( pObj && pObj->HasText() )
{
SdrPage* pPage = pObj->GetPage();
if( !pPage || !pPage->IsMasterPage() )
pObj->SetEmptyPresObj( FALSE );
}
}
2001-03-26 13:37:56 +00:00
GetViewShell()->GetViewShellBase().GetEventMultiplexer()->MultiplexEvent(sd::tools::EventMultiplexerEvent::EID_END_TEXT_EDIT, (void*)xObj.get() );
if( xObj.is() )
{
SdPage* pPage = dynamic_cast< SdPage* >( xObj->GetPage() );
if( pPage )
pPage->onEndTextEdit( xObj.get() );
}
return(eKind);
}
// --------------------------------------------------------------------
2000-09-18 16:07:07 +00:00
/** restores the default text if the given text object is currently in edit mode and
no text has been entered already. Is only usefull just before text edit ends. */
bool View::RestoreDefaultText( SdrTextObj* pTextObj )
{
bool bRestored = false;
if( pTextObj && (pTextObj == GetTextEditObject()) )
{
if( !pTextObj->HasText() )
{
SdPage* pPage = dynamic_cast< SdPage* >( pTextObj->GetPage() );
if(pPage)
{
bRestored = pPage->RestoreDefaultText( pTextObj );
if( bRestored )
{
SdrOutliner* pOutliner = GetTextEditOutliner();
pTextObj->SetTextEditOutliner( pOutliner );
OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject();
if (pOutliner)
pOutliner->SetText(*pParaObj);
}
}
}
}
2000-09-18 16:07:07 +00:00
return bRestored;
2000-09-18 16:07:07 +00:00
}
/*************************************************************************
|*
|* Originalgroesse der markierten Objekte setzen
|*
\************************************************************************/
void View::SetMarkedOriginalSize()
2000-09-18 16:07:07 +00:00
{
SdrUndoGroup* pUndoGroup = new SdrUndoGroup(*mpDoc);
ULONG nCount = GetMarkedObjectCount();
BOOL bOK = FALSE;
2000-09-18 16:07:07 +00:00
for( sal_uInt32 i = 0; i < nCount; i++ )
2000-09-18 16:07:07 +00:00
{
SdrObject* pObj = GetMarkedObjectByIndex(i);
2000-09-18 16:07:07 +00:00
if( pObj->GetObjInventor() == SdrInventor )
2000-09-18 16:07:07 +00:00
{
if( pObj->GetObjIdentifier() == OBJ_OLE2 )
2000-09-18 16:07:07 +00:00
{
uno::Reference < embed::XEmbeddedObject > xObj = ((SdrOle2Obj*)pObj)->GetObjRef();
if( xObj.is() )
2000-09-18 16:07:07 +00:00
{
// TODO/LEAN: working with VisualArea can switch object to running state
sal_Int64 nAspect = ((SdrOle2Obj*)pObj)->GetAspect();
Size aOleSize;
if ( nAspect == embed::Aspects::MSOLE_ICON )
{
MapMode aMap100( MAP_100TH_MM );
aOleSize = ((SdrOle2Obj*)pObj)->GetOrigObjSize( &aMap100 );
bOK = TRUE;
}
else
{
MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
try
{
awt::Size aSz = xObj->getVisualAreaSize( nAspect );
aOleSize = OutputDevice::LogicToLogic( Size( aSz.Width, aSz.Height ), aUnit, MAP_100TH_MM );
bOK = TRUE;
}
catch( embed::NoVisualAreaSizeException& )
{}
}
if ( bOK )
{
Rectangle aDrawRect( pObj->GetLogicRect() );
pUndoGroup->AddAction( mpDoc->GetSdrUndoFactory().CreateUndoGeoObject( *pObj ) );
pObj->Resize( aDrawRect.TopLeft(), Fraction( aOleSize.Width(), aDrawRect.GetWidth() ),
Fraction( aOleSize.Height(), aDrawRect.GetHeight() ) );
}
2000-09-18 16:07:07 +00:00
}
}
else if( pObj->GetObjIdentifier() == OBJ_GRAF )
2000-09-18 16:07:07 +00:00
{
const MapMode aMap100( MAP_100TH_MM );
Size aSize;
2000-09-18 16:07:07 +00:00
if ( static_cast< SdrGrafObj* >( pObj )->GetGrafPrefMapMode().GetMapUnit() == MAP_PIXEL )
aSize = Application::GetDefaultDevice()->PixelToLogic( static_cast< SdrGrafObj* >( pObj )->GetGrafPrefSize(), aMap100 );
2000-09-18 16:07:07 +00:00
else
{
aSize = OutputDevice::LogicToLogic( static_cast< SdrGrafObj* >( pObj )->GetGrafPrefSize(),
static_cast< SdrGrafObj* >( pObj )->GetGrafPrefMapMode(),
aMap100 );
2000-09-18 16:07:07 +00:00
}
pUndoGroup->AddAction( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj ) );
Rectangle aRect( pObj->GetLogicRect() );
aRect.SetSize( aSize );
pObj->SetLogicRect( aRect );
2000-09-18 16:07:07 +00:00
bOK = TRUE;
2000-09-18 16:07:07 +00:00
}
}
}
if( bOK )
2000-09-18 16:07:07 +00:00
{
pUndoGroup->SetComment( String(SdResId(STR_UNDO_ORIGINALSIZE)) );
mpDocSh->GetUndoManager()->AddUndoAction(pUndoGroup);
2000-09-18 16:07:07 +00:00
}
else
delete pUndoGroup;
}
/** create a virtual device and paints the slide contents into it.
The caller must delete the returned device */
VirtualDevice* View::CreatePageVDev(USHORT nSdPage, PageKind ePageKind, ULONG nWidthPixel)
2000-09-18 16:07:07 +00:00
{
ViewShell* pViewShell = mpDocSh->GetViewShell();
OutputDevice* pRefDevice = 0;
if( pViewShell )
pRefDevice = pViewShell->GetActiveWindow();
if( !pRefDevice )
pRefDevice = Application::GetDefaultDevice();
DBG_ASSERT( pRefDevice, "sd::View::CreatePageVDev(), I need a reference device to work properly!" );
VirtualDevice* pVDev;
if( pRefDevice )
pVDev = new VirtualDevice( *pRefDevice );
else
pVDev = new VirtualDevice();
2000-09-18 16:07:07 +00:00
MapMode aMM( MAP_100TH_MM );
SdPage* pPage = mpDoc->GetSdPage(nSdPage, ePageKind);
DBG_ASSERT(pPage, "sd::View::CreatePageVDev(), slide not found!");
2000-09-18 16:07:07 +00:00
if( pPage )
2000-09-18 16:07:07 +00:00
{
Size aPageSize(pPage->GetSize());
aPageSize.Width() -= pPage->GetLftBorder();
aPageSize.Width() -= pPage->GetRgtBorder();
aPageSize.Height() -= pPage->GetUppBorder();
aPageSize.Height() -= pPage->GetLwrBorder();
// use scaling?
if( nWidthPixel )
{
const Fraction aFrac( (long) nWidthPixel, pVDev->LogicToPixel( aPageSize, aMM ).Width() );
2000-09-18 16:07:07 +00:00
aMM.SetScaleX( aFrac );
aMM.SetScaleY( aFrac );
}
pVDev->SetMapMode( aMM );
if( pVDev->SetOutputSize(aPageSize) )
{
std::auto_ptr< SdrView > pView( new SdrView(mpDoc, pVDev) );
pView->SetPageVisible( FALSE );
pView->SetBordVisible( FALSE );
pView->SetGridVisible( FALSE );
pView->SetHlplVisible( FALSE );
pView->SetGlueVisible( FALSE );
pView->ShowSdrPage(pPage); // WAITING FOR SJ , Point(-pPage->GetLftBorder(), -pPage->GetUppBorder()));
SdrPageView* pPageView = pView->GetSdrPageView();
if( pViewShell )
{
FrameView* pFrameView = pViewShell->GetFrameView();
if( pFrameView )
{
pPageView->SetVisibleLayers( pFrameView->GetVisibleLayers() );
pPageView->SetLockedLayers( pFrameView->GetLockedLayers() );
pPageView->SetPrintableLayers( pFrameView->GetPrintableLayers() );
}
}
// SJ: i40609, the vdev mapmode seems to be dangled after CompleteRedraw,
// so we are pushing here, because the mapmode is used afterwards
pVDev->Push();
2000-09-18 16:07:07 +00:00
Point aPoint( 0, 0 );
Region aRegion (Rectangle( aPoint, aPageSize ) );
pView->CompleteRedraw(pVDev, aRegion);
pVDev->Pop();
}
else
{
DBG_ERROR("sd::View::CreatePageVDev(), virt. device creation failed!");
}
}
2000-09-18 16:07:07 +00:00
return pVDev;
}
/*************************************************************************
|*
|* OLE-Obj am Client connecten
|*
\************************************************************************/
void View::DoConnect(SdrOle2Obj* pObj)
2000-09-18 16:07:07 +00:00
{
if (mpViewSh)
2000-09-18 16:07:07 +00:00
{
uno::Reference < embed::XEmbeddedObject > xObj( pObj->GetObjRef() );
if( xObj.is() )
2000-09-18 16:07:07 +00:00
{
::sd::Window* pWindow = mpViewSh->GetActiveWindow();
SfxInPlaceClient* pSdClient = mpViewSh-> GetViewShellBase().FindIPClient( xObj, pWindow );
if ( !pSdClient )
2001-07-03 13:18:02 +00:00
{
pSdClient = new Client(pObj, mpViewSh, pWindow);
Rectangle aRect = pObj->GetLogicRect();
{
// TODO/LEAN: working with visual area can switch object to running state
Size aDrawSize = aRect.GetSize();
awt::Size aSz;
MapMode aMapMode( mpDoc->GetScaleUnit() );
Size aObjAreaSize = pObj->GetOrigObjSize( &aMapMode );
Fraction aScaleWidth (aDrawSize.Width(), aObjAreaSize.Width() );
Fraction aScaleHeight(aDrawSize.Height(), aObjAreaSize.Height() );
aScaleWidth.ReduceInaccurate(10); // kompatibel zum SdrOle2Obj
aScaleHeight.ReduceInaccurate(10);
pSdClient->SetSizeScale(aScaleWidth, aScaleHeight);
// sichtbarer Ausschnitt wird nur inplace veraendert!
// the object area must be set after the scaling, since it triggers resize
aRect.SetSize(aObjAreaSize);
pSdClient->SetObjArea(aRect);
}
2000-09-18 16:07:07 +00:00
}
}
}
}
/*************************************************************************
|*
|*
|*
\************************************************************************/
BOOL View::IsMorphingAllowed() const
2000-09-18 16:07:07 +00:00
{
const SdrMarkList& rMarkList = GetMarkedObjectList();
2000-09-18 16:07:07 +00:00
BOOL bRet = FALSE;
if ( rMarkList.GetMarkCount() == 2 )
{
const SdrObject* pObj1 = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
const SdrObject* pObj2 = rMarkList.GetMark( 1 )->GetMarkedSdrObj();
2000-09-18 16:07:07 +00:00
const UINT16 nKind1 = pObj1->GetObjIdentifier();
const UINT16 nKind2 = pObj2->GetObjIdentifier();
if ( ( nKind1 != OBJ_TEXT && nKind2 != OBJ_TEXT ) &&
( nKind1 != OBJ_TITLETEXT && nKind2 != OBJ_TITLETEXT ) &&
( nKind1 != OBJ_OUTLINETEXT && nKind2 != OBJ_OUTLINETEXT ) &&
( nKind1 != OBJ_GRUP && nKind2 != OBJ_GRUP ) &&
( nKind1 != OBJ_LINE && nKind2 != OBJ_LINE ) &&
( nKind1 != OBJ_PLIN && nKind2 != OBJ_PLIN ) &&
( nKind1 != OBJ_PATHLINE && nKind2 != OBJ_PATHLINE ) &&
( nKind1 != OBJ_FREELINE && nKind2 != OBJ_FREELINE ) &&
( nKind1 != OBJ_PATHPLIN && nKind2 != OBJ_PATHPLIN ) &&
( nKind1 != OBJ_MEASURE && nKind2 != OBJ_MEASURE ) &&
( nKind1 != OBJ_EDGE && nKind2 != OBJ_EDGE ) &&
( nKind1 != OBJ_GRAF && nKind2 != OBJ_GRAF ) &&
( nKind1 != OBJ_OLE2 && nKind2 != OBJ_OLE2 ) &&
( nKind1 != OBJ_CAPTION && nKind2 != OBJ_CAPTION ) &&
!pObj1->ISA( E3dObject) && !pObj2->ISA( E3dObject) )
{
SfxItemSet aSet1( mpDoc->GetPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE );
SfxItemSet aSet2( mpDoc->GetPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE );
2000-09-18 16:07:07 +00:00
aSet1.Put(pObj1->GetMergedItemSet());
aSet2.Put(pObj2->GetMergedItemSet());
2000-09-18 16:07:07 +00:00
const XFillStyle eFillStyle1 = ( (const XFillStyleItem&) aSet1.Get( XATTR_FILLSTYLE ) ).GetValue();
const XFillStyle eFillStyle2 = ( (const XFillStyleItem&) aSet2.Get( XATTR_FILLSTYLE ) ).GetValue();
if( ( eFillStyle1 == XFILL_NONE || eFillStyle1 == XFILL_SOLID ) &&
( eFillStyle2 == XFILL_NONE || eFillStyle2 == XFILL_SOLID ) )
bRet = TRUE;
}
}
return bRet;
}
/*************************************************************************
|*
|*
|*
\************************************************************************/
BOOL View::IsVectorizeAllowed() const
2000-09-18 16:07:07 +00:00
{
const SdrMarkList& rMarkList = GetMarkedObjectList();
2000-09-18 16:07:07 +00:00
BOOL bRet = FALSE;
if( rMarkList.GetMarkCount() == 1 )
{
const SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
2000-09-18 16:07:07 +00:00
if( pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP )
bRet = TRUE;
}
return bRet;
}
void View::onAccessibilityOptionsChanged()
2002-04-24 06:17:33 +00:00
{
if( mpViewSh )
2002-04-24 06:17:33 +00:00
{
::sd::Window* pWindow = mpViewSh->GetActiveWindow();
2002-04-24 06:17:33 +00:00
if( pWindow )
{
const StyleSettings& rStyleSettings = pWindow->GetSettings().GetStyleSettings();
USHORT nOutputSlot, nPreviewSlot;
SvtAccessibilityOptions& aAccOptions = getAccessibilityOptions();
2002-04-24 06:17:33 +00:00
if( mpViewSh->GetViewFrame() && mpViewSh->GetViewFrame()->GetDispatcher() )
2002-04-24 06:17:33 +00:00
{
if( rStyleSettings.GetHighContrastMode() )
{
nOutputSlot = SID_OUTPUT_QUALITY_CONTRAST;
}
else
{
nOutputSlot = SID_OUTPUT_QUALITY_COLOR;
}
if( rStyleSettings.GetHighContrastMode() && aAccOptions.GetIsForPagePreviews() )
{
nPreviewSlot = SID_PREVIEW_QUALITY_CONTRAST;
}
else
{
nPreviewSlot = SID_PREVIEW_QUALITY_COLOR;
}
mpViewSh->GetViewFrame()->GetDispatcher()->Execute( nOutputSlot, SFX_CALLMODE_ASYNCHRON );
mpViewSh->GetViewFrame()->GetDispatcher()->Execute( nPreviewSlot, SFX_CALLMODE_ASYNCHRON );
2002-04-24 06:17:33 +00:00
}
mpViewSh->Invalidate();
2002-04-24 06:17:33 +00:00
}
}
}
IMPL_LINK( View, OnParagraphInsertedHdl, ::Outliner *, pOutliner )
{
Paragraph* pPara = pOutliner->GetHdlParagraph();
SdrObject* pObj = GetTextEditObject();
if( pPara && pObj )
{
SdPage* pPage = dynamic_cast< SdPage* >( pObj->GetPage() );
if( pPage )
pPage->onParagraphInserted( pOutliner, pPara, pObj );
}
return 0;
}
/*************************************************************************
|*
|* Handler fuer das Loeschen von Seiten (Absaetzen)
|*
\************************************************************************/
IMPL_LINK( View, OnParagraphRemovingHdl, ::Outliner *, pOutliner )
{
Paragraph* pPara = pOutliner->GetHdlParagraph();
SdrObject* pObj = GetTextEditObject();
if( pPara && pObj )
{
SdPage* pPage = dynamic_cast< SdPage* >( pObj->GetPage() );
if( pPage )
pPage->onParagraphRemoving( pOutliner, pPara, pObj );
}
return 0;
}
bool View::isRecordingUndo() const
{
sd::UndoManager* pUndoManager = mpDoc ? mpDoc->GetUndoManager() : 0;
return pUndoManager && pUndoManager->isInListAction();
}
void View::AddCustomHdl()
{
maSmartTags.addCustomHandles( aHdl );
}
void View::updateHandles()
{
AdjustMarkHdl();
}
SdrViewContext View::GetContext() const
{
SdrViewContext eContext = SDRCONTEXT_STANDARD;
if( maSmartTags.getContext( eContext ) )
return eContext;
else
return FmFormView::GetContext();
}
BOOL View::HasMarkablePoints() const
{
if( maSmartTags.HasMarkablePoints() )
return true;
else
return FmFormView::HasMarkablePoints();
}
ULONG View::GetMarkablePointCount() const
{
ULONG nCount = FmFormView::GetMarkablePointCount();
nCount += maSmartTags.GetMarkablePointCount();
return nCount;
}
BOOL View::HasMarkedPoints() const
{
if( maSmartTags.HasMarkedPoints() )
return true;
else
return FmFormView::HasMarkedPoints();
}
ULONG View::GetMarkedPointCount() const
{
ULONG nCount = FmFormView::GetMarkedPointCount();
nCount += maSmartTags.GetMarkedPointCount();
return nCount;
}
BOOL View::IsPointMarkable(const SdrHdl& rHdl) const
{
if( maSmartTags.IsPointMarkable( rHdl ) )
return true;
else
return FmFormView::IsPointMarkable( rHdl );
}
BOOL View::MarkPoint(SdrHdl& rHdl, BOOL bUnmark )
{
if( maSmartTags.MarkPoint( rHdl, bUnmark ) )
return true;
else
return FmFormView::MarkPoint( rHdl, bUnmark );
}
BOOL View::MarkPoints(const Rectangle* pRect, BOOL bUnmark)
{
if( maSmartTags.MarkPoints( pRect, bUnmark ) )
return true;
else
return FmFormView::MarkPoints( pRect, bUnmark );
}
void View::CheckPossibilities()
{
FmFormView::CheckPossibilities();
maSmartTags.CheckPossibilities();
}
void View::OnBeginPasteOrDrop( PasteOrDropInfos* /*pInfos*/ )
{
}
/** this is called after a paste or drop operation, make sure that the newly inserted paragraphs
get the correct style sheet. */
void View::OnEndPasteOrDrop( PasteOrDropInfos* pInfos )
{
SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( GetTextEditObject() );
SdrOutliner* pOutliner = GetTextEditOutliner();
if( pOutliner && pTextObj && pTextObj->GetPage() )
{
SdPage* pPage = static_cast< SdPage* >( pTextObj->GetPage() );
SfxStyleSheet* pStyleSheet = 0;
const PresObjKind eKind = pPage->GetPresObjKind(pTextObj);
if( eKind != PRESOBJ_NONE )
pStyleSheet = pPage->GetStyleSheetForPresObj(eKind);
else
pStyleSheet = pTextObj->GetStyleSheet();
if( eKind == PRESOBJ_OUTLINE )
{
// for outline shapes, set the correct outline style sheet for each
// new paragraph, depending on the paragraph depth
SfxStyleSheetBasePool* pStylePool = GetDoc()->GetStyleSheetPool();
for ( sal_uInt16 nPara = pInfos->nStartPara; nPara <= pInfos->nEndPara; nPara++ )
{
sal_Int16 nDepth = pOutliner->GetDepth( nPara );
SfxStyleSheet* pStyle = 0;
if( nDepth > 0 )
{
String aStyleSheetName( pStyleSheet->GetName() );
aStyleSheetName.Erase( aStyleSheetName.Len() - 1, 1 );
aStyleSheetName += String::CreateFromInt32( nDepth );
pStyle = static_cast<SfxStyleSheet*>( pStylePool->Find( aStyleSheetName, pStyleSheet->GetFamily() ) );
DBG_ASSERT( pStyle, "sd::View::OnEndPasteOrDrop(), Style not found!" );
}
if( !pStyle )
pStyle = pStyleSheet;
pOutliner->SetStyleSheet( nPara, pStyle );
}
}
else
{
// just put the object style on each new paragraph
for ( sal_uInt16 nPara = pInfos->nStartPara; nPara <= pInfos->nEndPara; nPara++ )
{
pOutliner->SetStyleSheet( nPara, pStyleSheet );
}
}
}
}
} // end of namespace sd