summaryrefslogtreecommitdiff
path: root/sd/source/ui/view/sdview.cxx
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2008-06-06 11:11:54 +0000
committerRüdiger Timm <rt@openoffice.org>2008-06-06 11:11:54 +0000
commit8aa3d1214b17873f6c3d79d95da8bc33d78298c4 (patch)
tree9fc82fc0cb31e03a74f5ddfdca0929b5c086a15f /sd/source/ui/view/sdview.cxx
parent4f060fc40087b37211315daeac75af5b85cdfa93 (diff)
INTEGRATION: CWS impressodf12 (1.62.4); FILE MERGED
2008/05/30 14:09:18 cl 1.62.4.4: #i75927# fixed send to outliner after bullet rework 2008/05/26 12:25:03 cl 1.62.4.3: #i35937# code cleanup after bullet rework 2008/04/25 08:49:36 cl 1.62.4.2: RESYNC: (1.62-1.64); FILE MERGED 2008/04/10 17:07:47 cl 1.62.4.1: #i35937# allow paragraph depth of -1 to switch of numbering
Diffstat (limited to 'sd/source/ui/view/sdview.cxx')
-rw-r--r--sd/source/ui/view/sdview.cxx73
1 files changed, 65 insertions, 8 deletions
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index e540dae509a3..08503d56b27a 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: sdview.cxx,v $
- * $Revision: 1.64 $
+ * $Revision: 1.65 $
*
* This file is part of OpenOffice.org.
*
@@ -682,7 +682,6 @@ sal_Bool View::SdrBeginTextEdit(
// make draw&impress specific initialisations
if( pOutl )
{
- pOutl->SetMinDepth(0);
pOutl->SetStyleSheetPool((SfxStyleSheetPool*) mpDoc->GetStyleSheetPool());
pOutl->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl));
ULONG nCntrl = pOutl->GetControlWord();
@@ -708,11 +707,6 @@ sal_Bool View::SdrBeginTextEdit(
pOutl->SetHyphenator( xHyphenator );
pOutl->SetDefaultLanguage( Application::GetSettings().GetLanguage() );
-
- // in einem Gliederungstext darf nicht auf die 0-te
- // Ebene ausgerueckt werden
- if (pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_OUTLINETEXT)
- pOutl->SetMinDepth(1);
}
sal_Bool bReturn = FmFormView::SdrBeginTextEdit(
@@ -769,7 +763,11 @@ SdrEndTextEditKind View::SdrEndTextEdit(BOOL bDontDeleteReally )
{
SdrTextObj* pObj = dynamic_cast< SdrTextObj* >( xObj.get() );
if( pObj && pObj->HasText() )
- pObj->SetEmptyPresObj( FALSE );
+ {
+ SdrPage* pPage = pObj->GetPage();
+ if( !pPage || !pPage->IsMasterPage() )
+ pObj->SetEmptyPresObj( FALSE );
+ }
}
GetViewShell()->GetViewShellBase().GetEventMultiplexer()->MultiplexEvent(sd::tools::EventMultiplexerEvent::EID_END_TEXT_EDIT, (void*)xObj.get() );
@@ -1267,4 +1265,63 @@ void View::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