[Libreoffice-commits] core.git: cui/source include/svx sd/source svx/source
Radu Ioan
ioan.radu.g at gmail.com
Fri Dec 12 12:22:45 PST 2014
cui/source/tabpages/tphatch.cxx | 8 ++++----
include/svx/xenum.hxx | 1 -
include/svx/xhatch.hxx | 12 ++++++------
sd/source/ui/view/drviews9.cxx | 6 +++---
svx/source/sdr/primitive2d/sdrattributecreator.cxx | 8 ++++----
svx/source/svdraw/svdfmtf.cxx | 8 ++++----
svx/source/unodraw/XPropertyTable.cxx | 2 +-
svx/source/xoutdev/xattr.cxx | 10 +++++-----
svx/source/xoutdev/xtabhtch.cxx | 12 ++++++------
9 files changed, 33 insertions(+), 34 deletions(-)
New commits:
commit 3c77eba67b61b4f78f2c8ccec6c78622ee173b61
Author: Radu Ioan <ioan.radu.g at gmail.com>
Date: Thu Dec 11 23:45:38 2014 +0200
fdo#85486 - Clean up unnecessary enumerations from xenum.hxx
Removed XHatchStyle
Change-Id: I89e7edadc4f408e5a50840aaa1a13965b8503afb
Reviewed-on: https://gerrit.libreoffice.org/13442
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index a08bcbf..2f988e4 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -299,7 +299,7 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet )
else
{
pXHatch.reset(new XHatch( m_pLbLineColor->GetSelectEntryColor(),
- (XHatchStyle) m_pLbLineType->GetSelectEntryPos(),
+ (css::drawing::HatchStyle) m_pLbLineType->GetSelectEntryPos(),
GetCoreValue( *m_pMtrDistance, ePoolUnit ),
static_cast<long>(m_pMtrAngle->GetValue() * 10) ));
}
@@ -366,7 +366,7 @@ IMPL_LINK( SvxHatchTabPage, ModifiedHdl_Impl, void *, p )
}
XHatch aXHatch( m_pLbLineColor->GetSelectEntryColor(),
- (XHatchStyle) m_pLbLineType->GetSelectEntryPos(),
+ (css::drawing::HatchStyle) m_pLbLineType->GetSelectEntryPos(),
GetCoreValue( *m_pMtrDistance, ePoolUnit ),
static_cast<long>(m_pMtrAngle->GetValue() * 10) );
@@ -513,7 +513,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl)
if( !nError )
{
XHatch aXHatch( m_pLbLineColor->GetSelectEntryColor(),
- (XHatchStyle) m_pLbLineType->GetSelectEntryPos(),
+ (css::drawing::HatchStyle) m_pLbLineType->GetSelectEntryPos(),
GetCoreValue( *m_pMtrDistance, ePoolUnit ),
static_cast<long>(m_pMtrAngle->GetValue() * 10) );
XHatchEntry* pEntry = new XHatchEntry( aXHatch, aName );
@@ -583,7 +583,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickModifyHdl_Impl)
{
bLoop = false;
XHatch aXHatch( m_pLbLineColor->GetSelectEntryColor(),
- (XHatchStyle) m_pLbLineType->GetSelectEntryPos(),
+ (css::drawing::HatchStyle) m_pLbLineType->GetSelectEntryPos(),
GetCoreValue( *m_pMtrDistance, ePoolUnit ),
static_cast<long>(m_pMtrAngle->GetValue() * 10) );
diff --git a/include/svx/xenum.hxx b/include/svx/xenum.hxx
index 52f7a4f..a849bc5 100644
--- a/include/svx/xenum.hxx
+++ b/include/svx/xenum.hxx
@@ -21,7 +21,6 @@
#define INCLUDED_SVX_XENUM_HXX
-enum XHatchStyle { XHATCH_SINGLE, XHATCH_DOUBLE, XHATCH_TRIPLE };
enum XFormTextStyle { XFT_ROTATE, XFT_UPRIGHT, XFT_SLANTX, XFT_SLANTY,
XFT_NONE };
enum XFormTextAdjust { XFT_LEFT, XFT_RIGHT, XFT_AUTOSIZE, XFT_CENTER };
diff --git a/include/svx/xhatch.hxx b/include/svx/xhatch.hxx
index 9dc725d..52010cd 100644
--- a/include/svx/xhatch.hxx
+++ b/include/svx/xhatch.hxx
@@ -20,9 +20,9 @@
#ifndef INCLUDED_SVX_XHATCH_HXX
#define INCLUDED_SVX_XHATCH_HXX
-#include <svx/xenum.hxx>
#include <tools/color.hxx>
#include <svx/svxdllapi.h>
+#include <com/sun/star/drawing/HatchStyle.hpp>
// class XHatch
@@ -31,24 +31,24 @@
class SVX_DLLPUBLIC XHatch
{
protected:
- XHatchStyle eStyle;
+ css::drawing::HatchStyle eStyle;
Color aColor;
long nDistance;
long nAngle;
public:
- XHatch() : eStyle(XHATCH_SINGLE), nDistance(0), nAngle(0) {}
- XHatch(const Color& rCol, XHatchStyle eStyle = XHATCH_SINGLE,
+ XHatch() : eStyle(css::drawing::HatchStyle_SINGLE), nDistance(0), nAngle(0) {}
+ XHatch(const Color& rCol, css::drawing::HatchStyle eStyle = css::drawing::HatchStyle_SINGLE,
long nDistance = 20, long nAngle = 0);
bool operator==(const XHatch& rHatch) const;
- void SetHatchStyle(XHatchStyle eNewStyle) { eStyle = eNewStyle; }
+ void SetHatchStyle(css::drawing::HatchStyle eNewStyle) { eStyle = eNewStyle; }
void SetColor(const Color& rColor) { aColor = rColor; }
void SetDistance(long nNewDistance) { nDistance = nNewDistance; }
void SetAngle(long nNewAngle) { nAngle = nNewAngle; }
- XHatchStyle GetHatchStyle() const { return eStyle; }
+ css::drawing::HatchStyle GetHatchStyle() const { return eStyle; }
Color GetColor() const { return aColor; }
long GetDistance() const { return nDistance; }
long GetAngle() const { return nAngle; }
diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx
index 084f13c..d224c32 100644
--- a/sd/source/ui/view/drviews9.cxx
+++ b/sd/source/ui/view/drviews9.cxx
@@ -567,7 +567,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
SFX_REQUEST_ARG (rReq, pDistance, SfxUInt32Item, ID_VAL_DISTANCE, false);
SFX_REQUEST_ARG (rReq, pAngle, SfxUInt32Item, ID_VAL_ANGLE, false);
- if (CHECK_RANGE (XHATCH_SINGLE, (sal_Int32)pStyle->GetValue (), XHATCH_TRIPLE) &&
+ if (CHECK_RANGE (css::drawing::HatchStyle_SINGLE, (sal_Int32)pStyle->GetValue (), css::drawing::HatchStyle_TRIPLE) &&
CHECK_RANGE (0, (sal_Int32)pAngle->GetValue (), 360))
{
pAttr->ClearItem (XATTR_FILLHATCH);
@@ -585,7 +585,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
{
XHatch aHatch(pEntry->GetHatch());
- aHatch.SetHatchStyle ((XHatchStyle) pStyle->GetValue ());
+ aHatch.SetHatchStyle ((css::drawing::HatchStyle) pStyle->GetValue ());
aHatch.SetDistance (pDistance->GetValue ());
aHatch.SetAngle (pAngle->GetValue () * 10);
@@ -598,7 +598,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
if (i >= nCounts)
{
Color aBlack (0, 0, 0);
- XHatch aHatch (aBlack, (XHatchStyle) pStyle->GetValue (), pDistance->GetValue (),
+ XHatch aHatch (aBlack, (css::drawing::HatchStyle) pStyle->GetValue (), pDistance->GetValue (),
pAngle->GetValue () * 10);
pHatchList->Insert (new XHatchEntry (aHatch, pName->GetValue ()));
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 94db008..5b657c3 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -113,21 +113,21 @@ namespace drawinglayer
}
}
- attribute::HatchStyle XHatchStyleToHatchStyle(XHatchStyle eStyle)
+ attribute::HatchStyle XHatchStyleToHatchStyle(css::drawing::HatchStyle eStyle)
{
switch(eStyle)
{
- case XHATCH_SINGLE :
+ case css::drawing::HatchStyle_SINGLE :
{
return attribute::HATCHSTYLE_SINGLE;
}
- case XHATCH_DOUBLE :
+ case css::drawing::HatchStyle_DOUBLE :
{
return attribute::HATCHSTYLE_DOUBLE;
}
default :
{
- return attribute::HATCHSTYLE_TRIPLE; // XHATCH_TRIPLE
+ return attribute::HATCHSTYLE_TRIPLE; // css::drawing::HatchStyle_TRIPLE
}
}
}
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 391364b..b0991ab 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -1139,25 +1139,25 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaHatchAction& rAct )
SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource);
// #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet
SfxItemSet aHatchAttr(mpModel->GetItemPool(), pPath->GetMergedItemSet().GetRanges());
- XHatchStyle eStyle;
+ css::drawing::HatchStyle eStyle;
switch(rHatch.GetStyle())
{
case(HATCH_TRIPLE) :
{
- eStyle = XHATCH_TRIPLE;
+ eStyle = css::drawing::HatchStyle_TRIPLE;
break;
}
case(HATCH_DOUBLE) :
{
- eStyle = XHATCH_DOUBLE;
+ eStyle = css::drawing::HatchStyle_DOUBLE;
break;
}
default:
{
- eStyle = XHATCH_SINGLE;
+ eStyle = css::drawing::HatchStyle_SINGLE;
break;
}
}
diff --git a/svx/source/unodraw/XPropertyTable.cxx b/svx/source/unodraw/XPropertyTable.cxx
index 60df2af..6697f7b 100644
--- a/svx/source/unodraw/XPropertyTable.cxx
+++ b/svx/source/unodraw/XPropertyTable.cxx
@@ -510,7 +510,7 @@ XPropertyEntry* SvxUnoXHatchTable::getEntry( const OUString& rName, const uno::A
return NULL;
XHatch aXHatch;
- aXHatch.SetHatchStyle( (XHatchStyle)aUnoHatch.Style );
+ aXHatch.SetHatchStyle( (css::drawing::HatchStyle)aUnoHatch.Style );
aXHatch.SetColor( aUnoHatch.Color );
aXHatch.SetDistance( aUnoHatch.Distance );
aXHatch.SetAngle( aUnoHatch.Angle );
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 87356be..06e44c4 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -2824,7 +2824,7 @@ XFillFloatTransparenceItem* XFillFloatTransparenceItem::checkForUniqueItem( SdrM
return NULL;
}
-XHatch::XHatch(const Color& rCol, XHatchStyle eTheStyle, long nTheDistance,
+XHatch::XHatch(const Color& rCol, css::drawing::HatchStyle eTheStyle, long nTheDistance,
long nTheAngle) :
eStyle(eTheStyle),
aColor(rCol),
@@ -2868,7 +2868,7 @@ XFillHatchItem::XFillHatchItem(SvStream& rIn) :
sal_Int16 nITemp;
sal_Int32 nLTemp;
- rIn.ReadInt16( nITemp ); aHatch.SetHatchStyle((XHatchStyle)nITemp);
+ rIn.ReadInt16( nITemp ); aHatch.SetHatchStyle((css::drawing::HatchStyle)nITemp);
rIn.ReadUInt16( nRed );
rIn.ReadUInt16( nGreen );
rIn.ReadUInt16( nBlue );
@@ -3036,7 +3036,7 @@ bool XFillHatchItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8
SetName( aName );
if ( bHatch )
{
- aHatch.SetHatchStyle( (XHatchStyle)aUnoHatch.Style );
+ aHatch.SetHatchStyle( (css::drawing::HatchStyle)aUnoHatch.Style );
aHatch.SetColor( aUnoHatch.Color );
aHatch.SetDistance( aUnoHatch.Distance );
aHatch.SetAngle( aUnoHatch.Angle );
@@ -3054,7 +3054,7 @@ bool XFillHatchItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8
if(!(rVal >>= aUnoHatch))
return false;
- aHatch.SetHatchStyle( (XHatchStyle)aUnoHatch.Style );
+ aHatch.SetHatchStyle( (css::drawing::HatchStyle)aUnoHatch.Style );
aHatch.SetColor( aUnoHatch.Color );
aHatch.SetDistance( aUnoHatch.Distance );
aHatch.SetAngle( aUnoHatch.Angle );
@@ -3075,7 +3075,7 @@ bool XFillHatchItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8
sal_Int16 nVal = sal_Int16();
if (!(rVal >>= nVal ))
return false;
- aHatch.SetHatchStyle( (XHatchStyle)nVal );
+ aHatch.SetHatchStyle( (css::drawing::HatchStyle)nVal );
break;
}
diff --git a/svx/source/xoutdev/xtabhtch.cxx b/svx/source/xoutdev/xtabhtch.cxx
index 2f59801..ba73c5c 100644
--- a/svx/source/xoutdev/xtabhtch.cxx
+++ b/svx/source/xoutdev/xtabhtch.cxx
@@ -71,11 +71,11 @@ bool XHatchList::Create()
aStr.append(" 1");
sal_Int32 nLen = aStr.getLength() - 1;
- Insert(new XHatchEntry(XHatch(RGB_Color(COL_BLACK),XHATCH_SINGLE,100, 0),aStr.toString()));
+ Insert(new XHatchEntry(XHatch(RGB_Color(COL_BLACK),css::drawing::HatchStyle_SINGLE,100, 0),aStr.toString()));
aStr[nLen] = '2';
- Insert(new XHatchEntry(XHatch(RGB_Color(COL_RED ),XHATCH_DOUBLE, 80,450),aStr.toString()));
+ Insert(new XHatchEntry(XHatch(RGB_Color(COL_RED ),css::drawing::HatchStyle_DOUBLE, 80,450),aStr.toString()));
aStr[nLen] = '3';
- Insert(new XHatchEntry(XHatch(RGB_Color(COL_BLUE ),XHATCH_TRIPLE,120, 0),aStr.toString()));
+ Insert(new XHatchEntry(XHatch(RGB_Color(COL_BLUE ),css::drawing::HatchStyle_TRIPLE,120, 0),aStr.toString()));
return true;
}
@@ -100,19 +100,19 @@ Bitmap XHatchList::CreateBitmapForUI( long nIndex )
switch(rHatch.GetHatchStyle())
{
- case XHATCH_SINGLE :
+ case css::drawing::HatchStyle_SINGLE :
{
aHatchStyle = drawinglayer::attribute::HATCHSTYLE_SINGLE;
break;
}
- case XHATCH_DOUBLE :
+ case css::drawing::HatchStyle_DOUBLE :
{
aHatchStyle = drawinglayer::attribute::HATCHSTYLE_DOUBLE;
break;
}
default :
{
- aHatchStyle = drawinglayer::attribute::HATCHSTYLE_TRIPLE; // XHATCH_TRIPLE
+ aHatchStyle = drawinglayer::attribute::HATCHSTYLE_TRIPLE; // css::drawing::HatchStyle_TRIPLE
break;
}
}
More information about the Libreoffice-commits
mailing list