[Libreoffice-commits] core.git: cui/source filter/source include/svx sc/source sd/qa svx/source
Stephan Bergmann
sbergman at redhat.com
Wed Aug 6 01:21:26 PDT 2014
cui/source/tabpages/textattr.cxx | 4 +-
filter/source/msfilter/msdffimp.cxx | 2 -
filter/source/msfilter/svdfppt.cxx | 2 -
include/svx/sdasitm.hxx | 22 +++-----------
sc/source/filter/excel/xiescher.cxx | 2 -
sd/qa/unit/export-tests.cxx | 6 +--
svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx | 2 -
svx/source/svdraw/svdattr.cxx | 4 +-
svx/source/svdraw/svdmodel.cxx | 2 -
svx/source/svdraw/svdoashp.cxx | 8 ++---
10 files changed, 22 insertions(+), 32 deletions(-)
New commits:
commit 43856800f0345a209f4c8f64ac1eb2cb2e114a42
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Aug 6 10:20:26 2014 +0200
Consistency around SdrOnOffItem in svx/sdasitm.hxx
...similar to what has been done for svx/sdtmfitm.hxx in
6a2ea81ca1622d2c2ad55bea8ddc28167fcc2794 "Remove unused ctors" and
68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem."
Change-Id: Icdeff7f37901f99158bb00de5e912c181bf3e688
diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx
index 40958b9..8145328 100644
--- a/cui/source/tabpages/textattr.cxx
+++ b/cui/source/tabpages/textattr.cxx
@@ -203,7 +203,7 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
// wordwrap text
if ( rAttrs->GetItemState( SDRATTR_TEXT_WORDWRAP ) != SFX_ITEM_DONTCARE )
{
- m_pTsbWordWrapText->SetState( ( ( const SdrTextWordWrapItem& )rAttrs->Get( SDRATTR_TEXT_WORDWRAP ) ).
+ m_pTsbWordWrapText->SetState( ( ( const SdrOnOffItem& )rAttrs->Get( SDRATTR_TEXT_WORDWRAP ) ).
GetValue() ? TRISTATE_TRUE : TRISTATE_FALSE );
m_pTsbWordWrapText->EnableTriState( false );
}
@@ -376,7 +376,7 @@ bool SvxTextAttrPage::FillItemSet( SfxItemSet* rAttrs)
eState = m_pTsbWordWrapText->GetState();
if( m_pTsbWordWrapText->IsValueChangedFromSaved() )
{
- rAttrs->Put( SdrTextWordWrapItem( TRISTATE_TRUE == eState ) );
+ rAttrs->Put( makeSdrTextWordWrapItem( TRISTATE_TRUE == eState ) );
}
eState = m_pTsbContour->GetState();
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index f3105e7..867c8e2 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -1501,7 +1501,7 @@ void DffPropertyReader::ApplyCustomShapeTextAttributes( SfxItemSet& rSet ) const
rSet.Put( makeSdrTextUpperDistItem( nTextTop ) );
rSet.Put( makeSdrTextLowerDistItem( nTextBottom ) );
- rSet.Put( SdrTextWordWrapItem( (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone ? sal_True : sal_False ) );
+ rSet.Put( makeSdrTextWordWrapItem( (MSO_WrapMode)GetPropertyValue( DFF_Prop_WrapText, mso_wrapSquare ) != mso_wrapNone ? sal_True : sal_False ) );
rSet.Put( makeSdrTextAutoGrowHeightItem( ( GetPropertyValue( DFF_Prop_FitTextToShape ) & 2 ) != 0 ) );
}
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 8698fb6..90d3b46 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -1078,7 +1078,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
}
else
{
- pTObj->SetMergedItem( SdrTextWordWrapItem( bWordWrap ) );
+ pTObj->SetMergedItem( makeSdrTextWordWrapItem( bWordWrap ) );
pTObj->SetMergedItem( makeSdrTextAutoGrowHeightItem( bFitShapeToText ) );
}
diff --git a/include/svx/sdasitm.hxx b/include/svx/sdasitm.hxx
index 2144b86..33ebab8 100644
--- a/include/svx/sdasitm.hxx
+++ b/include/svx/sdasitm.hxx
@@ -109,23 +109,13 @@ class SdrCustomShapeReplacementURLItem : public SfxStringItem
SdrCustomShapeReplacementURLItem();
};
+inline SdrOnOffItem makeSdrTextWordWrapItem( bool bAuto ) {
+ return SdrOnOffItem( SDRATTR_TEXT_WORDWRAP, bAuto );
+}
-// class SdrTextWordWrapItem
-
-class SdrTextWordWrapItem : public SdrOnOffItem {
-public:
- SdrTextWordWrapItem( bool bAuto = false ): SdrOnOffItem( SDRATTR_TEXT_WORDWRAP, bAuto ) {}
- SdrTextWordWrapItem( SvStream& rIn ) : SdrOnOffItem( SDRATTR_TEXT_WORDWRAP, rIn ) {}
-};
-
-
-// class SdrTextAutoGrowSizeItem
-
-class SdrTextAutoGrowSizeItem : public SdrOnOffItem {
-public:
- SdrTextAutoGrowSizeItem( bool bAuto = false ): SdrOnOffItem( SDRATTR_TEXT_AUTOGROWSIZE, bAuto ) {}
- SdrTextAutoGrowSizeItem( SvStream& rIn ) : SdrOnOffItem( SDRATTR_TEXT_AUTOGROWSIZE, rIn ) {}
-};
+inline SdrOnOffItem makeSdrTextAutoGrowSizeItem( bool bAuto ) {
+ return SdrOnOffItem( SDRATTR_TEXT_AUTOGROWSIZE, bAuto ) ;
+}
// some useful inline methods
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 1791ef3..a8569d5 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -1438,7 +1438,7 @@ SdrObject* XclImpTextObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Re
bool bAutoSize = ::get_flag( maTextData.maData.mnFlags, EXC_OBJ_TEXT_AUTOSIZE );
xSdrObj->SetMergedItem( makeSdrTextAutoGrowWidthItem( bAutoSize ) );
xSdrObj->SetMergedItem( makeSdrTextAutoGrowHeightItem( bAutoSize ) );
- xSdrObj->SetMergedItem( SdrTextWordWrapItem( true ) );
+ xSdrObj->SetMergedItem( makeSdrTextWordWrapItem( true ) );
rDffConv.Progress();
return xSdrObj.release();
}
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 0492710..fa29403 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -323,17 +323,17 @@ void SdFiltersTest::testFdo71961()
SdrObjCustomShape *pTxtObj = dynamic_cast<SdrObjCustomShape *>( pPage->GetObj( 1 ));
CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != NULL);
CPPUNIT_ASSERT_EQUAL( OUString( "Text to be always wrapped" ), pTxtObj->GetOutlinerParaObject()->GetTextObject().GetText(0));
- CPPUNIT_ASSERT_EQUAL( true, (static_cast<const SdrTextWordWrapItem&>(pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue());
+ CPPUNIT_ASSERT_EQUAL( true, (static_cast<const SdrOnOffItem&>(pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue());
pTxtObj = dynamic_cast<SdrObjCustomShape *>( pPage->GetObj( 2 ));
CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != NULL);
CPPUNIT_ASSERT_EQUAL( OUString( "Custom shape non-wrapped text" ), pTxtObj->GetOutlinerParaObject()->GetTextObject().GetText(0));
- CPPUNIT_ASSERT_EQUAL( false, (static_cast<const SdrTextWordWrapItem&>(pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue());
+ CPPUNIT_ASSERT_EQUAL( false, (static_cast<const SdrOnOffItem&>(pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue());
pTxtObj = dynamic_cast<SdrObjCustomShape *>( pPage->GetObj( 3 ));
CPPUNIT_ASSERT_MESSAGE( "no text object", pTxtObj != NULL);
CPPUNIT_ASSERT_EQUAL( OUString( "Custom shape wrapped text" ), pTxtObj->GetOutlinerParaObject()->GetTextObject().GetText(0));
- CPPUNIT_ASSERT_EQUAL( true, (static_cast<const SdrTextWordWrapItem&>(pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue());
+ CPPUNIT_ASSERT_EQUAL( true, (static_cast<const SdrOnOffItem&>(pTxtObj->GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue());
xDocShRef->DoClose();
}
diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
index 518d30a..88421e5 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
@@ -216,7 +216,7 @@ namespace sdr
}
// check if SdrTextWordWrapItem is set
- bWordWrap = ((SdrTextWordWrapItem&)(GetCustomShapeObj().GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue();
+ bWordWrap = ((SdrOnOffItem&)(GetCustomShapeObj().GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue();
}
// create primitive
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index df7399e..acb47d9 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -170,8 +170,8 @@ SdrItemPool::SdrItemPool(
mppLocalPoolDefaults[SDRATTR_CUSTOMSHAPE_ADJUSTMENT -SDRATTR_START]=new SdrCustomShapeAdjustmentItem;
mppLocalPoolDefaults[SDRATTR_XMLATTRIBUTES -SDRATTR_START]=new SvXMLAttrContainerItem( SDRATTR_XMLATTRIBUTES );
mppLocalPoolDefaults[SDRATTR_TEXT_USEFIXEDCELLHEIGHT -SDRATTR_START]=new SdrTextFixedCellHeightItem;
- mppLocalPoolDefaults[SDRATTR_TEXT_WORDWRAP -SDRATTR_START]=new SdrTextWordWrapItem( true );
- mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWSIZE -SDRATTR_START]=new SdrTextAutoGrowSizeItem;
+ mppLocalPoolDefaults[SDRATTR_TEXT_WORDWRAP -SDRATTR_START]=new SdrOnOffItem(SDRATTR_TEXT_WORDWRAP, true);
+ mppLocalPoolDefaults[SDRATTR_TEXT_AUTOGROWSIZE -SDRATTR_START]=new SdrOnOffItem(SDRATTR_TEXT_AUTOGROWSIZE, false);
mppLocalPoolDefaults[SDRATTR_EDGEKIND -SDRATTR_START]=new SdrEdgeKindItem;
mppLocalPoolDefaults[SDRATTR_EDGENODE1HORZDIST-SDRATTR_START]=new SdrEdgeNode1HorzDistItem(nDefEdgeDist);
mppLocalPoolDefaults[SDRATTR_EDGENODE1VERTDIST-SDRATTR_START]=new SdrEdgeNode1VertDistItem(nDefEdgeDist);
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 54596ab..71a5794 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -199,7 +199,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe
else
nDefTextHgt = SdrEngineDefaults::GetFontHeight();
- pItemPool->SetPoolDefaultItem( SdrTextWordWrapItem( false ) );
+ pItemPool->SetPoolDefaultItem( makeSdrTextWordWrapItem( false ) );
SetTextDefaults();
pLayerAdmin=new SdrLayerAdmin;
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index bb6304b..8c49061 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -2241,7 +2241,7 @@ bool SdrObjCustomShape::IsAutoGrowHeight() const
const SfxItemSet& rSet = GetMergedItemSet();
bool bIsAutoGrowHeight = ((SdrOnOffItem&)(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT))).GetValue();
if ( bIsAutoGrowHeight && IsVerticalWriting() )
- bIsAutoGrowHeight = !((SdrTextWordWrapItem&)(rSet.Get(SDRATTR_TEXT_WORDWRAP))).GetValue();
+ bIsAutoGrowHeight = !((SdrOnOffItem&)(rSet.Get(SDRATTR_TEXT_WORDWRAP))).GetValue();
return bIsAutoGrowHeight;
}
bool SdrObjCustomShape::IsAutoGrowWidth() const
@@ -2249,7 +2249,7 @@ bool SdrObjCustomShape::IsAutoGrowWidth() const
const SfxItemSet& rSet = GetMergedItemSet();
bool bIsAutoGrowWidth = ((SdrOnOffItem&)(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT))).GetValue();
if ( bIsAutoGrowWidth && !IsVerticalWriting() )
- bIsAutoGrowWidth = !((SdrTextWordWrapItem&)(rSet.Get(SDRATTR_TEXT_WORDWRAP))).GetValue();
+ bIsAutoGrowWidth = !((SdrOnOffItem&)(rSet.Get(SDRATTR_TEXT_WORDWRAP))).GetValue();
return bIsAutoGrowWidth;
}
@@ -2609,7 +2609,7 @@ void SdrObjCustomShape::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Recta
if ( nMaxHgt == 0 || nMaxHgt > aMaxSiz.Height() )
nMaxHgt=aMaxSiz.Height();
- if (((SdrTextWordWrapItem&)(GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue())
+ if (((SdrOnOffItem&)(GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue())
{
if ( IsVerticalWriting() )
{
@@ -2711,7 +2711,7 @@ void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRe
long nAnkWdt=aAnkRect.GetWidth();
long nAnkHgt=aAnkRect.GetHeight();
- if (((SdrTextWordWrapItem&)(GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue())
+ if (((SdrOnOffItem&)(GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue())
{
if ( IsVerticalWriting() )
nMaxAutoPaperHeight = nAnkHgt;
More information about the Libreoffice-commits
mailing list