[Libreoffice-commits] core.git: compilerplugins/clang vcl/headless vcl/inc vcl/osx vcl/source vcl/unx vcl/win
Noel Grandin
noel.grandin at collabora.co.uk
Thu Feb 9 09:51:29 UTC 2017
compilerplugins/clang/unusedenumconstants.py | 1 +
vcl/headless/svpinst.cxx | 6 ++----
vcl/inc/displayconnectiondispatch.hxx | 2 +-
vcl/inc/headless/svpinst.hxx | 2 +-
vcl/inc/osx/salinst.h | 3 +--
vcl/inc/salinst.hxx | 3 +--
vcl/inc/sft.hxx | 2 +-
vcl/inc/unx/salinst.h | 2 +-
vcl/inc/win/salinst.h | 2 +-
vcl/osx/salinst.cxx | 6 ++----
vcl/source/helper/displayconnectiondispatch.cxx | 15 ++-------------
vcl/unx/generic/app/salinst.cxx | 7 ++-----
vcl/win/app/salinst.cxx | 6 ++----
13 files changed, 18 insertions(+), 39 deletions(-)
New commits:
commit bca47d830eaf13f6032985982582dce3fd335e4e
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Wed Feb 8 13:04:44 2017 +0200
remove ConnectionIdentifierType enum
since we only use the AsciiCString enumerator.
Consequently simplify the GetConnectionIdentifier method
Change-Id: I9e1a1318d2f12bfd18edeb8479e0e7171b22d0f1
Reviewed-on: https://gerrit.libreoffice.org/34026
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/compilerplugins/clang/unusedenumconstants.py b/compilerplugins/clang/unusedenumconstants.py
index 340d0b9..9b4a821 100755
--- a/compilerplugins/clang/unusedenumconstants.py
+++ b/compilerplugins/clang/unusedenumconstants.py
@@ -104,6 +104,7 @@ for d in definitionSet:
"vcl/source/filter/sgvmain.hxx",
"vcl/source/filter/jpeg/transupp.h",
"include/vcl/bitmapex.hxx", # TransparentType
+ "vcl/inc/sft.hxx", # CompositeFlags, WidthClass, WeightClass
# unit test code
"cppu/source/uno/check.cxx",
# general weird nonsense going on
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 710305d..f46722d 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -415,11 +415,9 @@ SalSession* SvpSalInstance::CreateSalSession()
return nullptr;
}
-void* SvpSalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes )
+OUString SvpSalInstance::GetConnectionIdentifier()
{
- rReturnedBytes = 1;
- rReturnedType = AsciiCString;
- return const_cast<char*>("");
+ return OUString("");
}
void SvpSalInstance::StopTimer()
diff --git a/vcl/inc/displayconnectiondispatch.hxx b/vcl/inc/displayconnectiondispatch.hxx
index 0446899..3cc605f 100644
--- a/vcl/inc/displayconnectiondispatch.hxx
+++ b/vcl/inc/displayconnectiondispatch.hxx
@@ -38,7 +38,7 @@ class DisplayConnectionDispatch :
m_aHandlers;
::std::list< css::uno::Reference< css::awt::XEventHandler > >
m_aErrorHandlers;
- css::uno::Any m_aAny;
+ OUString m_ConnectionIdentifier;
public:
DisplayConnectionDispatch();
~DisplayConnectionDispatch() override;
diff --git a/vcl/inc/headless/svpinst.hxx b/vcl/inc/headless/svpinst.hxx
index e483775..731642f 100644
--- a/vcl/inc/headless/svpinst.hxx
+++ b/vcl/inc/headless/svpinst.hxx
@@ -163,7 +163,7 @@ public:
virtual OpenGLContext* CreateOpenGLContext() override;
- virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) override;
+ virtual OUString GetConnectionIdentifier() override;
virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType, const OUString& rDocumentService) override;
diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index b56b8df..151fea9 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -116,8 +116,7 @@ public:
virtual void DestroyMenuItem( SalMenuItem* ) override;
virtual SalSession* CreateSalSession() override;
virtual OpenGLContext* CreateOpenGLContext() override;
- virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType,
- int& rReturnedBytes ) override;
+ virtual OUString GetConnectionIdentifier() override;
virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType,
const OUString& rDocumentService) override;
diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx
index b5421f7..ca8017d 100644
--- a/vcl/inc/salinst.hxx
+++ b/vcl/inc/salinst.hxx
@@ -155,8 +155,7 @@ public:
bool CallEventCallback( void* pEvent, int nBytes );
- enum ConnectionIdentifierType { AsciiCString, Blob };
- virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) = 0;
+ virtual OUString GetConnectionIdentifier() = 0;
// dtrans implementation
virtual css::uno::Reference< css::uno::XInterface > CreateClipboard( const css::uno::Sequence< css::uno::Any >& i_rArguments );
diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx
index a694391..e1375cf 100644
--- a/vcl/inc/sft.hxx
+++ b/vcl/inc/sft.hxx
@@ -108,7 +108,7 @@ namespace vcl
KT_MICROSOFT = 2 /**< Microsoft table */
};
-/* Composite glyph flags definition */
+/** Composite glyph flags definition */
enum CompositeFlags {
ARG_1_AND_2_ARE_WORDS = 1,
ARGS_ARE_XY_VALUES = 1<<1,
diff --git a/vcl/inc/unx/salinst.h b/vcl/inc/unx/salinst.h
index 3c3934b..f3ca193 100644
--- a/vcl/inc/unx/salinst.h
+++ b/vcl/inc/unx/salinst.h
@@ -77,7 +77,7 @@ public:
virtual SalYieldResult DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) override;
virtual bool AnyInput( VclInputFlags nType ) override;
- virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) override;
+ virtual OUString GetConnectionIdentifier() override;
void SetLib( SalXLib *pXLib ) { mpXLib = pXLib; }
virtual void AfterAppInit() override;
diff --git a/vcl/inc/win/salinst.h b/vcl/inc/win/salinst.h
index 931437e..25b4afb 100644
--- a/vcl/inc/win/salinst.h
+++ b/vcl/inc/win/salinst.h
@@ -71,7 +71,7 @@ public:
virtual void DestroyMenuItem( SalMenuItem* ) override;
virtual SalSession* CreateSalSession() override;
virtual OpenGLContext* CreateOpenGLContext() override;
- virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ) override;
+ virtual OUString GetConnectionIdentifier() override;
virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType, const OUString& rDocumentService) override;
virtual OUString getOSVersion() override;
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 0bac909..84cc198 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -915,11 +915,9 @@ void AquaSalInstance::DestroyInfoPrinter( SalInfoPrinter* pPrinter )
delete pPrinter;
}
-void* AquaSalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes )
+OUString AquaSalInstance::GetConnectionIdentifier()
{
- rReturnedBytes = 1;
- rReturnedType = AsciiCString;
- return const_cast<char *>("");
+ return OUString("");
}
// We need to re-encode file urls because osl_getFileURLFromSystemPath converts
diff --git a/vcl/source/helper/displayconnectiondispatch.cxx b/vcl/source/helper/displayconnectiondispatch.cxx
index 60851598..5b3731e 100644
--- a/vcl/source/helper/displayconnectiondispatch.cxx
+++ b/vcl/source/helper/displayconnectiondispatch.cxx
@@ -30,18 +30,7 @@ using namespace com::sun::star::awt;
DisplayConnectionDispatch::DisplayConnectionDispatch()
{
- SalInstance::ConnectionIdentifierType eType;
- int nBytes;
- void* pBytes = ImplGetSVData()->mpDefInst->GetConnectionIdentifier( eType, nBytes );
- switch( eType )
- {
- case SalInstance::AsciiCString:
- m_aAny <<= OUString::createFromAscii( static_cast<sal_Char*>(pBytes) );
- break;
- case SalInstance::Blob:
- m_aAny <<= Sequence< sal_Int8 >( static_cast<sal_Int8*>(pBytes), nBytes );
- break;
- }
+ m_ConnectionIdentifier = ImplGetSVData()->mpDefInst->GetConnectionIdentifier();
}
DisplayConnectionDispatch::~DisplayConnectionDispatch()
@@ -103,7 +92,7 @@ void SAL_CALL DisplayConnectionDispatch::removeErrorHandler( const css::uno::Ref
Any SAL_CALL DisplayConnectionDispatch::getIdentifier()
{
- return m_aAny;
+ return Any(m_ConnectionIdentifier);
}
bool DisplayConnectionDispatch::dispatchEvent( void* pData, int nBytes )
diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx
index cf433df..88b4b2b 100644
--- a/vcl/unx/generic/app/salinst.cxx
+++ b/vcl/unx/generic/app/salinst.cxx
@@ -174,13 +174,10 @@ SalYieldResult X11SalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents,
return mpXLib->Yield( bWait, bHandleAllCurrentEvents );
}
-void* X11SalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType,
- int& rReturnedBytes )
+OUString X11SalInstance::GetConnectionIdentifier()
{
static const char* pDisplay = getenv( "DISPLAY" );
- rReturnedType = AsciiCString;
- rReturnedBytes = pDisplay ? strlen( pDisplay )+1 : 1;
- return pDisplay ? const_cast<char *>(pDisplay) : const_cast<char *>("");
+ return pDisplay ? OUString::createFromAscii(pDisplay) : OUString("");
}
SalFrame *X11SalInstance::CreateFrame( SalFrame *pParent, SalFrameStyleFlags nSalFrameStyle )
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 94ae96d..0d00e47 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -917,11 +917,9 @@ void WinSalInstance::DestroyObject( SalObject* pObject )
SendMessageW( mhComWnd, SAL_MSG_DESTROYOBJECT, 0, reinterpret_cast<LPARAM>(pObject) );
}
-void* WinSalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes )
+OUString WinSalInstance::GetConnectionIdentifier()
{
- rReturnedBytes = 1;
- rReturnedType = AsciiCString;
- return const_cast<char *>("");
+ return OUString("");
}
/** Add a file to the system shells recent document list if there is any.
More information about the Libreoffice-commits
mailing list