[Libreoffice-commits] core.git: 2 commits - cui/source filter/source include/svx offapi/com sc/source sd/source svx/source sw/source

Michael Stahl mstahl at redhat.com
Wed Oct 18 10:36:13 UTC 2017


 cui/source/tabpages/textattr.cxx                        |   12 ++++----
 filter/source/msfilter/escherex.cxx                     |    5 ++-
 filter/source/msfilter/msdffimp.cxx                     |    4 +-
 filter/source/msfilter/svdfppt.cxx                      |    2 -
 include/svx/sdtfsitm.hxx                                |   24 +++++-----------
 include/svx/svddef.hxx                                  |    2 -
 include/svx/svdotext.hxx                                |    2 -
 offapi/com/sun/star/drawing/TextFitToSizeType.idl       |   20 ++++++-------
 sc/source/filter/excel/xeescher.cxx                     |    2 -
 sd/source/core/stlpool.cxx                              |    2 -
 sd/source/ui/func/futext.cxx                            |    4 +-
 sd/source/ui/view/drviews2.cxx                          |    4 +-
 sd/source/ui/view/drviewsj.cxx                          |    2 -
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |    4 +-
 svx/source/svdraw/svdattr.cxx                           |    6 ++--
 svx/source/svdraw/svdfmtf.cxx                           |    2 -
 svx/source/svdraw/svdibrow.cxx                          |    5 ++-
 svx/source/svdraw/svdotext.cxx                          |   11 ++++---
 svx/source/toolbars/fontworkbar.cxx                     |    8 ++---
 sw/source/filter/ww8/ww8graf.cxx                        |    4 +-
 20 files changed, 61 insertions(+), 64 deletions(-)

New commits:
commit e2c85365dfa40c03c6ea04023627366d118bb530
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Oct 18 12:28:45 2017 +0200

    svx: remove pointless duplicate SdrFitToSizeType
    
    Change-Id: I7a59ecfdb8d09ecbc0b760003dbc453ac5646d1c

diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx
index a56710534587..d21dffa3ead7 100644
--- a/cui/source/tabpages/textattr.cxx
+++ b/cui/source/tabpages/textattr.cxx
@@ -38,6 +38,8 @@
 #include <svx/ofaitem.hxx>
 #include <editeng/writingmodeitem.hxx>
 
