diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-03-12 08:55:38 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-03-12 08:55:38 +0000 |
commit | 267a39cad2b9817e049b06b05874199633cde1cc (patch) | |
tree | 778ebf70744403e9e11d1f331c219b660ea58924 /svx/source/svdraw/svdotxed.cxx | |
parent | 635b102a4ccd5dd60589b9573be7354a01ec78da (diff) |
INTEGRATION: CWS impresstables2 (1.18.136); FILE MERGED
2007/08/01 18:46:24 cl 1.18.136.3: RESYNC: (1.18-1.19); FILE MERGED
2007/05/03 09:05:13 cl 1.18.136.2: #i68103# more table work
2007/03/15 17:08:17 cl 1.18.136.1: #i68103# starting to seperate the text from the SdrTextObj
Diffstat (limited to 'svx/source/svdraw/svdotxed.cxx')
-rw-r--r-- | svx/source/svdraw/svdotxed.cxx | 76 |
1 files changed, 29 insertions, 47 deletions
diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index 4f39a450358f..9d336853bc6e 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -4,9 +4,9 @@ * * $RCSfile: svdotxed.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: hr $ $Date: 2007-06-27 19:09:02 $ + * last change: $Author: rt $ $Date: 2008-03-12 09:55:38 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -104,34 +104,33 @@ sal_Bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl) rOutl.SetControlWord(nStat); } - if (pOutlinerParaObject!=NULL) { - rOutl.SetText(*pOutlinerParaObject); + OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject(); + if(pOutlinerParaObject!=NULL) + { + rOutl.SetText(*GetOutlinerParaObject()); } // ggf. Rahmenattribute am 1. (neuen) Absatz des Outliners setzen - if (rOutl.GetParagraphCount()==1) { // bei nur einem Para nachsehen ob da ueberhaupt was drin steht - XubString aStr( rOutl.GetText( rOutl.GetParagraph( 0 ) ) ); - - if(!aStr.Len()) - { - // Aha, steht nix drin! - // damit sich der Outliner initiallisiert - rOutl.SetText( String(), rOutl.GetParagraph( 0 ) ); - - if(GetStyleSheet()) - rOutl.SetStyleSheet( 0, GetStyleSheet()); - - // Beim setzen der harten Attribute an den ersten Absatz muss - // der Parent pOutlAttr (=die Vorlage) temporaer entfernt - // werden, da sonst bei SetParaAttribs() auch alle in diesem - // Parent enthaltenen Items hart am Absatz attributiert werden. - // -> BugID 22467 - const SfxItemSet& rSet = GetObjectItemSet(); - SfxItemSet aFilteredSet(*rSet.GetPool(), EE_ITEMS_START, EE_ITEMS_END); - aFilteredSet.Put(rSet); - rOutl.SetParaAttribs(0, aFilteredSet); - } + if( !HasTextImpl( &rOutl ) ) + { + // Outliner has no text so we must set some + // empty text so the outliner initialise itself + rOutl.SetText( String(), rOutl.GetParagraph( 0 ) ); + + if(GetStyleSheet()) + rOutl.SetStyleSheet( 0, GetStyleSheet()); + + // Beim setzen der harten Attribute an den ersten Absatz muss + // der Parent pOutlAttr (=die Vorlage) temporaer entfernt + // werden, da sonst bei SetParaAttribs() auch alle in diesem + // Parent enthaltenen Items hart am Absatz attributiert werden. + // -> BugID 22467 + const SfxItemSet& rSet = GetObjectItemSet(); + SfxItemSet aFilteredSet(*rSet.GetPool(), EE_ITEMS_START, EE_ITEMS_END); + aFilteredSet.Put(rSet); + rOutl.SetParaAttribs(0, aFilteredSet); } - if (bFitToSize) { + if (bFitToSize) + { Rectangle aAnchorRect; Rectangle aTextRect; TakeTextRect(rOutl, aTextRect, FALSE, @@ -279,31 +278,14 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl) if(rOutl.IsModified()) { OutlinerParaObject* pNewText = NULL; - Paragraph* p1stPara = rOutl.GetParagraph( 0 ); - UINT32 nParaAnz = rOutl.GetParagraphCount(); - if(p1stPara) + if(HasTextImpl( &rOutl ) ) { - if(nParaAnz == 1) - { - // bei nur einem Para nachsehen ob da ueberhaupt was drin steht - XubString aStr(rOutl.GetText(p1stPara)); - - if(!aStr.Len()) - { - // Aha, steht nix drin! - nParaAnz = 0; - } - } - // Damit der grauen Feldhintergrund wieder verschwindet rOutl.UpdateFields(); - if(nParaAnz != 0) - { - // Wirklich Textobjekt kreieren - pNewText = rOutl.CreateParaObject( 0, (sal_uInt16)nParaAnz ); - } + sal_uInt16 nParaAnz = static_cast< sal_uInt16 >( rOutl.GetParagraphCount() ); + pNewText = rOutl.CreateParaObject( 0, nParaAnz ); } SetOutlinerParaObject(pNewText); } |