summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-10-14 16:38:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-10-19 06:23:38 +0000
commit7e4887679924df28da2083735e0367ecccb8180b (patch)
treeedbc98654d9a28900408794b05008fc42f1bf4d3 /sd/source/ui
parent930f0242a11538ddda0e80712be98ff6b9431fd2 (diff)
tdf#103083 - EDITING: Cut and Paste changes bullet point formatting
The bug is that, on paste, the incorrect stylesheet is set on a paragraph node, leading to the loss of bullet formatting information. There are two copies of this style-resetting code, one in sd::View::OnEndPasteOrDrop and the other in Outliner::ImplSetLevelDependendStyleSheet. The first one was introduced by: commit 8aa3d1214b17873f6c3d79d95da8bc33d78298c4 Author: Rüdiger Timm <rt@openoffice.org> Date: Fri Jun 6 11:11:54 2008 +0000 INTEGRATION: CWS impressodf12 (1.62.4); FILE MERGED And the second one by: commit a6b3e8c1495151b99c3f2f0eadf5881654cbd3b3 Author: Rüdiger Timm <rt@openoffice.org> Date: Fri Jun 6 11:30:58 2008 +0000 INTEGRATION: CWS impressodf12 (1.70.350); FILE MERGED The second one appears to do the right thing, and fixes this bug, so I am deleting the first one. Change-Id: I5eede7fe7bd3aa24696b495e740d1a4df124bd3a Reviewed-on: https://gerrit.libreoffice.org/30009 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui')
-rw-r--r--sd/source/ui/view/sdview.cxx43
1 files changed, 7 insertions, 36 deletions
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index 1838126b4ab0..a4ed14783879 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -1210,44 +1210,15 @@ void View::OnEndPasteOrDrop( PasteOrDropInfos* pInfo )
if( pOutliner && pTextObj && pTextObj->GetPage() )
{
SdPage* pPage = static_cast< SdPage* >( pTextObj->GetPage() );
-
- SfxStyleSheet* pStyleSheet = nullptr;
-
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_Int32 nPara = pInfo->nStartPara; nPara <= pInfo->nEndPara; nPara++ )
- {
- sal_Int16 nDepth = pOutliner->GetDepth( nPara );
-
- SfxStyleSheet* pStyle = nullptr;
- if( nDepth > 0 )
- {
- OUString aStyleSheetName( pStyleSheet->GetName() );
- if (!aStyleSheetName.isEmpty())
- aStyleSheetName = aStyleSheetName.copy(0, aStyleSheetName.getLength() - 1);
- aStyleSheetName += OUString::number( 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
+ // outline kinds are taken care of in Outliner::ImplSetLevelDependendStyleSheet
+ if( eKind != PRESOBJ_OUTLINE )
{
+ SfxStyleSheet* pStyleSheet = nullptr;
+ if( eKind != PRESOBJ_NONE )
+ pStyleSheet = pPage->GetStyleSheetForPresObj(eKind);
+ else
+ pStyleSheet = pTextObj->GetStyleSheet();
// just put the object style on each new paragraph
for ( sal_Int32 nPara = pInfo->nStartPara; nPara <= pInfo->nEndPara; nPara++ )
{