+using namespace ::com::sun::star;
+
 const sal_uInt16 SvxTextAttrPage::pRanges[] =
 {
       SDRATTR_MISC_FIRST
@@ -309,9 +311,9 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
     // adjust to border
     if ( rAttrs->GetItemState( SDRATTR_TEXT_FITTOSIZE ) != SfxItemState::DONTCARE )
     {
-        SdrFitToSizeType eFTS =
+        drawing::TextFitToSizeType const eFTS =
                     static_cast<const SdrTextFitToSizeTypeItem&>( rAttrs->Get( SDRATTR_TEXT_FITTOSIZE ) ).GetValue();
-        if( eFTS == SdrFitToSizeType::Autofit || eFTS == SdrFitToSizeType::NONE )
+        if (eFTS == drawing::TextFitToSizeType_AUTOFIT || eFTS == drawing::TextFitToSizeType_NONE)
             m_pTsbFitToSize->SetState( TRISTATE_FALSE );
         else
             m_pTsbFitToSize->SetState( TRISTATE_TRUE );
@@ -407,14 +409,14 @@ bool SvxTextAttrPage::FillItemSet( SfxItemSet* rAttrs)
     eState = m_pTsbFitToSize->GetState();
     if( m_pTsbFitToSize->IsValueChangedFromSaved() )
     {
-        SdrFitToSizeType eFTS;
+        drawing::TextFitToSizeType eFTS;
         switch( eState )
         {
             default: ; //prevent warning
                 OSL_FAIL( "svx::SvxTextAttrPage::FillItemSet(), unhandled state!" );
                 SAL_FALLTHROUGH;
-            case TRISTATE_FALSE: eFTS = SdrFitToSizeType::Autofit; break;
-            case TRISTATE_TRUE: eFTS = SdrFitToSizeType::Proportional; break;
+            case TRISTATE_FALSE: eFTS = drawing::TextFitToSizeType_AUTOFIT; break;
+            case TRISTATE_TRUE: eFTS = drawing::TextFitToSizeType_PROPORTIONAL; break;
         }
         rAttrs->Put( SdrTextFitToSizeTypeItem( eFTS ) );
     }
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 187661fa05cc..4efaa4fffcc6 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -3447,8 +3447,9 @@ void EscherPropertyContainer::CreateCustomShapeProperties( const MSO_SPT eShapeT
                                     break;
                                 case drawing::TextHorizontalAdjust_BLOCK:
                                     {
-                                        SdrFitToSizeType  eFTS( static_cast<const SdrTextFitToSizeTypeItem&>(pCustoShape->GetMergedItem( SDRATTR_TEXT_FITTOSIZE )).GetValue() );
-                                        if ( eFTS == SdrFitToSizeType::AllLines)
+                                        drawing::TextFitToSizeType const eFTS(
+                                            static_cast<const SdrTextFitToSizeTypeItem&>(pCustoShape->GetMergedItem( SDRATTR_TEXT_FITTOSIZE )).GetValue() );
+                                        if (eFTS == drawing::TextFitToSizeType_ALLLINES)
                                         {
                                             gTextAlign = mso_alignTextStretch;
                                         }
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 48d2f2952121..164f66dcc5f9 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4396,9 +4396,9 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
                             }
                             aSet.Put( SdrTextHorzAdjustItem( eHorzAdjust ) );
 
-                            SdrFitToSizeType eFTS = SdrFitToSizeType::NONE;
+                            drawing::TextFitToSizeType eFTS = drawing::TextFitToSizeType_NONE;
                             if ( eGeoTextAlign == mso_alignTextStretch )
-                                eFTS = SdrFitToSizeType::AllLines;
+                                eFTS = drawing::TextFitToSizeType_ALLLINES;
                             aSet.Put( SdrTextFitToSizeTypeItem( eFTS ) );
                         }
                         if ( IsProperty( DFF_Prop_gtextSpacing ) )
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 48e2a98ea1e5..f3e7887bfda9 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -1092,7 +1092,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
                 //See fdo#41245
                 if (bAutoFit && !bAutoGrowHeight && !bAutoGrowWidth)
                 {
-                    pTObj->SetMergedItem( SdrTextFitToSizeTypeItem(SdrFitToSizeType::Autofit) );
+                    pTObj->SetMergedItem( SdrTextFitToSizeTypeItem(drawing::TextFitToSizeType_AUTOFIT) );
                 }
 
             if ( dynamic_cast<const SdrObjCustomShape* >(pTObj) ==  nullptr )
diff --git a/include/svx/sdtfsitm.hxx b/include/svx/sdtfsitm.hxx
index 51909e891de5..2c9d6bb75ddb 100644
--- a/include/svx/sdtfsitm.hxx
+++ b/include/svx/sdtfsitm.hxx
@@ -19,33 +19,25 @@
 #ifndef INCLUDED_SVX_SDTFSITM_HXX
 #define INCLUDED_SVX_SDTFSITM_HXX
 
+#include <com/sun/star/drawing/TextFitToSizeType.hpp>
+
 #include <svl/eitem.hxx>
 #include <svx/svddef.hxx>
 #include <svx/svxdllapi.h>
 
-enum class SdrFitToSizeType
-{
-    NONE,         // - no fit-to-size
-    Proportional, // - resize all glyphs proportionally
-                  //   (might scale anisotrophically)
-    AllLines,     // - like SdrFitToSizeType::Proportional, but
-                  //   scales each line separately
-    Autofit       // - mimics PPT's automatic adaption of
-                  //   font size to text rect - comparable
-                  //   to SdrFitToSizeType::Proportional, but
-                  //   scales isotrophically
-};
 
-// No AutoGrow and no automatic line breaks for
-// SdrFitToSizeType::Proportional and SdrFitToSizeType::AllLines.
 // No automatic line breaks for AutoGrowingWidth as well (only if
 // TextMaxFrameWidth is reached).
 
 
-class SVX_DLLPUBLIC SdrTextFitToSizeTypeItem: public SfxEnumItem<SdrFitToSizeType> {
+class SVX_DLLPUBLIC SdrTextFitToSizeTypeItem
+    : public SfxEnumItem<css::drawing::TextFitToSizeType>
+{
 public:
     static SfxPoolItem* CreateDefault();
-    SdrTextFitToSizeTypeItem(SdrFitToSizeType eFit=SdrFitToSizeType::NONE): SfxEnumItem(SDRATTR_TEXT_FITTOSIZE, eFit) {}
+    SdrTextFitToSizeTypeItem(
+            css::drawing::TextFitToSizeType const eFit = css::drawing::TextFitToSizeType_NONE)
+        : SfxEnumItem(SDRATTR_TEXT_FITTOSIZE, eFit) {}
     virtual SfxPoolItem*     Clone(SfxItemPool* pPool=nullptr) const override;
     virtual sal_uInt16       GetValueCount() const override;
 
diff --git a/include/svx/svddef.hxx b/include/svx/svddef.hxx
index eed623e04149..61e61df07ffc 100644
--- a/include/svx/svddef.hxx
+++ b/include/svx/svddef.hxx
@@ -88,7 +88,7 @@
 #define SDRATTR_ECKENRADIUS             (SDRATTR_MISC_FIRST + 0)   /*   1097 */ /*   1097 */ /*   1080 long, def=0       */
 #define SDRATTR_TEXT_MINFRAMEHEIGHT     (SDRATTR_MISC_FIRST + 1)   /*   1098 */ /*   1098 */ /*   1081 long, def=0       */
 #define SDRATTR_TEXT_AUTOGROWHEIGHT     (SDRATTR_MISC_FIRST + 2)   /*   1099 */ /*   1099 */ /*   1082 sal_Bool, def=sal_True    */
-#define SDRATTR_TEXT_FITTOSIZE          (SDRATTR_MISC_FIRST + 3)   /*   1100 */ /*   1100 */ /*   1083 enum, def=SdrFitToSizeType::NONE */
+#define SDRATTR_TEXT_FITTOSIZE          (SDRATTR_MISC_FIRST + 3)   /*   1100 */ /*   1100 */ /*   1083 enum, def=css::drawing::TextFitToSizeType_NONE */
 #define SDRATTR_TEXT_LEFTDIST           (SDRATTR_MISC_FIRST + 4)   /*   1101 */ /*   1101 */ /*   1084 long, def=0 */ /* Pool V2 */
 #define SDRATTR_TEXT_RIGHTDIST          (SDRATTR_MISC_FIRST + 5)   /*   1102 */ /*   1102 */ /*   1085 long, def=0 */ /* Pool V2 */
 #define SDRATTR_TEXT_UPPERDIST          (SDRATTR_MISC_FIRST + 6)   /*   1103 */ /*   1103 */ /*   1086 long, def=0 */ /* Pool V2 */
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index 33fa54a321fa..a2860906481f 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -400,7 +400,7 @@ public:
     long GetMinTextFrameWidth() const;
     long GetMaxTextFrameWidth() const;
 
-    SdrFitToSizeType GetFitToSize() const;
+    css::drawing::TextFitToSizeType GetFitToSize() const;
     const tools::Rectangle &GetGeoRect() const;
 
     // check if it's a TextFontwork
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index f3da7609ae02..d02b59546a10 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1205,7 +1205,7 @@ XclExpNote::XclExpNote(const XclExpRoot& rRoot, const ScAddress& rScPos,
                     SfxItemSet aItemSet = pCaption->GetMergedItemSet();
                     meTVA       = pCaption->GetTextVerticalAdjust();
                     meTHA       = pCaption->GetTextHorizontalAdjust();
-                    mbAutoScale = pCaption->GetFitToSize() != SdrFitToSizeType::NONE;
+                    mbAutoScale = pCaption->GetFitToSize() != drawing::TextFitToSizeType_NONE;
                     mbLocked    = pCaption->IsMoveProtect() || pCaption->IsResizeProtect();
 
                     // AutoFill style would change if Postit.cxx object creation values are changed
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index d2dcd481d1c6..1641c47bbef7 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -251,7 +251,7 @@ void SdStyleSheetPool::CreateLayoutStyleSheets(const OUString& rLayoutName, bool
                 rSet.Put( SvxBackgroundColorItem( Color (COL_AUTO), EE_CHAR_BKGCOLOR )  );
                 rSet.Put( XLineStyleItem(css::drawing::LineStyle_NONE) );
                 rSet.Put( XFillStyleItem(drawing::FillStyle_NONE) );
-                rSet.Put( SdrTextFitToSizeTypeItem(SdrFitToSizeType::Autofit) );
+                rSet.Put( SdrTextFitToSizeTypeItem(drawing::TextFitToSizeType_AUTOFIT) );
                 rSet.Put( makeSdrTextAutoGrowHeightItem(false) );
                 // #i16874# enable kerning by default but only for new documents
                 rSet.Put( SvxAutoKernItem( true, EE_CHAR_PAIRKERNING ) );
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index d6db3f7bb22d..f1cfa51a3d58 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -532,7 +532,7 @@ void FuText::ImpSetAttributesFitToSize(SdrTextObj* pTxtObj)
 {
     // FitToSize (fit to frame)
     SfxItemSet aSet(mpViewShell->GetPool(), svl::Items<SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH>{});
-    aSet.Put(SdrTextFitToSizeTypeItem(SdrFitToSizeType::Proportional));
+    aSet.Put(SdrTextFitToSizeTypeItem(drawing::TextFitToSizeType_PROPORTIONAL));
     aSet.Put(makeSdrTextAutoGrowHeightItem(false));
     aSet.Put(makeSdrTextAutoGrowWidthItem(false));
     pTxtObj->SetMergedItemSet(aSet);
@@ -543,7 +543,7 @@ void FuText::ImpSetAttributesFitToSizeVertical(SdrTextObj* pTxtObj)
 {
     SfxItemSet aSet(mpViewShell->GetPool(),
         svl::Items<SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH>{});
-    aSet.Put(SdrTextFitToSizeTypeItem(SdrFitToSizeType::Proportional));
+    aSet.Put(SdrTextFitToSizeTypeItem(drawing::TextFitToSizeType_PROPORTIONAL));
     aSet.Put(makeSdrTextAutoGrowHeightItem(false));
     aSet.Put(makeSdrTextAutoGrowWidthItem(false));
     pTxtObj->SetMergedItemSet(aSet);
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 34091ac6af99..e2687ae1c20a 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -214,7 +214,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
                 mpDrawView->BegUndo();
 
                 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-                bool bSet = pObj->GetMergedItemSet().GetItem<SdrTextFitToSizeTypeItem>(SDRATTR_TEXT_FITTOSIZE)->GetValue() != SdrFitToSizeType::NONE;
+                bool bSet = pObj->GetMergedItemSet().GetItem<SdrTextFitToSizeTypeItem>(SDRATTR_TEXT_FITTOSIZE)->GetValue() != drawing::TextFitToSizeType_NONE;
 
                 mpDrawView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
 
@@ -227,7 +227,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
                         pObj->SetMergedItem(makeSdrTextAutoGrowWidthItem(false));
                 }
 
-                pObj->SetMergedItem(SdrTextFitToSizeTypeItem(bSet ? SdrFitToSizeType::NONE : SdrFitToSizeType::Autofit));
+                pObj->SetMergedItem(SdrTextFitToSizeTypeItem(bSet ? drawing::TextFitToSizeType_NONE : drawing::TextFitToSizeType_AUTOFIT));
 
                 mpDrawView->EndUndo();
                 pUndoManager->LeaveListAction();
diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx
index c6a82ef919b2..47521488bfbd 100644
--- a/sd/source/ui/view/drviewsj.cxx
+++ b/sd/source/ui/view/drviewsj.cxx
@@ -262,7 +262,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
         if( SfxItemState::DEFAULT == rSet.GetItemState( SID_OUTLINE_TEXT_AUTOFIT ) )
         {
             const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-            const bool bSet = pObj->GetMergedItemSet().GetItem<SdrTextFitToSizeTypeItem>(SDRATTR_TEXT_FITTOSIZE)->GetValue() != SdrFitToSizeType::NONE;
+            const bool bSet = pObj->GetMergedItemSet().GetItem<SdrTextFitToSizeTypeItem>(SDRATTR_TEXT_FITTOSIZE)->GetValue() != drawing::TextFitToSizeType_NONE;
             rSet.Put(SfxBoolItem(SID_OUTLINE_TEXT_AUTOFIT, bSet));
         }
 
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 0aca12a4667f..486dd9aff0a7 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -416,7 +416,7 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F
 void GetFontWorkOutline( FWData& rFWData, const SdrObject* pCustomShape )
 {
     SdrTextHorzAdjust eHorzAdjust( static_cast<const SdrTextHorzAdjustItem&>(pCustomShape->GetMergedItem( SDRATTR_TEXT_HORZADJUST )).GetValue() );
-    SdrFitToSizeType  eFTS( static_cast<const SdrTextFitToSizeTypeItem&>(pCustomShape->GetMergedItem( SDRATTR_TEXT_FITTOSIZE )).GetValue() );
+    drawing::TextFitToSizeType const eFTS( static_cast<const SdrTextFitToSizeTypeItem&>(pCustomShape->GetMergedItem( SDRATTR_TEXT_FITTOSIZE )).GetValue() );
 
     std::vector< FWTextArea >::iterator aTextAreaIter = rFWData.vTextAreas.begin();
     std::vector< FWTextArea >::const_iterator aTextAreaIEnd = rFWData.vTextAreas.end();
@@ -433,7 +433,7 @@ void GetFontWorkOutline( FWData& rFWData, const SdrObject* pCustomShape )
     while ( aTextAreaIter != aTextAreaIEnd )
     {
         GetTextAreaOutline( rFWData, pCustomShape, *aTextAreaIter, bSameLetterHeights );
-        if ( eFTS == SdrFitToSizeType::AllLines )
+        if (eFTS == drawing::TextFitToSizeType_ALLLINES)
         {
             std::vector< FWParagraphData >::iterator aParagraphIter( aTextAreaIter->vParagraphs.begin() );
             std::vector< FWParagraphData >::const_iterator aParagraphIEnd( aTextAreaIter->vParagraphs.end() );
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 0a6d5a791472..583df3f853de 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -960,11 +960,11 @@ bool SdrTextFitToSizeTypeItem::GetPresentation(SfxItemPresentation ePres,
 
 bool SdrTextFitToSizeTypeItem::HasBoolValue() const { return true; }
 
-bool SdrTextFitToSizeTypeItem::GetBoolValue() const { return GetValue()!=SdrFitToSizeType::NONE; }
+bool SdrTextFitToSizeTypeItem::GetBoolValue() const { return GetValue() != drawing::TextFitToSizeType_NONE; }
 
 void SdrTextFitToSizeTypeItem::SetBoolValue(bool bVal)
 {
-    SetValue(bVal ? SdrFitToSizeType::Proportional : SdrFitToSizeType::NONE);
+    SetValue((bVal) ? drawing::TextFitToSizeType_PROPORTIONAL : drawing::TextFitToSizeType_NONE);
 }
 
 bool SdrTextFitToSizeTypeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
@@ -987,7 +987,7 @@ bool SdrTextFitToSizeTypeItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemb
         eFS = (drawing::TextFitToSizeType) nEnum;
     }
 
-    SetValue( (SdrFitToSizeType)eFS );
+    SetValue(eFS);
 
     return true;
 }
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 11d01ed01c3d..60fe1ed4c867 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -1001,7 +1001,7 @@ void ImpSdrGDIMetaFileImport::ImportText( const Point& rPos, const OUString& rSt
         pText->ClearMergedItem( SDRATTR_TEXT_AUTOGROWWIDTH );
         pText->SetMergedItem( makeSdrTextAutoGrowHeightItem( false ) );
         // don't let the margins eat the space needed for the text
-        pText->SetMergedItem( SdrTextFitToSizeTypeItem( SdrFitToSizeType::AllLines ) );
+        pText->SetMergedItem( SdrTextFitToSizeTypeItem(drawing::TextFitToSizeType_ALLLINES) );
     }
     else
     {
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index 5fdc614b7a10..cf739d14adca 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -776,8 +776,9 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI
         case SDRATTR_TEXT_VERTADJUST:
         case SDRATTR_TEXT_HORZADJUST: {
             if (ImpGetItem(*pSet,SDRATTR_TEXT_FITTOSIZE,pItem)) {
-                SdrFitToSizeType eFit=static_cast<const SdrTextFitToSizeTypeItem*>(pItem)->GetValue();
-                if (eFit!=SdrFitToSizeType::NONE) return true;
+                drawing::TextFitToSizeType const eFit =
+                    static_cast<const SdrTextFitToSizeTypeItem*>(pItem)->GetValue();
+                if (eFit != drawing::TextFitToSizeType_NONE) { return true; }
             }
         } break;
 
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 5d05b813d21c..0664ccb84a61 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1466,9 +1466,9 @@ void SdrTextObj::RestGeoData(const SdrObjGeoData& rGeo)
     SetTextSizeDirty();
 }
 
-SdrFitToSizeType SdrTextObj::GetFitToSize() const
+drawing::TextFitToSizeType SdrTextObj::GetFitToSize() const
 {
-    SdrFitToSizeType eType = SdrFitToSizeType::NONE;
+    drawing::TextFitToSizeType eType = drawing::TextFitToSizeType_NONE;
 
     if(!IsAutoGrowWidth())
         eType = static_cast<const SdrTextFitToSizeTypeItem&>(GetObjectItem(SDRATTR_TEXT_FITTOSIZE)).GetValue();
@@ -1898,13 +1898,14 @@ GDIMetaFile* SdrTextObj::GetTextScrollMetaFileAndRectangle(
 // Access to TextAnimationAllowed flag
 bool SdrTextObj::IsAutoFit() const
 {
-    return GetFitToSize()==SdrFitToSizeType::Autofit;
+    return GetFitToSize() == drawing::TextFitToSizeType_AUTOFIT;
 }
 
 bool SdrTextObj::IsFitToSize() const
 {
-    const SdrFitToSizeType eFit=GetFitToSize();
-    return (eFit==SdrFitToSizeType::Proportional || eFit==SdrFitToSizeType::AllLines);
+    const drawing::TextFitToSizeType eFit = GetFitToSize();
+    return (eFit == drawing::TextFitToSizeType_PROPORTIONAL
+         || eFit == drawing::TextFitToSizeType_ALLLINES);
 }
 
 void SdrTextObj::SetTextAnimationAllowed(bool bNew)
diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx
index 0522b5d927da..71a2c5653a92 100644
--- a/svx/source/toolbars/fontworkbar.cxx
+++ b/svx/source/toolbars/fontworkbar.cxx
@@ -73,9 +73,9 @@ void SetAlignmentState( SdrView const * pSdrView, SfxItemSet& rSet )
                 case SDRTEXTHORZADJUST_RIGHT  : nAlignment = 2; break;
                 case SDRTEXTHORZADJUST_BLOCK  :
                 {
-                    if ( rTextFitToSizeTypeItem.GetValue() == SdrFitToSizeType::NONE )
+                    if (rTextFitToSizeTypeItem.GetValue() == drawing::TextFitToSizeType_NONE)
                         nAlignment = 3;
-                    else if ( rTextFitToSizeTypeItem.GetValue() == SdrFitToSizeType::AllLines )
+                    else if (rTextFitToSizeTypeItem.GetValue() == drawing::TextFitToSizeType_ALLLINES)
                         nAlignment = 4;
                 }
             }
@@ -271,11 +271,11 @@ static void impl_execute( SfxRequest const & rReq, SdrCustomShapeGeometryItem& r
                 sal_Int32 nValue = rReq.GetArgs()->GetItem<SfxInt32Item>(SID_FONTWORK_ALIGNMENT)->GetValue();
                 if ( ( nValue >= 0 ) && ( nValue < 5 ) )
                 {
-                    SdrFitToSizeType eFTS = SdrFitToSizeType::NONE;
+                    drawing::TextFitToSizeType eFTS = drawing::TextFitToSizeType_NONE;
                     SdrTextHorzAdjust eHorzAdjust;
                     switch ( nValue )
                     {
-                        case 4 : eFTS = SdrFitToSizeType::AllLines; SAL_FALLTHROUGH;
+                        case 4 : eFTS = drawing::TextFitToSizeType_ALLLINES; SAL_FALLTHROUGH;
                         case 3 : eHorzAdjust = SDRTEXTHORZADJUST_BLOCK; break;
                         default: eHorzAdjust = SDRTEXTHORZADJUST_LEFT; break;
                         case 1 : eHorzAdjust = SDRTEXTHORZADJUST_CENTER; break;
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 440bd1bec4ba..a9537a13039c 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1223,7 +1223,7 @@ SdrObject* SwWW8ImplReader::ReadTextBox(WW8_DPHEAD const * pHd, SfxAllItemSet &r
     SetStdAttr( rSet, aTextB.aLnt, aTextB.aShd );
     SetFill( rSet, aTextB.aFill );
 
-    rSet.Put( SdrTextFitToSizeTypeItem( SdrFitToSizeType::NONE ) );
+    rSet.Put( SdrTextFitToSizeTypeItem( drawing::TextFitToSizeType_NONE ) );
     rSet.Put( makeSdrTextAutoGrowWidthItem(false));
     rSet.Put( makeSdrTextAutoGrowHeightItem(false));
     rSet.Put( makeSdrTextLeftDistItem(  MIN_BORDER_DIST*2 ) );
@@ -2778,7 +2778,7 @@ SwFrameFormat* SwWW8ImplReader::MungeTextIntoDrawBox(SdrObject* pTrueObject,
         SfxItemSet aSet(m_pDrawModel->GetItemPool());
         aSet.Put(XFillStyleItem(drawing::FillStyle_NONE));
         aSet.Put(XLineStyleItem(drawing::LineStyle_NONE));
-        aSet.Put(SdrTextFitToSizeTypeItem( SdrFitToSizeType::NONE ));
+        aSet.Put(SdrTextFitToSizeTypeItem( drawing::TextFitToSizeType_NONE ));
         aSet.Put(makeSdrTextAutoGrowHeightItem(false));
         aSet.Put(makeSdrTextAutoGrowWidthItem(false));
         pSdrTextObj->SetMergedItemSet(aSet);
commit 8304de4701eca8a41f0dd70c84e437707cbb43cf
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Oct 17 22:44:26 2017 +0200

    offapi: clarify documentation of TextFitToSizeType
    
    Change-Id: Iae2ee1e77d9cdc0b98241c47e009d37a9e72e000

diff --git a/offapi/com/sun/star/drawing/TextFitToSizeType.idl b/offapi/com/sun/star/drawing/TextFitToSizeType.idl
index 3e285f74cf06..e70a63c9ae82 100644
--- a/offapi/com/sun/star/drawing/TextFitToSizeType.idl
+++ b/offapi/com/sun/star/drawing/TextFitToSizeType.idl
@@ -28,25 +28,25 @@
  */
 published enum TextFitToSizeType
 {
-    /** the text size is only defined by the font properties
+    /** The text size is only defined by the font properties.
     */
     NONE,
 
-
-    /** if the shape is scaled, the text character size is scaled proportional
+    /** The font is scaled up or down proportionally to fit the
+        size of the shape.  This may scale anisotropically.
+        No AutoGrow and no Auto line-breaks in this case.
     */
     PROPORTIONAL,
 
-
-    /** like <code>PROPORTIONAL</code>, but the width of each text row is
-        also scaled proportional.
+    /** Like <code>PROPORTIONAL</code>, but each line of text
+        is separately scaled proportionally to fit the width.
+        No AutoGrow and no Auto line-breaks in this case.
     */
     ALLLINES,
 
-
-    /** if the shape is scaled, the font is scaled isotropically to
-        fit the available space. Auto line-breaks will keep working
-   */
+    /** The font is scaled down (never up!) isotropically to fit the
+        available space.  Auto line-breaks will keep working.
+    */
     AUTOFIT
 
 };


More information about the Libreoffice-commits mailing list