[Libreoffice-commits] core.git: 2 commits - cui/source include/svx sc/source svx/source sw/source
Noel Grandin
noel at peralex.com
Sun May 22 17:51:37 UTC 2016
cui/source/dialogs/hltpbase.cxx | 16 ++++++------
cui/source/inc/hltpbase.hxx | 2 -
include/svx/hlnkitem.hxx | 25 ++++++++++++-------
include/svx/xoutbmp.hxx | 33 ++++++++++++++-----------
sc/source/filter/html/htmlexp.cxx | 2 -
sc/source/filter/html/htmlexp2.cxx | 10 +++----
sc/source/filter/inc/htmlexp.hxx | 2 -
svx/source/core/extedit.cxx | 2 -
svx/source/core/graphichelper.cxx | 6 ++--
svx/source/dialog/_contdlg.cxx | 6 ++--
svx/source/items/hlnkitem.cxx | 41 ++++++++++++++++----------------
svx/source/xoutdev/_xoutbmp.cxx | 32 ++++++++++++------------
sw/source/filter/html/htmlflywriter.cxx | 14 +++++-----
sw/source/filter/html/htmlplug.cxx | 4 +--
sw/source/uibase/shells/textsh.cxx | 10 +++----
15 files changed, 109 insertions(+), 96 deletions(-)
New commits:
commit 835de2917eb2941150edc38285e41488380323e0
Author: Noel Grandin <noel at peralex.com>
Date: Fri May 20 14:37:46 2016 +0200
Convert HYPERDLG_EVENT to scoped enum
Change-Id: I8a0248bb91ee67596aa44d11ca862d2e127a65ad
Reviewed-on: https://gerrit.libreoffice.org/25197
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 07cbd4c..cef6aec 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -295,7 +295,7 @@ void SvxHyperlinkTabPageBase::FillStandardDlgFields ( const SvxHyperlinkItem* pH
mpEdText->SetText ( pHyperlinkItem->GetIntName() );
// Script-button
- if ( !pHyperlinkItem->GetMacroEvents() )
+ if ( pHyperlinkItem->GetMacroEvents() == HyperDialogEvent::NONE )
mpBtScript->Disable();
else
mpBtScript->Enable();
@@ -344,7 +344,7 @@ IMPL_LINK_NOARG_TYPED(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl, Button*, voi
SvxHyperlinkItem *pHyperlinkItem = const_cast<SvxHyperlinkItem*>(static_cast<const SvxHyperlinkItem *>(
GetItemSet().GetItem (SID_HYPERLINK_GETLINK)));
- if ( pHyperlinkItem->GetMacroEvents() )
+ if ( pHyperlinkItem->GetMacroEvents() != HyperDialogEvent::NONE )
{
// get macros from itemset
const SvxMacroTableDtor* pMacroTbl = pHyperlinkItem->GetMacroTable();
@@ -370,13 +370,13 @@ IMPL_LINK_NOARG_TYPED(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl, Button*, voi
// add events
SfxMacroTabPage *pMacroPage = static_cast<SfxMacroTabPage*>( aDlg->GetTabPage() );
- if ( pHyperlinkItem->GetMacroEvents() & HYPERDLG_EVENT_MOUSEOVER_OBJECT )
+ if ( pHyperlinkItem->GetMacroEvents() & HyperDialogEvent::MouseOverObject )
pMacroPage->AddEvent( OUString( CUI_RESSTR(RID_SVXSTR_HYPDLG_MACROACT1) ),
SFX_EVENT_MOUSEOVER_OBJECT );
- if ( pHyperlinkItem->GetMacroEvents() & HYPERDLG_EVENT_MOUSECLICK_OBJECT )
+ if ( pHyperlinkItem->GetMacroEvents() & HyperDialogEvent::MouseClickObject )
pMacroPage->AddEvent( OUString( CUI_RESSTR(RID_SVXSTR_HYPDLG_MACROACT2) ),
SFX_EVENT_MOUSECLICK_OBJECT);
- if ( pHyperlinkItem->GetMacroEvents() & HYPERDLG_EVENT_MOUSEOUT_OBJECT )
+ if ( pHyperlinkItem->GetMacroEvents() & HyperDialogEvent::MouseOutObject )
pMacroPage->AddEvent( OUString( CUI_RESSTR(RID_SVXSTR_HYPDLG_MACROACT3) ),
SFX_EVENT_MOUSEOUT_OBJECT);
@@ -400,7 +400,7 @@ IMPL_LINK_NOARG_TYPED(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl, Button*, voi
}
// Get Macro-Infos
-sal_uInt16 SvxHyperlinkTabPageBase::GetMacroEvents()
+HyperDialogEvent SvxHyperlinkTabPageBase::GetMacroEvents()
{
const SvxHyperlinkItem *pHyperlinkItem = static_cast<const SvxHyperlinkItem *>(
GetItemSet().GetItem (SID_HYPERLINK_GETLINK));
@@ -496,7 +496,7 @@ bool SvxHyperlinkTabPageBase::FillItemSet( SfxItemSet* rOut)
if ( aStrName.isEmpty() ) //automatically create a visible name if the link is created without name
aStrName = CreateUiNameFromURL(aStrURL);
- sal_uInt16 nEvents = GetMacroEvents();
+ HyperDialogEvent nEvents = GetMacroEvents();
SvxMacroTableDtor* pTable = GetMacroTable();
SvxHyperlinkItem aItem( SID_HYPERLINK_SETLINK, aStrName, aStrURL, aStrFrame,
@@ -537,7 +537,7 @@ int SvxHyperlinkTabPageBase::DeactivatePage( SfxItemSet* _pSet)
GetCurentItemData ( aStrURL, aStrName, aStrIntName, aStrFrame, eMode);
- sal_uInt16 nEvents = GetMacroEvents();
+ HyperDialogEvent nEvents = GetMacroEvents();
SvxMacroTableDtor* pTable = GetMacroTable();
if( _pSet )
diff --git a/cui/source/inc/hltpbase.hxx b/cui/source/inc/hltpbase.hxx
index 043ab01..b3cc61b 100644
--- a/cui/source/inc/hltpbase.hxx
+++ b/cui/source/inc/hltpbase.hxx
@@ -149,7 +149,7 @@ protected:
SfxDispatcher* GetDispatcher() const;
- sal_uInt16 GetMacroEvents();
+ HyperDialogEvent GetMacroEvents();
SvxMacroTableDtor* GetMacroTable();
bool IsHTMLDoc() const;
diff --git a/include/svx/hlnkitem.hxx b/include/svx/hlnkitem.hxx
index 24d79c9..8f73036 100644
--- a/include/svx/hlnkitem.hxx
+++ b/include/svx/hlnkitem.hxx
@@ -24,10 +24,17 @@
#include <sfx2/sfxsids.hrc>
#include <svl/macitem.hxx>
#include <svx/svxdllapi.h>
+#include <o3tl/typed_flags_set.hxx>
-#define HYPERDLG_EVENT_MOUSEOVER_OBJECT 0x0001
-#define HYPERDLG_EVENT_MOUSECLICK_OBJECT 0x0002
-#define HYPERDLG_EVENT_MOUSEOUT_OBJECT 0x0004
+enum class HyperDialogEvent {
+ NONE = 0x0000,
+ MouseOverObject = 0x0001,
+ MouseClickObject = 0x0002,
+ MouseOutObject = 0x0004,
+};
+namespace o3tl {
+ template<> struct typed_flags<HyperDialogEvent> : is_typed_flags<HyperDialogEvent, 0x07> {};
+}
enum SvxLinkInsertMode
{
@@ -47,18 +54,18 @@ class SVX_DLLPUBLIC SvxHyperlinkItem : public SfxPoolItem
OUString sIntName;
SvxMacroTableDtor* pMacroTable;
- sal_uInt16 nMacroEvents;
+ HyperDialogEvent nMacroEvents;
public:
static SfxPoolItem* CreateDefault();
SvxHyperlinkItem( sal_uInt16 _nWhich = SID_HYPERLINK_GETLINK ):
- SfxPoolItem(_nWhich), pMacroTable(nullptr) { eType = HLINK_DEFAULT; nMacroEvents=0; };
+ SfxPoolItem(_nWhich), pMacroTable(nullptr) { eType = HLINK_DEFAULT; nMacroEvents=HyperDialogEvent::NONE; };
SvxHyperlinkItem( const SvxHyperlinkItem& rHyperlinkItem );
SvxHyperlinkItem( sal_uInt16 nWhich, const OUString& rName, const OUString& rURL,
const OUString& rTarget, const OUString& rIntName,
SvxLinkInsertMode eTyp = HLINK_FIELD,
- sal_uInt16 nEvents = 0,
+ HyperDialogEvent nEvents = HyperDialogEvent::NONE,
SvxMacroTableDtor *pMacroTbl =nullptr );
virtual ~SvxHyperlinkItem () { delete pMacroTable; }
@@ -84,13 +91,13 @@ public:
SvxLinkInsertMode GetInsertMode() const { return eType; }
void SetInsertMode( SvxLinkInsertMode eNew ) { eType = eNew; }
- void SetMacro( sal_uInt16 nEvent, const SvxMacro& rMacro );
+ void SetMacro( HyperDialogEvent nEvent, const SvxMacro& rMacro );
void SetMacroTable( const SvxMacroTableDtor& rTbl );
const SvxMacroTableDtor* GetMacroTable() const { return pMacroTable; }
- void SetMacroEvents (const sal_uInt16 nEvents) { nMacroEvents = nEvents; }
- sal_uInt16 GetMacroEvents() const { return nMacroEvents; }
+ void SetMacroEvents (const HyperDialogEvent nEvents) { nMacroEvents = nEvents; }
+ HyperDialogEvent GetMacroEvents() const { return nMacroEvents; }
virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const override;
virtual SfxPoolItem* Create( SvStream &, sal_uInt16 nVer ) const override;
diff --git a/svx/source/items/hlnkitem.cxx b/svx/source/items/hlnkitem.cxx
index 5ff6e27..f9165f6 100644
--- a/svx/source/items/hlnkitem.cxx
+++ b/svx/source/items/hlnkitem.cxx
@@ -51,7 +51,7 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/
rStrm.WriteUniOrByteString(sIntName, rStrm.GetStreamCharSet());
// macro-events
- rStrm.WriteUInt16( nMacroEvents );
+ rStrm.WriteUInt16( (sal_uInt16)nMacroEvents );
// store macros
sal_uInt16 nCnt = pMacroTable ? (sal_uInt16)pMacroTable->size() : 0;
@@ -141,7 +141,9 @@ SfxPoolItem* SvxHyperlinkItem::Create( SvStream &rStrm, sal_uInt16 /*nItemVer
pNew->sIntName = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
// macro-events
- rStrm.ReadUInt16( pNew->nMacroEvents );
+ sal_uInt16 nTmp;
+ rStrm.ReadUInt16(nTmp);
+ pNew->nMacroEvents = (HyperDialogEvent)nTmp;
// macros
sal_uInt16 nCnt;
@@ -158,7 +160,7 @@ SfxPoolItem* SvxHyperlinkItem::Create( SvStream &rStrm, sal_uInt16 /*nItemVer
// UNICODE: rStrm >> aMacName;
aMacName = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
- pNew->SetMacro( nCurKey, SvxMacro( aMacName, aLibName, STARBASIC ) );
+ pNew->SetMacro( (HyperDialogEvent)nCurKey, SvxMacro( aMacName, aLibName, STARBASIC ) );
}
rStrm.ReadUInt16( nCnt );
@@ -177,7 +179,7 @@ SfxPoolItem* SvxHyperlinkItem::Create( SvStream &rStrm, sal_uInt16 /*nItemVer
rStrm.ReadUInt16( nScriptType );
- pNew->SetMacro( nCurKey, SvxMacro( aMacName, aLibName,
+ pNew->SetMacro( (HyperDialogEvent)nCurKey, SvxMacro( aMacName, aLibName,
(ScriptType)nScriptType ) );
}
}
@@ -206,7 +208,7 @@ SvxHyperlinkItem::SvxHyperlinkItem( const SvxHyperlinkItem& rHyperlinkItem ):
SvxHyperlinkItem::SvxHyperlinkItem( sal_uInt16 _nWhich, const OUString& rName, const OUString& rURL,
const OUString& rTarget, const OUString& rIntName, SvxLinkInsertMode eTyp,
- sal_uInt16 nEvents, SvxMacroTableDtor *pMacroTbl ):
+ HyperDialogEvent nEvents, SvxMacroTableDtor *pMacroTbl ):
SfxPoolItem (_nWhich),
sName (rName),
sURL (rURL),
@@ -253,28 +255,27 @@ bool SvxHyperlinkItem::operator==( const SfxPoolItem& rAttr ) const
return rOwn == rOther;
}
-void SvxHyperlinkItem::SetMacro( sal_uInt16 nEvent, const SvxMacro& rMacro )
+void SvxHyperlinkItem::SetMacro( HyperDialogEvent nEvent, const SvxMacro& rMacro )
{
- if( nEvent < EVENT_SFX_START )
+ sal_uInt16 nSfxEvent = 0;
+ switch( nEvent )
{
- switch( nEvent )
- {
- case HYPERDLG_EVENT_MOUSEOVER_OBJECT:
- nEvent = SFX_EVENT_MOUSEOVER_OBJECT;
- break;
- case HYPERDLG_EVENT_MOUSECLICK_OBJECT:
- nEvent = SFX_EVENT_MOUSECLICK_OBJECT;
- break;
- case HYPERDLG_EVENT_MOUSEOUT_OBJECT:
- nEvent = SFX_EVENT_MOUSEOUT_OBJECT;
- break;
- }
+ case HyperDialogEvent::MouseOverObject:
+ nSfxEvent = SFX_EVENT_MOUSEOVER_OBJECT;
+ break;
+ case HyperDialogEvent::MouseClickObject:
+ nSfxEvent = SFX_EVENT_MOUSECLICK_OBJECT;
+ break;
+ case HyperDialogEvent::MouseOutObject:
+ nSfxEvent = SFX_EVENT_MOUSEOUT_OBJECT;
+ break;
+ default: break;
}
if( !pMacroTable )
pMacroTable = new SvxMacroTableDtor;
- pMacroTable->Insert( nEvent, rMacro);
+ pMacroTable->Insert( nSfxEvent, rMacro);
}
void SvxHyperlinkItem::SetMacroTable( const SvxMacroTableDtor& rTbl )
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index cf44195..fe8b827 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -652,15 +652,15 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
aHLinkItem.SetIntName(pINetFormat->GetName());
const SvxMacro *pMacro = pINetFormat->GetMacro( SFX_EVENT_MOUSEOVER_OBJECT );
if( pMacro )
- aHLinkItem.SetMacro(HYPERDLG_EVENT_MOUSEOVER_OBJECT, *pMacro);
+ aHLinkItem.SetMacro(HyperDialogEvent::MouseOverObject, *pMacro);
pMacro = pINetFormat->GetMacro( SFX_EVENT_MOUSECLICK_OBJECT );
if( pMacro )
- aHLinkItem.SetMacro(HYPERDLG_EVENT_MOUSECLICK_OBJECT, *pMacro);
+ aHLinkItem.SetMacro(HyperDialogEvent::MouseClickObject, *pMacro);
pMacro = pINetFormat->GetMacro( SFX_EVENT_MOUSEOUT_OBJECT );
if( pMacro )
- aHLinkItem.SetMacro(HYPERDLG_EVENT_MOUSEOUT_OBJECT, *pMacro);
+ aHLinkItem.SetMacro(HyperDialogEvent::MouseOutObject, *pMacro);
// Get the text of the Link.
rSh.StartAction();
@@ -681,8 +681,8 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
aHLinkItem.SetInsertMode((SvxLinkInsertMode)(aHLinkItem.GetInsertMode() |
(bHtmlModeOn ? HLINK_HTMLMODE : 0)));
- aHLinkItem.SetMacroEvents ( HYPERDLG_EVENT_MOUSEOVER_OBJECT|
- HYPERDLG_EVENT_MOUSECLICK_OBJECT | HYPERDLG_EVENT_MOUSEOUT_OBJECT );
+ aHLinkItem.SetMacroEvents ( HyperDialogEvent::MouseOverObject|
+ HyperDialogEvent::MouseClickObject | HyperDialogEvent::MouseOutObject );
rSet.Put(aHLinkItem);
}
commit eaba47bce44a373116b0583dc293c8c3238b7bea
Author: Noel Grandin <noel at peralex.com>
Date: Fri May 20 14:15:36 2016 +0200
Convert XOUTBMP to scoped enum
Change-Id: I8d10cdc78ca73d86bdc9aa08fca591f6eb85eb9e
Reviewed-on: https://gerrit.libreoffice.org/25196
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/include/svx/xoutbmp.hxx b/include/svx/xoutbmp.hxx
index 37dfb30..c694625 100644
--- a/include/svx/xoutbmp.hxx
+++ b/include/svx/xoutbmp.hxx
@@ -24,19 +24,24 @@
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <svx/svxdllapi.h>
+#include <o3tl/typed_flags_set.hxx>
-#define XOUTBMP_MIRROR_HORZ 0x00000001L
-#define XOUTBMP_MIRROR_VERT 0x00000010L
-
-#define XOUTBMP_CONTOUR_HORZ 0x00000001L
-#define XOUTBMP_CONTOUR_VERT 0x00000002L
-#define XOUTBMP_CONTOUR_EDGEDETECT 0x00000004L
-#define XOUTBMP_DONT_ADD_EXTENSION 0x00000008L
-
-#define XOUTBMP_DONT_EXPAND_FILENAME 0x10000000L
-#define XOUTBMP_USE_GIF_IF_POSSIBLE 0x20000000L
-#define XOUTBMP_USE_GIF_IF_SENSIBLE 0x40000000L
-#define XOUTBMP_USE_NATIVE_IF_POSSIBLE 0x80000000L
+enum class XOutFlags {
+ NONE = 0x00000000,
+ MirrorHorz = 0x00000001,
+ MirrorVert = 0x00000010,
+ ContourHorz = 0x00000001,
+ ContourVert = 0x00000002,
+ ContourEdgeDetect = 0x00000004,
+ DontAddExtension = 0x00000008,
+ DontExpandFilename = 0x00010000,
+ UseGifIfPossible = 0x00020000,
+ UseGifIfSensible = 0x00040000,
+ UseNativeIfPossible = 0x00080000,
+};
+namespace o3tl {
+ template<> struct typed_flags<XOutFlags> : is_typed_flags<XOutFlags, 0x000f001f> {};
+}
class GraphicFilter;
class VirtualDevice;
@@ -54,7 +59,7 @@ public:
static Graphic MirrorGraphic( const Graphic& rGraphic, const BmpMirrorFlags nMirrorFlags );
static Animation MirrorAnimation( const Animation& rAnimation, bool bHMirr, bool bVMirr );
static sal_uInt16 WriteGraphic( const Graphic& rGraphic, OUString& rFileName,
- const OUString& rFilterName, const sal_uIntPtr nFlags = 0L,
+ const OUString& rFilterName, const XOutFlags nFlags = XOutFlags::NONE,
const Size* pMtfSize_100TH_MM = nullptr );
static bool GraphicToBase64(const Graphic& rGraphic, OUString& rOUString);
@@ -64,7 +69,7 @@ public:
static Bitmap DetectEdges( const Bitmap& rBmp, const sal_uInt8 cThreshold );
- static tools::Polygon GetCountour( const Bitmap& rBmp, const sal_uIntPtr nContourFlags,
+ static tools::Polygon GetCountour( const Bitmap& rBmp, const XOutFlags nContourFlags,
const sal_uInt8 cEdgeDetectThreshold = 50,
const Rectangle* pWorkRect = nullptr );
};
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index cd43d57..bc47e99 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -609,7 +609,7 @@ void ScHTMLExport::WriteBody()
// Save graphic as (JPG) file
aGrfNm = aStreamPath;
sal_uInt16 nErr = XOutBitmap::WriteGraphic( *pGrf, aGrfNm,
- "JPG", XOUTBMP_USE_NATIVE_IF_POSSIBLE );
+ "JPG", XOutFlags::UseNativeIfPossible );
if( !nErr ) // Contains errors, as we have nothing to output
{
aGrfNm = URIHelper::SmartRel2Abs(
diff --git a/sc/source/filter/html/htmlexp2.cxx b/sc/source/filter/html/htmlexp2.cxx
index aab92de..9c2113e 100644
--- a/sc/source/filter/html/htmlexp2.cxx
+++ b/sc/source/filter/html/htmlexp2.cxx
@@ -140,11 +140,11 @@ void ScHTMLExport::WriteGraphEntry( ScHTMLGraphEntry* pE )
( pGeo->bMirrored ? 3 : 4 ) : ( pGeo->bMirrored ? 2 : 1 ));
bool bHMirr = ( ( nMirrorCase == 2 ) || ( nMirrorCase == 4 ) );
bool bVMirr = ( ( nMirrorCase == 3 ) || ( nMirrorCase == 4 ) );
- sal_uLong nXOutFlags = 0;
+ XOutFlags nXOutFlags = XOutFlags::NONE;
if ( bHMirr )
- nXOutFlags |= XOUTBMP_MIRROR_HORZ;
+ nXOutFlags |= XOutFlags::MirrorHorz;
if ( bVMirr )
- nXOutFlags |= XOUTBMP_MIRROR_VERT;
+ nXOutFlags |= XOutFlags::MirrorVert;
OUString aLinkName;
if ( pSGO->IsLinkedGraphic() )
aLinkName = pSGO->GetFileName();
@@ -175,7 +175,7 @@ void ScHTMLExport::WriteGraphEntry( ScHTMLGraphEntry* pE )
}
void ScHTMLExport::WriteImage( OUString& rLinkName, const Graphic& rGrf,
- const OString& rImgOptions, sal_uLong nXOutFlags )
+ const OString& rImgOptions, XOutFlags nXOutFlags )
{
// Embedded graphic -> create an image file
if( rLinkName.isEmpty() )
@@ -184,7 +184,7 @@ void ScHTMLExport::WriteImage( OUString& rLinkName, const Graphic& rGrf,
{
// Save as a PNG
OUString aGrfNm( aStreamPath );
- nXOutFlags |= XOUTBMP_USE_NATIVE_IF_POSSIBLE;
+ nXOutFlags |= XOutFlags::UseNativeIfPossible;
sal_uInt16 nErr = XOutBitmap::WriteGraphic( rGrf, aGrfNm,
"PNG", nXOutFlags );
diff --git a/sc/source/filter/inc/htmlexp.hxx b/sc/source/filter/inc/htmlexp.hxx
index 8e8513d..1be62ff 100644
--- a/sc/source/filter/inc/htmlexp.hxx
+++ b/sc/source/filter/inc/htmlexp.hxx
@@ -137,7 +137,7 @@ class ScHTMLExport : public ScExportBase
void WriteGraphEntry( ScHTMLGraphEntry* );
void WriteImage( OUString& rLinkName,
const Graphic&, const OString& rImgOptions,
- sal_uLong nXOutFlags = 0 );
+ XOutFlags nXOutFlags = XOutFlags::NONE );
// nXOutFlags for XOutBitmap::WriteGraphic
// write to stream if and only if URL fields in edit cell
diff --git a/svx/source/core/extedit.cxx b/svx/source/core/extedit.cxx
index d3b16b6..8ef1662 100644
--- a/svx/source/core/extedit.cxx
+++ b/svx/source/core/extedit.cxx
@@ -138,7 +138,7 @@ void ExternalToolEdit::Edit(GraphicObject const*const pGraphicObject)
OUString aFilter(rGraphicFilter.GetExportFormatShortName(nFilter));
// Write the Graphic to the file now
- XOutBitmap::WriteGraphic(aGraphic, aTempFileName, aFilter, XOUTBMP_USE_NATIVE_IF_POSSIBLE | XOUTBMP_DONT_EXPAND_FILENAME);
+ XOutBitmap::WriteGraphic(aGraphic, aTempFileName, aFilter, XOutFlags::UseNativeIfPossible | XOutFlags::DontExpandFilename);
// There is a possibility that sPath extension might have been changed if the
// provided extension is not writable
diff --git a/svx/source/core/graphichelper.cxx b/svx/source/core/graphichelper.cxx
index b051cbd..4816342 100644
--- a/svx/source/core/graphichelper.cxx
+++ b/svx/source/core/graphichelper.cxx
@@ -192,9 +192,9 @@ OUString GraphicHelper::ExportGraphic( const Graphic& rGraphic, const OUString&
OUString aFilter( rGraphicFilter.GetExportFormatShortName( nFilter ) );
XOutBitmap::WriteGraphic( rGraphic, sPath, aFilter,
- XOUTBMP_DONT_EXPAND_FILENAME |
- XOUTBMP_DONT_ADD_EXTENSION |
- XOUTBMP_USE_NATIVE_IF_POSSIBLE );
+ XOutFlags::DontExpandFilename |
+ XOutFlags::DontAddExtension |
+ XOutFlags::UseNativeIfPossible );
return sPath;
}
}
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index aacf82b..0965114 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -106,7 +106,7 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic,
const sal_uIntPtr nFlags )
{
Bitmap aBmp;
- sal_uIntPtr nContourFlags = XOUTBMP_CONTOUR_HORZ;
+ XOutFlags nContourFlags = XOutFlags::ContourHorz;
if ( rGraphic.GetType() == GRAPHIC_BITMAP )
{
@@ -145,7 +145,7 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic,
else
{
aBmp = rGraphic.GetBitmap();
- nContourFlags |= XOUTBMP_CONTOUR_EDGEDETECT;
+ nContourFlags |= XOutFlags::ContourEdgeDetect;
}
}
else if( rGraphic.GetType() != GRAPHIC_NONE )
@@ -171,7 +171,7 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic,
aBmp = pVDev->GetBitmap( aPt, aSizePix );
}
- nContourFlags |= XOUTBMP_CONTOUR_EDGEDETECT;
+ nContourFlags |= XOutFlags::ContourEdgeDetect;
}
aBmp.SetPrefSize( rGraphic.GetPrefSize() );
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index 0e7aece..8750a2d 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -116,7 +116,7 @@ Graphic XOutBitmap::MirrorGraphic( const Graphic& rGraphic, const BmpMirrorFlags
}
sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName,
- const OUString& rFilterName, const sal_uIntPtr nFlags,
+ const OUString& rFilterName, const XOutFlags nFlags,
const Size* pMtfSize_100TH_MM )
{
if( rGraphic.GetType() != GRAPHIC_NONE )
@@ -131,7 +131,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam
DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NotValid, "XOutBitmap::WriteGraphic(...): invalid URL" );
// calculate correct file name
- if( !( nFlags & XOUTBMP_DONT_EXPAND_FILENAME ) )
+ if( !( nFlags & XOutFlags::DontExpandFilename ) )
{
OUString aName( aURL.getBase() );
aName += "_";
@@ -151,7 +151,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam
&& aSvgDataPtr->getSvgDataArrayLength()
&& rFilterName.equalsIgnoreAsciiCase("svg"))
{
- if(!(nFlags & XOUTBMP_DONT_ADD_EXTENSION))
+ if(!(nFlags & XOutFlags::DontAddExtension))
{
aURL.setExtension(rFilterName);
}
@@ -174,9 +174,9 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam
if( GRFILTER_OK != nErr )
{
- if( ( nFlags & XOUTBMP_USE_NATIVE_IF_POSSIBLE ) &&
- !( nFlags & XOUTBMP_MIRROR_HORZ ) &&
- !( nFlags & XOUTBMP_MIRROR_VERT ) &&
+ if( ( nFlags & XOutFlags::UseNativeIfPossible ) &&
+ !( nFlags & XOutFlags::MirrorHorz ) &&
+ !( nFlags & XOutFlags::MirrorVert ) &&
( rGraphic.GetType() != GRAPHIC_GDIMETAFILE ) && rGraphic.IsLink() )
{
// try to write native link
@@ -198,7 +198,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam
if( !aExt.isEmpty() )
{
- if( 0 == (nFlags & XOUTBMP_DONT_ADD_EXTENSION))
+ if( !(nFlags & XOutFlags::DontAddExtension) )
aURL.setExtension( aExt );
rFileName = aURL.GetMainURL( INetURLObject::NO_DECODE );
@@ -222,8 +222,8 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam
OUString aFilter( rFilterName );
bool bWriteTransGrf = ( aFilter.equalsIgnoreAsciiCase( "transgrf" ) ) ||
( aFilter.equalsIgnoreAsciiCase( "gif" ) ) ||
- ( nFlags & XOUTBMP_USE_GIF_IF_POSSIBLE ) ||
- ( ( nFlags & XOUTBMP_USE_GIF_IF_SENSIBLE ) && ( bAnimated || bTransparent ) );
+ ( nFlags & XOutFlags::UseGifIfPossible ) ||
+ ( ( nFlags & XOutFlags::UseGifIfSensible ) && ( bAnimated || bTransparent ) );
// get filter and extension
if( bWriteTransGrf )
@@ -300,19 +300,19 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam
}
// mirror?
- if( ( nFlags & XOUTBMP_MIRROR_HORZ ) || ( nFlags & XOUTBMP_MIRROR_VERT ) )
+ if( ( nFlags & XOutFlags::MirrorHorz ) || ( nFlags & XOutFlags::MirrorVert ) )
{
BmpMirrorFlags nBmpMirrorFlags = BmpMirrorFlags::NONE;
- if( nFlags & XOUTBMP_MIRROR_HORZ )
+ if( nFlags & XOutFlags::MirrorHorz )
nBmpMirrorFlags |= BmpMirrorFlags::Horizontal;
- if( nFlags & XOUTBMP_MIRROR_VERT )
+ if( nFlags & XOutFlags::MirrorVert )
nBmpMirrorFlags |= BmpMirrorFlags::Vertical;
aGraphic = MirrorGraphic( aGraphic, nBmpMirrorFlags );
}
if( ( GRFILTER_FORMAT_NOTFOUND != nFilter ) && ( aGraphic.GetType() != GRAPHIC_NONE ) )
{
- if( 0 == (nFlags & XOUTBMP_DONT_ADD_EXTENSION))
+ if( !(nFlags & XOutFlags::DontAddExtension) )
aURL.setExtension( aExt );
rFileName = aURL.GetMainURL( INetURLObject::NO_DECODE );
nErr = ExportGraphic( aGraphic, aURL, rFilter, nFilter );
@@ -498,7 +498,7 @@ Bitmap XOutBitmap::DetectEdges( const Bitmap& rBmp, const sal_uInt8 cThreshold )
return aRetBmp;
}
-tools::Polygon XOutBitmap::GetCountour( const Bitmap& rBmp, const sal_uIntPtr nFlags,
+tools::Polygon XOutBitmap::GetCountour( const Bitmap& rBmp, const XOutFlags nFlags,
const sal_uInt8 cEdgeDetectThreshold,
const Rectangle* pWorkRectPixel )
{
@@ -515,7 +515,7 @@ tools::Polygon XOutBitmap::GetCountour( const Bitmap& rBmp, const sal_uIntPtr nF
if( ( aWorkRect.GetWidth() > 4 ) && ( aWorkRect.GetHeight() > 4 ) )
{
// if the flag is set, we need to detect edges
- if( nFlags & XOUTBMP_CONTOUR_EDGEDETECT )
+ if( nFlags & XOutFlags::ContourEdgeDetect )
aWorkBmp = DetectEdges( rBmp, cEdgeDetectThreshold );
else
aWorkBmp = rBmp;
@@ -542,7 +542,7 @@ tools::Polygon XOutBitmap::GetCountour( const Bitmap& rBmp, const sal_uIntPtr nF
sal_uInt16 nPolyPos = 0;
const BitmapColor aBlack = pAcc->GetBestMatchingColor( Color( COL_BLACK ) );
- if( nFlags & XOUTBMP_CONTOUR_VERT )
+ if( nFlags & XOutFlags::ContourVert )
{
pPoints1.reset(new Point[ nWidth ]);
pPoints2.reset(new Point[ nWidth ]);
diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx
index 591fc64..8ce58c3 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -1734,8 +1734,8 @@ static Writer & OutHTML_FrameFormatAsImage( Writer& rWrt, const SwFrameFormat& r
if( aGraphic.GetType() == GRAPHIC_NONE ||
XOutBitmap::WriteGraphic( aGraphic, GraphicURL,
"JPG",
- (XOUTBMP_USE_GIF_IF_POSSIBLE|
- XOUTBMP_USE_NATIVE_IF_POSSIBLE) ) != 0 )
+ (XOutFlags::UseGifIfPossible|
+ XOutFlags::UseNativeIfPossible) ) != 0 )
{
// leer oder fehlerhaft, da ist nichts auszugeben
rHTMLWrt.m_nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE;
@@ -1786,14 +1786,14 @@ static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, const SwFrameFormat& rF
aGraphicURL = *rHTMLWrt.GetOrigFileName();
pGrfNd->GetGrf( true );
- sal_uLong nFlags = XOUTBMP_USE_GIF_IF_SENSIBLE |
- XOUTBMP_USE_NATIVE_IF_POSSIBLE;
+ XOutFlags nFlags = XOutFlags::UseGifIfSensible |
+ XOutFlags::UseNativeIfPossible;
switch( rMirror.GetValue() )
{
- case RES_MIRROR_GRAPH_VERT: nFlags = XOUTBMP_MIRROR_HORZ; break;
- case RES_MIRROR_GRAPH_HOR: nFlags = XOUTBMP_MIRROR_VERT; break;
+ case RES_MIRROR_GRAPH_VERT: nFlags = XOutFlags::MirrorHorz; break;
+ case RES_MIRROR_GRAPH_HOR: nFlags = XOutFlags::MirrorVert; break;
case RES_MIRROR_GRAPH_BOTH:
- nFlags = XOUTBMP_MIRROR_VERT | XOUTBMP_MIRROR_HORZ;
+ nFlags = XOutFlags::MirrorVert | XOutFlags::MirrorHorz;
break;
}
diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx
index 18154b4..f5bde4e 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -1322,8 +1322,8 @@ Writer& OutHTML_FrameFormatOLENodeGrf( Writer& rWrt, const SwFrameFormat& rFrame
sal_uInt16 nErr = XOutBitmap::WriteGraphic( aGraphic, aGraphicURL,
"JPG",
- (XOUTBMP_USE_GIF_IF_POSSIBLE |
- XOUTBMP_USE_NATIVE_IF_POSSIBLE) );
+ (XOutFlags::UseGifIfPossible |
+ XOutFlags::UseNativeIfPossible) );
if( nErr ) // fehlerhaft, da ist nichts auszugeben
{
rHTMLWrt.m_nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE;
More information about the Libreoffice-commits
mailing list