[Libreoffice-commits] .: 5 commits - sc/source sfx2/inc sfx2/source svx/inc svx/source sw/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Fri Jan 20 13:55:28 PST 2012
sc/source/core/data/documen8.cxx | 2
sc/source/ui/docshell/arealink.cxx | 15 -
sc/source/ui/docshell/externalrefmgr.cxx | 2
sc/source/ui/docshell/tablink.cxx | 7
sfx2/inc/sfx2/linkmgr.hxx | 14 +
sfx2/source/appl/linkmgr2.cxx | 52 +++++-
svx/inc/svx/svdograf.hxx | 45 ++---
svx/source/sdr/contact/viewobjectcontactofgraphic.cxx | 8
svx/source/svdraw/svdograf.cxx | 156 ++++++++++--------
sw/source/filter/ww8/ww8graf.cxx | 2
10 files changed, 186 insertions(+), 117 deletions(-)
New commits:
commit 5708d3dcb065247d5774dafbd7911bb5bab72849
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Fri Jan 20 16:36:06 2012 -0500
More on String to rtl::OUString changes.
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 3e32e82..9110f4d 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1031,7 +1031,7 @@ void ScDocument::UpdateExternalRefLinks(Window* pWin)
{
// Update failed. Notify the user.
- String aFile;
+ rtl::OUString aFile;
pLinkManager->GetDisplayNames(pRefLink, NULL, &aFile, NULL, NULL);
// Decode encoded URL for display friendliness.
INetURLObject aUrl(aFile,INetURLObject::WAS_ENCODED);
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index 18e163d..832036f 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -129,13 +129,8 @@ void ScAreaLink::Edit(Window* pParent, const Link& /* rEndEditHdl */ )
sfx2::LinkManager* pLinkManager=pImpl->m_pDocSh->GetDocument()->GetLinkManager();
if (pLinkManager!=NULL)
{
- String aTmp1;
- String aTmp2;
- String aTmp3;
- pLinkManager->GetDisplayNames(this, NULL, &aTmp1, &aTmp2, &aTmp3);
- rtl::OUString aFile = aTmp1;
- rtl::OUString aArea = aTmp2;
- rtl::OUString aFilter = aTmp3;
+ rtl::OUString aFile, aArea, aFilter;
+ pLinkManager->GetDisplayNames(this, NULL, &aFile, &aArea, &aFilter);
// the file dialog returns the filter name with the application prefix
// -> remove prefix
@@ -148,9 +143,9 @@ void ScAreaLink::Edit(Window* pParent, const Link& /* rEndEditHdl */ )
// adjust in dialog:
String aNewLinkName;
- aTmp1 = aFilter;
- sfx2::MakeLnkName(aNewLinkName, NULL, aFile, aArea, &aTmp1);
- aFilter = aTmp1;
+ String aTmp = aFilter;
+ sfx2::MakeLnkName(aNewLinkName, NULL, aFile, aArea, &aTmp);
+ aFilter = aTmp;
SetName( aNewLinkName );
}
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 7931074..eaf72bc 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -1250,7 +1250,7 @@ void ScExternalRefLink::Closed()
if (!mbDoRefresh)
return SUCCESS;
- String aFile, aFilter;
+ rtl::OUString aFile, aFilter;
mpDoc->GetLinkManager()->GetDisplayNames(this, NULL, &aFile, NULL, &aFilter);
ScExternalRefManager* pMgr = mpDoc->GetExternalRefManager();
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index baaff72..f154f0a 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -147,11 +147,8 @@ void ScTableLink::Edit( Window* pParent, const Link& rEndEditHdl )
sfx2::LinkManager* pLinkManager=pImpl->m_pDocSh->GetDocument()->GetLinkManager();
if (pLinkManager!=NULL)
{
- String aTmp1;
- String aTmp2;
- pLinkManager->GetDisplayNames(this, 0, &aTmp1, NULL, &aTmp2);
- rtl::OUString aFile = aTmp1;
- rtl::OUString aFilter = aTmp2;
+ rtl::OUString aFile, aFilter;
+ pLinkManager->GetDisplayNames(this, 0, &aFile, NULL, &aFilter);
// the file dialog returns the filter name with the application prefix
// -> remove prefix
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 7aec55a..96860bd 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -2978,7 +2978,7 @@ SwFlyFrmFmt* SwWW8ImplReader::ImportReplaceableDrawables( SdrObject* &rpObject,
{
const SdrGrafObj *pGrf= (const SdrGrafObj*)rpObject;
bool bDone = false;
- if (pGrf->IsLinkedGraphic() && pGrf->GetFileName().Len())
+ if (pGrf->IsLinkedGraphic() && !pGrf->GetFileName().isEmpty())
{
GraphicType eType = pGrf->GetGraphicType();
String aGrfName(
commit 88869c1dd907c4851cd8671f0822a0d7c4fd3f36
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Fri Jan 20 15:37:25 2012 -0500
String to rtl::OUString.
diff --git a/svx/inc/svx/svdograf.hxx b/svx/inc/svx/svdograf.hxx
index f11a1eb..eb2235f 100644
--- a/svx/inc/svx/svdograf.hxx
+++ b/svx/inc/svx/svdograf.hxx
@@ -83,6 +83,9 @@ public:
class GraphicObject;
class SdrGraphicLink;
+/**
+ * This class represents an embedded or linked bitmap graphic object.
+ */
class SVX_DLLPUBLIC SdrGrafObj : public SdrRectObj
{
private:
@@ -100,8 +103,8 @@ private:
void ImpSetAttrToGrafInfo(); // Werte vom Pool kopieren
GraphicAttr aGrafInfo;
- String aFileName; // Wenn es sich um einen Link handelt, steht hier der Dateiname drin.
- String aFilterName;
+ rtl::OUString aFileName; // Wenn es sich um einen Link handelt, steht hier der Dateiname drin.
+ rtl::OUString aFilterName;
GraphicObject* pGraphic; // Zur Beschleunigung von Bitmapausgaben, besonders von gedrehten.
SdrGraphicLink* pGraphicLink; // Und hier noch ein Pointer fuer gelinkte Grafiken
bool bMirrored:1; // True bedeutet, die Grafik ist horizontal, d.h. ueber die Y-Achse gespiegelt auszugeben.
@@ -158,12 +161,12 @@ public:
void ForceSwapIn() const;
void ForceSwapOut() const;
- void SetGraphicLink(const String& rFileName, const String& rFilterName);
+ void SetGraphicLink(const rtl::OUString& rFileName, const String& rFilterName);
void ReleaseGraphicLink();
bool IsLinkedGraphic() const;
- const String& GetFileName() const { return aFileName; }
- const String& GetFilterName() const { return aFilterName; }
+ const rtl::OUString& GetFileName() const;
+ const rtl::OUString& GetFilterName() const;
void StartAnimation(OutputDevice* pOutDev, const Point& rPoint, const Size& rSize, long nExtraData=0L);
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index b317bba..26606b7 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -597,10 +597,11 @@ void SdrGrafObj::ImpLinkAnmeldung()
if( pLinkManager != NULL && pGraphicLink == NULL )
{
- if( aFileName.Len() )
+ if (!aFileName.isEmpty())
{
pGraphicLink = new SdrGraphicLink( this );
- pLinkManager->InsertFileLink( *pGraphicLink, OBJECT_CLIENT_GRF, aFileName, ( aFilterName.Len() ? &aFilterName : NULL ), NULL );
+ pLinkManager->InsertFileLink(
+ *pGraphicLink, OBJECT_CLIENT_GRF, aFileName, (aFilterName.isEmpty() ? NULL : &aFilterName), NULL);
pGraphicLink->Connect();
}
}
@@ -622,7 +623,7 @@ void SdrGrafObj::ImpLinkAbmeldung()
// -----------------------------------------------------------------------------
-void SdrGrafObj::SetGraphicLink( const String& rFileName, const String& rFilterName )
+void SdrGrafObj::SetGraphicLink(const rtl::OUString& rFileName, const String& rFilterName)
{
ImpLinkAbmeldung();
aFileName = rFileName;
@@ -639,13 +640,23 @@ void SdrGrafObj::SetGraphicLink( const String& rFileName, const String& rFilterN
void SdrGrafObj::ReleaseGraphicLink()
{
ImpLinkAbmeldung();
- aFileName = String();
- aFilterName = String();
+ aFileName = rtl::OUString();
+ aFilterName = rtl::OUString();
}
bool SdrGrafObj::IsLinkedGraphic() const
{
- return aFileName.Len() > 0;
+ return !aFileName.isEmpty();
+}
+
+const rtl::OUString& SdrGrafObj::GetFileName() const
+{
+ return aFileName;
+}
+
+const rtl::OUString& SdrGrafObj::GetFilterName() const
+{
+ return aFilterName;
}
// -----------------------------------------------------------------------------
@@ -974,7 +985,7 @@ void SdrGrafObj::SetPage( SdrPage* pNewPage )
SdrRectObj::SetPage( pNewPage );
- if(aFileName.Len() && bInsert)
+ if (!aFileName.isEmpty() && bInsert)
ImpLinkAnmeldung();
}
@@ -999,7 +1010,7 @@ void SdrGrafObj::SetModel( SdrModel* pNewModel )
// realize model
SdrRectObj::SetModel(pNewModel);
- if( bChg && aFileName.Len() )
+ if (bChg && !aFileName.isEmpty())
ImpLinkAnmeldung();
}
@@ -1345,7 +1356,7 @@ Reference< XInputStream > SdrGrafObj::getInputStream()
}
}
- if( !xStream.is() && aFileName.Len() )
+ if (!xStream.is() && !aFileName.isEmpty())
{
SvFileStream* pStream = new SvFileStream( aFileName, STREAM_READ );
if( pStream )
commit 6964157be89119fe58347f7281207205236b05a6
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Fri Jan 20 15:32:08 2012 -0500
Provide a version that takes rtl::OUString.
diff --git a/sfx2/inc/sfx2/linkmgr.hxx b/sfx2/inc/sfx2/linkmgr.hxx
index 5aeaa7f..0258f95 100644
--- a/sfx2/inc/sfx2/linkmgr.hxx
+++ b/sfx2/inc/sfx2/linkmgr.hxx
@@ -114,12 +114,16 @@ public:
sal_Bool InsertDDELink( SvBaseLink* );
// Connect the links to a pseudo-object and add to the list
- sal_Bool InsertFileLink( sfx2::SvBaseLink&,
+ bool InsertFileLink( sfx2::SvBaseLink&,
sal_uInt16 nFileType,
- const String& rTxt,
+ const String& rFileNm,
const String* pFilterNm = 0,
const String* pRange = 0 );
+ bool InsertFileLink(
+ sfx2::SvBaseLink& rLink, sal_uInt16 nFileType, const rtl::OUString& rFileNm,
+ const rtl::OUString* pFilterNm = NULL, const rtl::OUString* pRange = NULL);
+
void ReconnectDdeLink(SfxObjectShell& rServer);
/**
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index 4984e6e..0e8607d 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -467,14 +467,14 @@ void LinkManager::LinkServerShell(const OUString& rPath, SfxObjectShell& rServer
}
}
-sal_Bool LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink,
+bool LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink,
sal_uInt16 nFileType,
const String& rFileNm,
const String* pFilterNm,
const String* pRange )
{
if( !( OBJECT_CLIENT_SO & rLink.GetObjType() ))
- return sal_False;
+ return false;
String sCmd( rFileNm );
sCmd += ::sfx2::cTokenSeperator;
@@ -486,6 +486,30 @@ sal_Bool LinkManager::InsertFileLink( sfx2::SvBaseLink& rLink,
return InsertLink( &rLink, nFileType, sfx2::LINKUPDATE_ONCALL, &sCmd );
}
+bool LinkManager::InsertFileLink(
+ sfx2::SvBaseLink& rLink, sal_uInt16 nFileType, const rtl::OUString& rFileNm,
+ const rtl::OUString* pFilterNm, const rtl::OUString* pRange)
+{
+ if (!(OBJECT_CLIENT_SO & rLink.GetObjType()))
+ return false;
+
+ rtl::OUStringBuffer aBuf;
+ aBuf.append(rFileNm);
+ aBuf.append(sfx2::cTokenSeperator);
+
+ if (pRange)
+ aBuf.append(*pRange);
+
+ if (pFilterNm)
+ {
+ aBuf.append(sfx2::cTokenSeperator);
+ aBuf.append(*pFilterNm);
+ }
+
+ String aCmd = aBuf.makeStringAndClear();
+ return InsertLink(&rLink, nFileType, sfx2::LINKUPDATE_ONCALL, &aCmd);
+}
+
// A transfer is aborted, so cancel all download media
// (for now this is only of interest for the file links!)
void LinkManager::CancelTransfers()
commit d36dd33fd263c5e34d6e8a78428f0b3a505bad36
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Fri Jan 20 15:04:53 2012 -0500
Provide a version that takes rtl::OUString.
diff --git a/sfx2/inc/sfx2/linkmgr.hxx b/sfx2/inc/sfx2/linkmgr.hxx
index 698eca8..5aeaa7f 100644
--- a/sfx2/inc/sfx2/linkmgr.hxx
+++ b/sfx2/inc/sfx2/linkmgr.hxx
@@ -132,12 +132,16 @@ public:
void LinkServerShell(const ::rtl::OUString& rPath, SfxObjectShell& rServer, ::sfx2::SvBaseLink& rLink) const;
// Obtain the string for the dialog
- sal_Bool GetDisplayNames( const SvBaseLink *,
+ bool GetDisplayNames( const SvBaseLink *,
String* pType,
String* pFile = 0,
String* pLink = 0,
String* pFilter = 0 ) const;
+ bool GetDisplayNames(
+ const SvBaseLink* pLink, rtl::OUString* pType, rtl::OUString* pFile = NULL,
+ rtl::OUString* pLinkStr = NULL, rtl::OUString* pFilter = NULL) const;
+
SvLinkSourceRef CreateObj( SvBaseLink* );
void UpdateAllLinks( sal_Bool bAskUpdate = sal_True,
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index b7a4970..4984e6e 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -231,13 +231,13 @@ sal_Bool LinkManager::InsertDDELink( SvBaseLink * pLink )
// Obtain the string for the dialog
-sal_Bool LinkManager::GetDisplayNames( const SvBaseLink * pLink,
+bool LinkManager::GetDisplayNames( const SvBaseLink * pLink,
String* pType,
String* pFile,
String* pLinkStr,
String* pFilter ) const
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
const String sLNm( pLink->GetLinkSourceName() );
if( sLNm.Len() )
{
@@ -266,7 +266,7 @@ sal_Bool LinkManager::GetDisplayNames( const SvBaseLink * pLink,
? RID_SVXSTR_FILELINK
: RID_SVXSTR_GRAFIKLINK ));
}
- bRet = sal_True;
+ bRet = true;
}
break;
case OBJECT_CLIENT_DDE:
@@ -282,7 +282,7 @@ sal_Bool LinkManager::GetDisplayNames( const SvBaseLink * pLink,
*pFile = sTopic;
if( pLinkStr )
*pLinkStr = sCmd.Copy( nTmp );
- bRet = sal_True;
+ bRet = true;
}
break;
default:
@@ -293,6 +293,22 @@ sal_Bool LinkManager::GetDisplayNames( const SvBaseLink * pLink,
return bRet;
}
+bool LinkManager::GetDisplayNames(
+ const SvBaseLink* pLink, rtl::OUString* pType, rtl::OUString* pFile,
+ rtl::OUString* pLinkStr, rtl::OUString* pFilter) const
+{
+ String aType, aFile, aLinkStr, aFilter;
+ bool bRet = GetDisplayNames(pLink, &aType, &aFile, &aLinkStr, &aFilter);
+ if (pType)
+ *pType = aType;
+ if (pFile)
+ *pFile = aFile;
+ if (pLinkStr)
+ *pLinkStr = aLinkStr;
+ if (pFilter)
+ *pFilter = aFilter;
+ return bRet;
+}
void LinkManager::UpdateAllLinks(
sal_Bool bAskUpdate,
commit 1b9b886afbbf8a6203abfa072c676b06b5b0d495
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Fri Jan 20 14:53:58 2012 -0500
sal_Bool to bool.
diff --git a/svx/inc/svx/svdograf.hxx b/svx/inc/svx/svdograf.hxx
index f2d4ad8..f11a1eb 100644
--- a/svx/inc/svx/svdograf.hxx
+++ b/svx/inc/svx/svdograf.hxx
@@ -71,7 +71,7 @@ public:
sal_Bool bMirrored;
SdrGrafObjGeoData()
- : bMirrored(sal_False)
+ : bMirrored(false)
{
}
};
@@ -104,21 +104,21 @@ private:
String aFilterName;
GraphicObject* pGraphic; // Zur Beschleunigung von Bitmapausgaben, besonders von gedrehten.
SdrGraphicLink* pGraphicLink; // Und hier noch ein Pointer fuer gelinkte Grafiken
- bool bMirrored; // True bedeutet, die Grafik ist horizontal, d.h. ueber die Y-Achse gespiegelt auszugeben.
+ bool bMirrored:1; // True bedeutet, die Grafik ist horizontal, d.h. ueber die Y-Achse gespiegelt auszugeben.
// #111096#
// Flag for allowing text animation. Default is sal_true.
- unsigned mbGrafAnimationAllowed : 1;
+ bool mbGrafAnimationAllowed:1;
// #i25616#
- unsigned mbInsidePaint : 1;
- unsigned mbIsPreview : 1;
+ bool mbInsidePaint:1;
+ bool mbIsPreview:1;
private:
void ImpLinkAnmeldung();
void ImpLinkAbmeldung();
- sal_Bool ImpUpdateGraphicLink( sal_Bool bAsynchron = sal_True ) const;
+ bool ImpUpdateGraphicLink( bool bAsynchron = true ) const;
void ImpSetLinkedGraphic( const Graphic& rGraphic );
DECL_LINK( ImpSwapHdl, GraphicObject* );
@@ -131,7 +131,7 @@ public:
virtual ~SdrGrafObj();
void SetGraphicObject( const GraphicObject& rGrfObj );
- const GraphicObject& GetGraphicObject( bool bForceSwapIn = false) const;
+ const GraphicObject& GetGraphicObject(bool bForceSwapIn = false) const;
void NbcSetGraphic(const Graphic& rGrf);
void SetGraphic(const Graphic& rGrf);
@@ -143,11 +143,11 @@ public:
// #111096#
// Keep ATM for SD.
- sal_Bool IsAnimated() const;
- sal_Bool IsEPS() const;
- sal_Bool IsRenderGraphic() const;
- sal_Bool HasRenderGraphic() const;
- sal_Bool IsSwappedOut() const;
+ bool IsAnimated() const;
+ bool IsEPS() const;
+ bool IsRenderGraphic() const;
+ bool HasRenderGraphic() const;
+ bool IsSwappedOut() const;
const MapMode& GetGrafPrefMapMode() const;
const Size& GetGrafPrefSize() const;
@@ -160,7 +160,7 @@ public:
void SetGraphicLink(const String& rFileName, const String& rFilterName);
void ReleaseGraphicLink();
- sal_Bool IsLinkedGraphic() const { return (sal_Bool)aFileName.Len(); }
+ bool IsLinkedGraphic() const;
const String& GetFileName() const { return aFileName; }
const String& GetFilterName() const { return aFilterName; }
@@ -203,12 +203,12 @@ public:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
- bool IsMirrored() { return bMirrored; }
- void SetMirrored( bool _bMirrored ) { bMirrored = _bMirrored; }
+ bool IsMirrored() const;
+ void SetMirrored( bool _bMirrored );
// #111096#
// Access to GrafAnimationAllowed flag
- void SetGrafAnimationAllowed(sal_Bool bNew);
+ void SetGrafAnimationAllowed(bool bNew);
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > getInputStream();
diff --git a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
index b2052db..75581d6 100644
--- a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
@@ -140,9 +140,9 @@ namespace sdr
else
{
// SwapIn direct
- rGrafObj.mbInsidePaint = sal_True;
+ rGrafObj.mbInsidePaint = true;
rGrafObj.ForceSwapIn();
- rGrafObj.mbInsidePaint = sal_False;
+ rGrafObj.mbInsidePaint = false;
}
bRetval = true;
@@ -192,9 +192,9 @@ namespace sdr
else
{
// SwapIn direct
- rGrafObj.mbInsidePaint = sal_True;
+ rGrafObj.mbInsidePaint = true;
rGrafObj.ForceSwapIn();
- rGrafObj.mbInsidePaint = sal_False;
+ rGrafObj.mbInsidePaint = false;
}
bRetval = true;
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 8686211..b317bba 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -93,7 +93,7 @@ const Graphic ImpLoadLinkedGraphic( const String aFileName, const String aFilter
{
Graphic aGraphic;
- SfxMedium xMed( aFileName, STREAM_STD_READ, sal_True );
+ SfxMedium xMed( aFileName, STREAM_STD_READ, true );
xMed.DownLoad();
SvStream* pInStrm = xMed.GetInStream();
@@ -114,7 +114,7 @@ const Graphic ImpLoadLinkedGraphic( const String aFileName, const String aFilter
// But this link is required by some filters to access the native graphic (PDF export/MS export),
// there we should create a new service to provide this data if needed
aFilterData[ 0 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CreateNativeLink" ) );
- aFilterData[ 0 ].Value = Any( sal_True );
+ aFilterData[ 0 ].Value = Any( true );
rGF.ImportGraphic( aGraphic, aEmptyStr, *pInStrm, nFilter, NULL, 0, &aFilterData );
}
return aGraphic;
@@ -176,7 +176,7 @@ SdrGraphicUpdater::SdrGraphicUpdater( const String& rFileName, const String& rFi
: maFileName( rFileName )
, maFilterName( rFilterName )
, mrGraphicLink( rGraphicLink )
-, mbIsTerminated( sal_False )
+, mbIsTerminated( false )
{
create();
}
@@ -187,7 +187,7 @@ SdrGraphicUpdater::~SdrGraphicUpdater( void )
void SdrGraphicUpdater::Terminate()
{
- mbIsTerminated = sal_True;
+ mbIsTerminated = true;
}
void SAL_CALL SdrGraphicUpdater::onTerminated(void)
@@ -213,7 +213,7 @@ SdrGraphicLink::SdrGraphicLink(SdrGrafObj* pObj)
, pGrafObj( pObj )
, pGraphicUpdater( NULL )
{
- SetSynchron( sal_False );
+ SetSynchron( false );
}
// -----------------------------------------------------------------------------
@@ -324,21 +324,21 @@ TYPEINIT1(SdrGrafObj,SdrRectObj);
SdrGrafObj::SdrGrafObj()
: SdrRectObj(),
pGraphicLink ( NULL ),
- bMirrored ( sal_False )
+ bMirrored ( false )
{
pGraphic = new GraphicObject;
pGraphic->SetSwapStreamHdl( LINK( this, SdrGrafObj, ImpSwapHdl ), SWAPGRAPHIC_TIMEOUT );
- bNoShear = sal_True;
+ bNoShear = true;
- mbGrafAnimationAllowed = sal_True;
+ mbGrafAnimationAllowed = true;
// #i25616#
- mbLineIsOutsideGeometry = sal_True;
- mbInsidePaint = sal_False;
- mbIsPreview = sal_False;
+ mbLineIsOutsideGeometry = true;
+ mbInsidePaint = false;
+ mbIsPreview = false;
// #i25616#
- mbSupportTextIndentingOnLineWidthChange = sal_False;
+ mbSupportTextIndentingOnLineWidthChange = false;
}
// -----------------------------------------------------------------------------
@@ -346,21 +346,21 @@ SdrGrafObj::SdrGrafObj()
SdrGrafObj::SdrGrafObj(const Graphic& rGrf, const Rectangle& rRect)
: SdrRectObj ( rRect ),
pGraphicLink ( NULL ),
- bMirrored ( sal_False )
+ bMirrored ( false )
{
pGraphic = new GraphicObject( rGrf );
pGraphic->SetSwapStreamHdl( LINK( this, SdrGrafObj, ImpSwapHdl ), SWAPGRAPHIC_TIMEOUT );
- bNoShear = sal_True;
+ bNoShear = true;
- mbGrafAnimationAllowed = sal_True;
+ mbGrafAnimationAllowed = true;
// #i25616#
- mbLineIsOutsideGeometry = sal_True;
- mbInsidePaint = sal_False;
- mbIsPreview = sal_False;
+ mbLineIsOutsideGeometry = true;
+ mbInsidePaint = false;
+ mbIsPreview = false;
// #i25616#
- mbSupportTextIndentingOnLineWidthChange = sal_False;
+ mbSupportTextIndentingOnLineWidthChange = false;
}
// -----------------------------------------------------------------------------
@@ -368,21 +368,21 @@ SdrGrafObj::SdrGrafObj(const Graphic& rGrf, const Rectangle& rRect)
SdrGrafObj::SdrGrafObj( const Graphic& rGrf )
: SdrRectObj(),
pGraphicLink ( NULL ),
- bMirrored ( sal_False )
+ bMirrored ( false )
{
pGraphic = new GraphicObject( rGrf );
pGraphic->SetSwapStreamHdl( LINK( this, SdrGrafObj, ImpSwapHdl ), SWAPGRAPHIC_TIMEOUT );
- bNoShear = sal_True;
+ bNoShear = true;
- mbGrafAnimationAllowed = sal_True;
+ mbGrafAnimationAllowed = true;
// #i25616#
- mbLineIsOutsideGeometry = sal_True;
- mbInsidePaint = sal_False;
- mbIsPreview = sal_False;
+ mbLineIsOutsideGeometry = true;
+ mbInsidePaint = false;
+ mbIsPreview = false;
// #i25616#
- mbSupportTextIndentingOnLineWidthChange = sal_False;
+ mbSupportTextIndentingOnLineWidthChange = false;
}
// -----------------------------------------------------------------------------
@@ -400,7 +400,7 @@ void SdrGrafObj::SetGraphicObject( const GraphicObject& rGrfObj )
*pGraphic = rGrfObj;
pGraphic->SetSwapStreamHdl( LINK( this, SdrGrafObj, ImpSwapHdl ), SWAPGRAPHIC_TIMEOUT );
pGraphic->SetUserData();
- mbIsPreview = sal_False;
+ mbIsPreview = false;
SetChanged();
BroadcastObjectChange();
}
@@ -423,7 +423,7 @@ void SdrGrafObj::NbcSetGraphic( const Graphic& rGrf )
{
pGraphic->SetGraphic( rGrf );
pGraphic->SetUserData();
- mbIsPreview = sal_False;
+ mbIsPreview = false;
}
void SdrGrafObj::SetGraphic( const Graphic& rGrf )
@@ -490,29 +490,29 @@ GraphicType SdrGrafObj::GetGraphicType() const
return pGraphic->GetType();
}
-sal_Bool SdrGrafObj::IsAnimated() const
+bool SdrGrafObj::IsAnimated() const
{
return pGraphic->IsAnimated();
}
-sal_Bool SdrGrafObj::IsEPS() const
+bool SdrGrafObj::IsEPS() const
{
return pGraphic->IsEPS();
}
-sal_Bool SdrGrafObj::IsRenderGraphic() const
+bool SdrGrafObj::IsRenderGraphic() const
{
return pGraphic->IsRenderGraphic();
}
-sal_Bool SdrGrafObj::HasRenderGraphic() const
+bool SdrGrafObj::HasRenderGraphic() const
{
return pGraphic->HasRenderGraphic();
}
-sal_Bool SdrGrafObj::IsSwappedOut() const
+bool SdrGrafObj::IsSwappedOut() const
{
- return mbIsPreview ? sal_True : pGraphic->IsSwappedOut();
+ return mbIsPreview ? true : pGraphic->IsSwappedOut();
}
const MapMode& SdrGrafObj::GetGrafPrefMapMode() const
@@ -529,7 +529,7 @@ const Size& SdrGrafObj::GetGrafPrefSize() const
void SdrGrafObj::SetGrafStreamURL( const String& rGraphicStreamURL )
{
- mbIsPreview = sal_False;
+ mbIsPreview = false;
if( !rGraphicStreamURL.Len() )
{
pGraphic->SetUserData();
@@ -565,10 +565,10 @@ void SdrGrafObj::ForceSwapIn() const
pGraphic->SetUserData( aUserData );
pGraphic->SetSwapState();
- const_cast< SdrGrafObj* >( this )->mbIsPreview = sal_False;
+ const_cast< SdrGrafObj* >( this )->mbIsPreview = false;
}
if ( pGraphicLink && pGraphic->IsSwappedOut() )
- ImpUpdateGraphicLink( sal_False );
+ ImpUpdateGraphicLink( false );
else
pGraphic->FireSwapInRequest();
@@ -643,6 +643,11 @@ void SdrGrafObj::ReleaseGraphicLink()
aFilterName = String();
}
+bool SdrGrafObj::IsLinkedGraphic() const
+{
+ return aFileName.Len() > 0;
+}
+
// -----------------------------------------------------------------------------
void SdrGrafObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
@@ -655,19 +660,19 @@ void SdrGrafObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
aGeo.nDrehWink % 18000 == 0 ||
aGeo.nDrehWink % 27000 == 0;
- rInfo.bResizePropAllowed = sal_True;
+ rInfo.bResizePropAllowed = true;
rInfo.bRotateFreeAllowed = bNoPresGrf && !bAnim && !bRenderGraphic;
rInfo.bRotate90Allowed = bNoPresGrf && !bAnim && !bRenderGraphic;
rInfo.bMirrorFreeAllowed = bNoPresGrf && !bAnim && !bRenderGraphic;
rInfo.bMirror45Allowed = bNoPresGrf && !bAnim && !bRenderGraphic;
rInfo.bMirror90Allowed = !bEmptyPresObj && !bRenderGraphic;
- rInfo.bTransparenceAllowed = sal_False;
- rInfo.bGradientAllowed = sal_False;
- rInfo.bShearAllowed = sal_False;
- rInfo.bEdgeRadiusAllowed=sal_False;
- rInfo.bCanConvToPath = sal_False;
- rInfo.bCanConvToPathLineToArea = sal_False;
- rInfo.bCanConvToPolyLineToArea = sal_False;
+ rInfo.bTransparenceAllowed = false;
+ rInfo.bGradientAllowed = false;
+ rInfo.bShearAllowed = false;
+ rInfo.bEdgeRadiusAllowed=false;
+ rInfo.bCanConvToPath = false;
+ rInfo.bCanConvToPathLineToArea = false;
+ rInfo.bCanConvToPolyLineToArea = false;
rInfo.bCanConvToPoly = !IsEPS() && !bRenderGraphic;
rInfo.bCanConvToContour = (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary());
}
@@ -684,16 +689,16 @@ sal_uInt16 SdrGrafObj::GetObjIdentifier() const
/* The graphic of the GraphicLink will be loaded. If it is called with
bAsynchron = true then the graphic will be set later via DataChanged
*/
-sal_Bool SdrGrafObj::ImpUpdateGraphicLink( sal_Bool bAsynchron ) const
+bool SdrGrafObj::ImpUpdateGraphicLink( bool bAsynchron ) const
{
- sal_Bool bRet = sal_False;
+ bool bRet = false;
if( pGraphicLink )
{
if ( bAsynchron )
pGraphicLink->UpdateAsynchron();
else
pGraphicLink->DataChanged( ImpLoadLinkedGraphic( aFileName, aFilterName ) );
- bRet = sal_True;
+ bRet = true;
}
return bRet;
}
@@ -1002,7 +1007,7 @@ void SdrGrafObj::SetModel( SdrModel* pNewModel )
void SdrGrafObj::StartAnimation( OutputDevice* /*pOutDev*/, const Point& /*rPoint*/, const Size& /*rSize*/, long /*nExtraData*/)
{
- SetGrafAnimationAllowed(sal_True);
+ SetGrafAnimationAllowed(true);
}
// -----------------------------------------------------------------------------
@@ -1077,7 +1082,7 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(sal_Bool bBezier) const
Bitmap aBitmap( GetTransformedGraphic().GetBitmap() );
XOBitmap aXBmp(aBitmap, XBITMAP_STRETCH);
aSet.Put(XFillBitmapItem(String(), aXBmp));
- aSet.Put(XFillBmpTileItem(sal_False));
+ aSet.Put(XFillBmpTileItem(false));
pRetval->SetMergedItemSet(aSet);
}
@@ -1103,6 +1108,16 @@ void SdrGrafObj::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
ImpSetAttrToGrafInfo();
}
+bool SdrGrafObj::IsMirrored() const
+{
+ return bMirrored;
+}
+
+void SdrGrafObj::SetMirrored( bool _bMirrored )
+{
+ bMirrored = _bMirrored;
+}
+
void SdrGrafObj::ImpSetAttrToGrafInfo()
{
const SfxItemSet& rSet = GetObjectItemSet();
@@ -1239,8 +1254,8 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
pFilterData = new com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >( 3 );
com::sun::star::awt::Size aPreviewSizeHint( 64, 64 );
- sal_Bool bAllowPartialStreamRead = sal_True;
- sal_Bool bCreateNativeLink = sal_False;
+ sal_Bool bAllowPartialStreamRead = true;
+ sal_Bool bCreateNativeLink = false;
(*pFilterData)[ 0 ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "PreviewSizeHint" ) );
(*pFilterData)[ 0 ].Value <<= aPreviewSizeHint;
(*pFilterData)[ 1 ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "AllowPartialStreamRead" ) );
@@ -1248,7 +1263,7 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
(*pFilterData)[ 2 ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "CreateNativeLink" ) );
(*pFilterData)[ 2 ].Value <<= bCreateNativeLink;
- mbIsPreview = sal_True;
+ mbIsPreview = true;
}
if( !GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic,
@@ -1270,7 +1285,7 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
pStream->ResetError();
}
}
- else if( !ImpUpdateGraphicLink( sal_False ) )
+ else if( !ImpUpdateGraphicLink( false ) )
{
pRet = GRFMGR_AUTOSWAPSTREAM_TEMP;
}
@@ -1288,7 +1303,7 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
// -----------------------------------------------------------------------------
-void SdrGrafObj::SetGrafAnimationAllowed(sal_Bool bNew)
+void SdrGrafObj::SetGrafAnimationAllowed(bool bNew)
{
if(mbGrafAnimationAllowed != bNew)
{
@@ -1324,8 +1339,8 @@ Reference< XInputStream > SdrGrafObj::getInputStream()
memcpy( pBuffer, pSourceData, nSize );
SvMemoryStream* pStream = new SvMemoryStream( (void*)pBuffer, (sal_Size)nSize, STREAM_READ );
- pStream->ObjectOwnsMemory( sal_True );
- xStream.set( new utl::OInputStreamWrapper( pStream, sal_True ) );
+ pStream->ObjectOwnsMemory( true );
+ xStream.set( new utl::OInputStreamWrapper( pStream, true ) );
}
}
}
More information about the Libreoffice-commits
mailing list