cui/source/tabpages/measure.cxx                 |    6 +++---
 include/svx/sxmsuitm.hxx                        |    9 +++------
 sd/source/core/drawdoc4.cxx                     |    2 +-
 svx/source/sdr/properties/measureproperties.cxx |    2 +-
 svx/source/svdraw/svdattr.cxx                   |    2 +-
 svx/source/svdraw/svdomeas.cxx                  |    4 ++--
 6 files changed, 11 insertions(+), 14 deletions(-)

New commits:
commit 5ecec388bb117426661c4e5f65cb84aeb245064c
Author: Stephan Bergmann <sberg...@redhat.com>
Date:   Thu Aug 7 11:27:26 2014 +0200

    Consistency around SdrYesNoItem in svx/sxmsuitm.hxx
    
    ...similar to what has been done for svx/sdtmfitm.hxx in
    6a2ea81ca1622d2c2ad55bea8ddc28167fcc2794 "Remove unused ctors" and
    68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem."
    
    Change-Id: I25002e5b6043baa8c93b180a03f475bea5906e4f

diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx
index bf93704..f5d2749 100644
--- a/cui/source/tabpages/measure.cxx
+++ b/cui/source/tabpages/measure.cxx
@@ -292,7 +292,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
     // SdrMeasureShowUnitItem
     if( rAttrs->GetItemState( SDRATTR_MEASURESHOWUNIT ) != SFX_ITEM_DONTCARE )
     {
-        m_pTsbShowUnit->SetState( ( ( const SdrMeasureShowUnitItem& 
)rAttrs->Get( SDRATTR_MEASURESHOWUNIT ) ).
+        m_pTsbShowUnit->SetState( ( ( const SdrYesNoItem& )rAttrs->Get( 
SDRATTR_MEASURESHOWUNIT ) ).
                         GetValue() ? TRISTATE_TRUE : TRISTATE_FALSE );
         m_pTsbShowUnit->EnableTriState( false );
     }
@@ -486,7 +486,7 @@ bool SvxMeasurePage::FillItemSet( SfxItemSet* rAttrs)
     eState = m_pTsbShowUnit->GetState();
     if( m_pTsbShowUnit->IsValueChangedFromSaved() )
     {
-        rAttrs->Put( SdrMeasureShowUnitItem( TRISTATE_TRUE == eState ) );
+        rAttrs->Put( makeSdrMeasureShowUnitItem( TRISTATE_TRUE == eState ) );
         bModified = true;
     }
 
@@ -717,7 +717,7 @@ IMPL_LINK( SvxMeasurePage, ChangeAttrHdl_Impl, void *, p )
     {
         TriState eState = m_pTsbShowUnit->GetState();
         if( eState != TRISTATE_INDET )
-            aAttrSet.Put( SdrMeasureShowUnitItem( TRISTATE_TRUE == eState ) );
+            aAttrSet.Put( makeSdrMeasureShowUnitItem( TRISTATE_TRUE == eState 
) );
     }
 
     if( p == m_pLbUnit )
diff --git a/include/svx/sxmsuitm.hxx b/include/svx/sxmsuitm.hxx
index c16a51f..9238913 100644
--- a/include/svx/sxmsuitm.hxx
+++ b/include/svx/sxmsuitm.hxx
@@ -22,12 +22,9 @@
 #include <svx/svddef.hxx>
 #include <svx/sdynitm.hxx>
 
-// Include the unit of measure when displaying
-class SdrMeasureShowUnitItem: public SdrYesNoItem {
-public:
-    SdrMeasureShowUnitItem(bool bOn=false): 
SdrYesNoItem(SDRATTR_MEASURESHOWUNIT,bOn) {}
-    SdrMeasureShowUnitItem(SvStream& rIn): 
SdrYesNoItem(SDRATTR_MEASURESHOWUNIT,rIn) {}
-};
+inline SdrYesNoItem makeSdrMeasureShowUnitItem(bool bOn) {
+    return SdrYesNoItem(SDRATTR_MEASURESHOWUNIT, bOn);
+}
 
 #endif
 
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index f4ba67f..fbaf8919 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -488,7 +488,7 @@ void SdDrawDocument::CreateLayoutTemplates()
     
pISet->Put(XLineEndItem(SVX_RESSTR(RID_SVXSTR_ARROW),::basegfx::B2DPolyPolygon(aArrow)));
     pISet->Put(XLineEndWidthItem(200));
     pISet->Put(XLineStyleItem(XLINE_SOLID));
-    pISet->Put(SdrMeasureShowUnitItem(true));
+    pISet->Put(makeSdrMeasureShowUnitItem(true));
 
     // Generate presentation templates for default layout.
     OUString aPrefix = SD_RESSTR(STR_LAYOUT_DEFAULT_NAME);
diff --git a/svx/source/sdr/properties/measureproperties.cxx 
b/svx/source/sdr/properties/measureproperties.cxx
index d124045..033464b2 100644
--- a/svx/source/sdr/properties/measureproperties.cxx
+++ b/svx/source/sdr/properties/measureproperties.cxx
@@ -109,7 +109,7 @@ namespace sdr
             //#71958# by default, the show units Bool-Item is set as hard
             // attribute to sal_True to aviod confusion when copying 
SdrMeasureObj's
             // from one application to another
-            mpItemSet->Put(SdrMeasureShowUnitItem(true));
+            mpItemSet->Put(makeSdrMeasureShowUnitItem(true));
 
             basegfx::B2DPolygon aNewPolygon;
             aNewPolygon.append(basegfx::B2DPoint(100.0, 0.0));
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index bf296e0..188668a 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -197,7 +197,7 @@ SdrItemPool::SdrItemPool(
     mppLocalPoolDefaults[SDRATTR_MEASUREOVERHANG         -SDRATTR_START]=new 
SdrMeasureOverhangItem(600);
     mppLocalPoolDefaults[SDRATTR_MEASUREUNIT             -SDRATTR_START]=new 
SdrMeasureUnitItem;
     mppLocalPoolDefaults[SDRATTR_MEASURESCALE            -SDRATTR_START]=new 
SdrMeasureScaleItem;
-    mppLocalPoolDefaults[SDRATTR_MEASURESHOWUNIT         -SDRATTR_START]=new 
SdrMeasureShowUnitItem;
+    mppLocalPoolDefaults[SDRATTR_MEASURESHOWUNIT         -SDRATTR_START]=new 
SdrYesNoItem(SDRATTR_MEASURESHOWUNIT, false);
     mppLocalPoolDefaults[SDRATTR_MEASUREFORMATSTRING     -SDRATTR_START]=new 
SdrMeasureFormatStringItem();
     mppLocalPoolDefaults[SDRATTR_MEASURETEXTAUTOANGLE    -SDRATTR_START]=new 
SdrMeasureTextAutoAngleItem();
     mppLocalPoolDefaults[SDRATTR_MEASURETEXTAUTOANGLEVIEW-SDRATTR_START]=new 
SdrMeasureTextAutoAngleViewItem();
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index f8b3f62..3ca3b1b 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -90,7 +90,7 @@ OUString 
SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind
     bTextRota90 = 
((SdrMeasureTextRota90Item&)rSet.Get(SDRATTR_MEASURETEXTROTA90)).GetValue();
     eMeasureUnit = 
((SdrMeasureUnitItem&)rSet.Get(SDRATTR_MEASUREUNIT)).GetValue();
     aMeasureScale = 
((SdrMeasureScaleItem&)rSet.Get(SDRATTR_MEASURESCALE)).GetValue();
-    bShowUnit = 
((SdrMeasureShowUnitItem&)rSet.Get(SDRATTR_MEASURESHOWUNIT)).GetValue();
+    bShowUnit = ((SdrYesNoItem&)rSet.Get(SDRATTR_MEASURESHOWUNIT)).GetValue();
     sal_Int16 nNumDigits = 
((SdrMeasureDecimalPlacesItem&)rSet.Get(SDRATTR_MEASUREDECIMALPLACES)).GetValue();
 
     switch(eMeasureFieldKind)
@@ -349,7 +349,7 @@ void SdrMeasureObj::ImpTakeAttr(ImpMeasureRec& rRec) const
     rRec.nMeasureOverhang =((SdrMeasureOverhangItem&        
)rSet.Get(SDRATTR_MEASUREOVERHANG        )).GetValue();
     rRec.eMeasureUnit     =((SdrMeasureUnitItem&            
)rSet.Get(SDRATTR_MEASUREUNIT            )).GetValue();
     rRec.aMeasureScale    =((SdrMeasureScaleItem&           
)rSet.Get(SDRATTR_MEASURESCALE           )).GetValue();
-    rRec.bShowUnit        =((SdrMeasureShowUnitItem&        
)rSet.Get(SDRATTR_MEASURESHOWUNIT        )).GetValue();
+    rRec.bShowUnit        =((SdrYesNoItem&        
)rSet.Get(SDRATTR_MEASURESHOWUNIT        )).GetValue();
     rRec.aFormatString    =((SdrMeasureFormatStringItem&    
)rSet.Get(SDRATTR_MEASUREFORMATSTRING    )).GetValue();
     rRec.bTextAutoAngle    =((SdrMeasureTextAutoAngleItem&    
)rSet.Get(SDRATTR_MEASURETEXTAUTOANGLE    )).GetValue();
     
rRec.nTextAutoAngleView=((SdrMeasureTextAutoAngleViewItem&)rSet.Get(SDRATTR_MEASURETEXTAUTOANGLEVIEW)).GetValue();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to