diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-07-01 12:43:11 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-07-01 12:43:11 +0000 |
commit | 6d31d46a3a81935c0f7dd522bc014e8c0ce011c9 (patch) | |
tree | fcd15393b9179112fc987873368dc7ab95e17fc2 /svx/source/svdraw/svdotext.cxx | |
parent | 34b3bf92c0a2f975e0828d2836a4bca40d257be7 (diff) |
INTEGRATION: CWS impress144 (1.88.106); FILE MERGED
2008/06/10 11:26:35 cl 1.88.106.1: #i87698# fixed ::SetVertical( sal_True ) if text is still empty
Diffstat (limited to 'svx/source/svdraw/svdotext.cxx')
-rw-r--r-- | svx/source/svdraw/svdotext.cxx | 113 |
1 files changed, 55 insertions, 58 deletions
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 9dba431c5d84..117993c0ecc2 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: svdotext.cxx,v $ - * $Revision: 1.88 $ + * $Revision: 1.89 $ * * This file is part of OpenOffice.org. * @@ -1986,70 +1986,67 @@ sal_Bool SdrTextObj::IsVerticalWriting() const void SdrTextObj::SetVerticalWriting(sal_Bool bVertical) { OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject(); - if( pOutlinerParaObject ) + if( !pOutlinerParaObject && bVertical ) { - if( !pOutlinerParaObject && bVertical ) + // we only need to force a outliner para object if the default of + // horizontal text is changed + ForceOutlinerParaObject(); + pOutlinerParaObject = GetOutlinerParaObject(); + } + + if( pOutlinerParaObject && (pOutlinerParaObject->IsVertical() != bVertical) ) + { + // get item settings + const SfxItemSet& rSet = GetObjectItemSet(); + sal_Bool bAutoGrowWidth = ((SdrTextAutoGrowWidthItem&)rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue(); + sal_Bool bAutoGrowHeight = ((SdrTextAutoGrowHeightItem&)rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT)).GetValue(); + + // #103516# Also exchange hor/ver adjust items + SdrTextHorzAdjust eHorz = ((SdrTextHorzAdjustItem&)(rSet.Get(SDRATTR_TEXT_HORZADJUST))).GetValue(); + SdrTextVertAdjust eVert = ((SdrTextVertAdjustItem&)(rSet.Get(SDRATTR_TEXT_VERTADJUST))).GetValue(); + + // rescue object size + Rectangle aObjectRect = GetSnapRect(); + + // prepare ItemSet to set exchanged width and height items + SfxItemSet aNewSet(*rSet.GetPool(), + SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT, + // #103516# Expanded item ranges to also support hor and ver adjust. + SDRATTR_TEXT_VERTADJUST, SDRATTR_TEXT_VERTADJUST, + SDRATTR_TEXT_AUTOGROWWIDTH, SDRATTR_TEXT_HORZADJUST, + 0, 0); + + aNewSet.Put(rSet); + aNewSet.Put(SdrTextAutoGrowWidthItem(bAutoGrowHeight)); + aNewSet.Put(SdrTextAutoGrowHeightItem(bAutoGrowWidth)); + + // #103516# Exchange horz and vert adjusts + switch(eVert) { - // we only need to force a outliner para object if the default of - // horizontal text is changed - ForceOutlinerParaObject(); - pOutlinerParaObject = GetOutlinerParaObject(); + case SDRTEXTVERTADJUST_TOP: aNewSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT)); break; + case SDRTEXTVERTADJUST_CENTER: aNewSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_CENTER)); break; + case SDRTEXTVERTADJUST_BOTTOM: aNewSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_LEFT)); break; + case SDRTEXTVERTADJUST_BLOCK: aNewSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_BLOCK)); break; } - - if( pOutlinerParaObject && (pOutlinerParaObject->IsVertical() != bVertical) ) + switch(eHorz) { - // get item settings - const SfxItemSet& rSet = GetObjectItemSet(); - sal_Bool bAutoGrowWidth = ((SdrTextAutoGrowWidthItem&)rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue(); - sal_Bool bAutoGrowHeight = ((SdrTextAutoGrowHeightItem&)rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT)).GetValue(); - - // #103516# Also exchange hor/ver adjust items - SdrTextHorzAdjust eHorz = ((SdrTextHorzAdjustItem&)(rSet.Get(SDRATTR_TEXT_HORZADJUST))).GetValue(); - SdrTextVertAdjust eVert = ((SdrTextVertAdjustItem&)(rSet.Get(SDRATTR_TEXT_VERTADJUST))).GetValue(); - - // rescue object size - Rectangle aObjectRect = GetSnapRect(); - - // prepare ItemSet to set exchanged width and height items - SfxItemSet aNewSet(*rSet.GetPool(), - SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT, - // #103516# Expanded item ranges to also support hor and ver adjust. - SDRATTR_TEXT_VERTADJUST, SDRATTR_TEXT_VERTADJUST, - SDRATTR_TEXT_AUTOGROWWIDTH, SDRATTR_TEXT_HORZADJUST, - 0, 0); - - aNewSet.Put(rSet); - aNewSet.Put(SdrTextAutoGrowWidthItem(bAutoGrowHeight)); - aNewSet.Put(SdrTextAutoGrowHeightItem(bAutoGrowWidth)); - - // #103516# Exchange horz and vert adjusts - switch(eVert) - { - case SDRTEXTVERTADJUST_TOP: aNewSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT)); break; - case SDRTEXTVERTADJUST_CENTER: aNewSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_CENTER)); break; - case SDRTEXTVERTADJUST_BOTTOM: aNewSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_LEFT)); break; - case SDRTEXTVERTADJUST_BLOCK: aNewSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_BLOCK)); break; - } - switch(eHorz) - { - case SDRTEXTHORZADJUST_LEFT: aNewSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_BOTTOM)); break; - case SDRTEXTHORZADJUST_CENTER: aNewSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_CENTER)); break; - case SDRTEXTHORZADJUST_RIGHT: aNewSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP)); break; - case SDRTEXTHORZADJUST_BLOCK: aNewSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_BLOCK)); break; - } + case SDRTEXTHORZADJUST_LEFT: aNewSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_BOTTOM)); break; + case SDRTEXTHORZADJUST_CENTER: aNewSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_CENTER)); break; + case SDRTEXTHORZADJUST_RIGHT: aNewSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP)); break; + case SDRTEXTHORZADJUST_BLOCK: aNewSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_BLOCK)); break; + } - SetObjectItemSet(aNewSet); + SetObjectItemSet(aNewSet); - pOutlinerParaObject = GetOutlinerParaObject(); - if( pOutlinerParaObject ) - { - // set ParaObject orientation accordingly - pOutlinerParaObject->SetVertical(bVertical); - } - - // restore object size - SetSnapRect(aObjectRect); + pOutlinerParaObject = GetOutlinerParaObject(); + if( pOutlinerParaObject ) + { + // set ParaObject orientation accordingly + pOutlinerParaObject->SetVertical(bVertical); } + + // restore object size + SetSnapRect(aObjectRect); } } |