summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-10-17 17:24:03 +0200
committerAndras Timar <andras.timar@collabora.com>2017-10-26 11:21:45 +0200
commit73937cda81142d8a23805e2374a6168ae103b48b (patch)
tree11df2587ba8b404d1d4d3813d740aadc462ae7f5 /svx
parent4356afe13c4d5ecf080b09eb38c99ee5fd09bf73 (diff)
tdf#97630 xmloff: ODF extended draw:fit-to-size mess
The plan: 1. As Regina points out, there is already (in ODF 1.2, but not ODF 1.1) a style:shrink-to-fit attribute for shapes, so use this to represent the AUTOFIT value. The fallback from AUTOFIT to draw:fit-to-size="true" was a stupid idea anyway, probably "false" is less annoying in practice. There are 2 different shapes that implement TextFitToSize property: a) text shapes already interpret ALLLINES and PROPORTIONAL exactly the same b) fontwork custom shapes interpret ALLLINES but do nothing for PROPORTIONAL As Regina points out, there is no shape that needs to distinguish between ALLLINES and PROPORTIONAL, so we do a minor behavioral API CHANGE and from now on interpret PROPORTIONAL as ALLLINES on fontwork custom shapes. This obviates the need to distinguish the values in ODF and so we don't need a new attribute, just use draw:fit-to-size="true" for both. On import, use MID_FLAG_MERGE_PROPERTY to combine the 2 attributes into one value. 2. Restrict the export of draw:fit-to-size to only the standard values "true"/"false". This implements step 1, the step 2 will be done in the future when most users have the import of the style:shrink-to-fit. Reviewed-on: https://gerrit.libreoffice.org/43521 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 33eb9fdb61033b3fd35d923900b1f5791f4b71c8) Reviewed-on: https://gerrit.libreoffice.org/43596 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 244dfe2f3fa874d99dacea191e2265a288457a98) Change-Id: I4a378aa110fdb82db7a99a839d7ff207248a73e7
Diffstat (limited to 'svx')
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx5
-rw-r--r--svx/source/toolbars/fontworkbar.cxx10
2 files changed, 12 insertions, 3 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index a999791a5c5a..26f227e8b9a4 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -433,7 +433,10 @@ void GetFontWorkOutline( FWData& rFWData, const SdrObject* pCustomShape )
while ( aTextAreaIter != aTextAreaIEnd )
{
GetTextAreaOutline( rFWData, pCustomShape, *aTextAreaIter, bSameLetterHeights );
- if ( eFTS == SdrFitToSizeType::AllLines )
+ if (eFTS == SdrFitToSizeType::AllLines ||
+ // tdf#97630 interpret PROPORTIONAL same as ALLLINES so we don't
+ // need another ODF attribute!
+ eFTS == SdrFitToSizeType::Proportional)
{
std::vector< FWParagraphData >::iterator aParagraphIter( aTextAreaIter->vParagraphs.begin() );
std::vector< FWParagraphData >::const_iterator aParagraphIEnd( aTextAreaIter->vParagraphs.end() );
diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx
index a148de31cf13..329cd2bcb006 100644
--- a/svx/source/toolbars/fontworkbar.cxx
+++ b/svx/source/toolbars/fontworkbar.cxx
@@ -73,10 +73,16 @@ void SetAlignmentState( SdrView* pSdrView, SfxItemSet& rSet )
case SDRTEXTHORZADJUST_RIGHT : nAlignment = 2; break;
case SDRTEXTHORZADJUST_BLOCK :
{
- if ( rTextFitToSizeTypeItem.GetValue() == SdrFitToSizeType::NONE )
+ auto const fit(rTextFitToSizeTypeItem.GetValue());
+ if (fit == SdrFitToSizeType::NONE)
+ {
nAlignment = 3;
- else if ( rTextFitToSizeTypeItem.GetValue() == SdrFitToSizeType::AllLines )
+ }
+ else if (fit == SdrFitToSizeType::AllLines ||
+ fit == SdrFitToSizeType::Proportional)
+ {
nAlignment = 4;
+ }
}
}
if ( ( nOldAlignment != -1 ) && ( nOldAlignment != nAlignment ) )