diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-06-29 10:12:28 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-06-29 09:49:07 +0000 |
commit | 488fd60c2dc2372f3dc33f5a5313e4f032adf968 (patch) | |
tree | b6d91a1a25416e76d47acdd804ead6f0f1a3eeda /svx | |
parent | 9724eaa94e1f1e58dbbba2ecad4287245e0f0bf0 (diff) |
Reinstate: tdf#99729: fix text alignment (no autofit & no full width)
with extra disposes to shutdown the test thingies in the right order
This reverts commit a4780b3c8b45261e59ed3cbb34c4463d58ad8079.
Change-Id: I13282d6bc54a0dceb3ed91a04cd438a9011154fe
Reviewed-on: https://gerrit.libreoffice.org/26756
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdmodel.cxx | 33 | ||||
-rw-r--r-- | svx/source/svdraw/svdotextdecomposition.cxx | 18 |
2 files changed, 43 insertions, 8 deletions
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 5c662896f6f1..8d970297d779 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -103,6 +103,8 @@ struct SdrModelImpl { SfxUndoManager* mpUndoManager; SdrUndoFactory* mpUndoFactory; + + bool mbAnchoredTextOverflowLegacy; // tdf#99729 compatibility flag }; @@ -112,6 +114,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe mpImpl.reset(new SdrModelImpl); mpImpl->mpUndoManager=nullptr; mpImpl->mpUndoFactory=nullptr; + mpImpl->mbAnchoredTextOverflowLegacy = false; mbInDestruction = false; aObjUnit=SdrEngineDefaults::GetMapFraction(); eObjUnit=SdrEngineDefaults::GetMapUnit(); @@ -1886,6 +1889,16 @@ void SdrModel::SetAddExtLeading( bool bEnabled ) } } +void SdrModel::SetAnchoredTextOverflowLegacy(bool bEnabled) +{ + mpImpl->mbAnchoredTextOverflowLegacy = bEnabled; +} + +bool SdrModel::IsAnchoredTextOverflowLegacy() const +{ + return mpImpl->mbAnchoredTextOverflowLegacy; +} + void SdrModel::ReformatAllTextObjects() { ImpReformatAllTextObjects(); @@ -1925,16 +1938,28 @@ SvxNumType SdrModel::GetPageNumType() const return SVX_ARABIC; } -void SdrModel::ReadUserDataSequenceValue(const css::beans::PropertyValue* /*pValue*/) +void SdrModel::ReadUserDataSequenceValue(const css::beans::PropertyValue* pValue) +{ + bool bBool = false; + if (pValue->Name == "AnchoredTextOverflowLegacy") + { + if (pValue->Value >>= bBool) + { + mpImpl->mbAnchoredTextOverflowLegacy = bBool; + } + } +} + +template <typename T> +inline void addPair(std::vector< std::pair< OUString, Any > >& aUserData, const OUString& name, const T val) { - (void) this; // TODO: Read common model-level values + aUserData.push_back(std::pair< OUString, Any >(name, css::uno::makeAny(val))); } void SdrModel::WriteUserDataSequence(css::uno::Sequence < css::beans::PropertyValue >& rValues, bool /*bBrowse*/) { std::vector< std::pair< OUString, Any > > aUserData; - (void) this; - // TODO: Write common model-level properties (e.g. to settings.xml) + addPair(aUserData, "AnchoredTextOverflowLegacy", IsAnchoredTextOverflowLegacy()); const sal_Int32 nOldLength = rValues.getLength(); rValues.realloc(nOldLength + aUserData.size()); diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 27f289dde2f9..63bfcdd53bdb 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -972,14 +972,24 @@ void SdrTextObj::impDecomposeBlockTextPrimitive( // 'measurement' of the real size of block text would not work Size aMaxAutoPaperSize(aAnchorTextSize); - if(bHorizontalIsBlock) + // Usual processing - always grow in one of directions + bool bAllowGrowVertical = !bVerticalWriting; + bool bAllowGrowHorizontal = bVerticalWriting; + // Compatibility mode for tdf#99729 + if (this->pModel->IsAnchoredTextOverflowLegacy()) { - // allow to grow vertical for horizontal blocks + bAllowGrowVertical = bHorizontalIsBlock; + bAllowGrowHorizontal = bVerticalIsBlock; + } + + if (bAllowGrowVertical) + { + // allow to grow vertical for horizontal texts aMaxAutoPaperSize.setHeight(1000000); } - else if(bVerticalIsBlock) + else if (bAllowGrowHorizontal) { - // allow to grow horizontal for vertical blocks + // allow to grow horizontal for vertical texts aMaxAutoPaperSize.setWidth(1000000); } |