improve function-local statics in dbaccess..filter
Change-Id: I64939ad4b6c53696e33300114db384abfe73f13f Reviewed-on: https://gerrit.libreoffice.org/63702 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -70,18 +70,19 @@ OXMLDataSourceSetting::OXMLDataSourceSetting( ODBFilter& rImport
|
|||||||
case XML_TOK_DATA_SOURCE_SETTING_TYPE:
|
case XML_TOK_DATA_SOURCE_SETTING_TYPE:
|
||||||
{
|
{
|
||||||
// needs to be translated into a css::uno::Type
|
// needs to be translated into a css::uno::Type
|
||||||
static std::map< OUString, css::uno::Type > s_aTypeNameMap;
|
static std::map< OUString, css::uno::Type > s_aTypeNameMap = [&]()
|
||||||
if (s_aTypeNameMap.empty())
|
|
||||||
{
|
{
|
||||||
s_aTypeNameMap[GetXMLToken( XML_BOOLEAN)] = cppu::UnoType<bool>::get();
|
std::map< OUString, css::uno::Type > tmp;
|
||||||
|
tmp[GetXMLToken( XML_BOOLEAN)] = cppu::UnoType<bool>::get();
|
||||||
// Not a copy paste error, see comment xmloff/source/forms/propertyimport.cxx lines 244-248
|
// Not a copy paste error, see comment xmloff/source/forms/propertyimport.cxx lines 244-248
|
||||||
s_aTypeNameMap[GetXMLToken( XML_FLOAT)] = ::cppu::UnoType<double>::get();
|
tmp[GetXMLToken( XML_FLOAT)] = ::cppu::UnoType<double>::get();
|
||||||
s_aTypeNameMap[GetXMLToken( XML_DOUBLE)] = ::cppu::UnoType<double>::get();
|
tmp[GetXMLToken( XML_DOUBLE)] = ::cppu::UnoType<double>::get();
|
||||||
s_aTypeNameMap[GetXMLToken( XML_STRING)] = ::cppu::UnoType<OUString>::get();
|
tmp[GetXMLToken( XML_STRING)] = ::cppu::UnoType<OUString>::get();
|
||||||
s_aTypeNameMap[GetXMLToken( XML_INT)] = ::cppu::UnoType<sal_Int32>::get();
|
tmp[GetXMLToken( XML_INT)] = ::cppu::UnoType<sal_Int32>::get();
|
||||||
s_aTypeNameMap[GetXMLToken( XML_SHORT)] = ::cppu::UnoType<sal_Int16>::get();
|
tmp[GetXMLToken( XML_SHORT)] = ::cppu::UnoType<sal_Int16>::get();
|
||||||
s_aTypeNameMap[GetXMLToken( XML_VOID)] = cppu::UnoType<void>::get();
|
tmp[GetXMLToken( XML_VOID)] = cppu::UnoType<void>::get();
|
||||||
}
|
return tmp;
|
||||||
|
}();
|
||||||
|
|
||||||
const std::map< OUString, css::uno::Type >::const_iterator aTypePos = s_aTypeNameMap.find(sValue);
|
const std::map< OUString, css::uno::Type >::const_iterator aTypePos = s_aTypeNameMap.find(sValue);
|
||||||
OSL_ENSURE(s_aTypeNameMap.end() != aTypePos, "OXMLDataSourceSetting::OXMLDataSourceSetting: invalid type!");
|
OSL_ENSURE(s_aTypeNameMap.end() != aTypePos, "OXMLDataSourceSetting::OXMLDataSourceSetting: invalid type!");
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
#include <cppuhelper/factory.hxx>
|
#include <cppuhelper/factory.hxx>
|
||||||
#include <flt_reghelper.hxx>
|
#include <flt_reghelper.hxx>
|
||||||
#include "xmlservices.hxx"
|
#include "xmlservices.hxx"
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
using namespace ::dbaxml;
|
using namespace ::dbaxml;
|
||||||
using namespace ::com::sun::star::uno;
|
using namespace ::com::sun::star::uno;
|
||||||
@@ -30,8 +31,8 @@ extern "C" {
|
|||||||
|
|
||||||
static void createRegistryInfo_dbaxml()
|
static void createRegistryInfo_dbaxml()
|
||||||
{
|
{
|
||||||
static bool bInit = false;
|
static std::once_flag aInit;
|
||||||
if (!bInit)
|
std::call_once(aInit, [&]()
|
||||||
{
|
{
|
||||||
createRegistryInfo_DBTypeDetection();
|
createRegistryInfo_DBTypeDetection();
|
||||||
createRegistryInfo_ODBFilter();
|
createRegistryInfo_ODBFilter();
|
||||||
@@ -39,8 +40,8 @@ static void createRegistryInfo_dbaxml()
|
|||||||
createRegistryInfo_OSettingsExport();
|
createRegistryInfo_OSettingsExport();
|
||||||
createRegistryInfo_OFullExport();
|
createRegistryInfo_OFullExport();
|
||||||
createRegistryInfo_DBContentLoader2();
|
createRegistryInfo_DBContentLoader2();
|
||||||
bInit = true;
|
return true;
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -87,9 +87,9 @@ namespace dbaui
|
|||||||
static const FeatureSet& lcl_getFeatureSet( const OUString& _rURL )
|
static const FeatureSet& lcl_getFeatureSet( const OUString& _rURL )
|
||||||
{
|
{
|
||||||
typedef std::map< OUString, FeatureSet > FeatureSets;
|
typedef std::map< OUString, FeatureSet > FeatureSets;
|
||||||
static FeatureSets s_aFeatureSets;
|
static FeatureSets s_aFeatureSets = [&]()
|
||||||
if ( s_aFeatureSets.empty() )
|
|
||||||
{
|
{
|
||||||
|
FeatureSets tmp;
|
||||||
::connectivity::DriversConfig aDriverConfig( ::comphelper::getProcessComponentContext() );
|
::connectivity::DriversConfig aDriverConfig( ::comphelper::getProcessComponentContext() );
|
||||||
const uno::Sequence< OUString > aPatterns = aDriverConfig.getURLs();
|
const uno::Sequence< OUString > aPatterns = aDriverConfig.getURLs();
|
||||||
for ( auto const & pattern : aPatterns )
|
for ( auto const & pattern : aPatterns )
|
||||||
@@ -105,9 +105,10 @@ namespace dbaui
|
|||||||
++pFeatureMapping;
|
++pFeatureMapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
s_aFeatureSets[ pattern ] = aCurrentSet;
|
tmp[ pattern ] = aCurrentSet;
|
||||||
}
|
}
|
||||||
}
|
return tmp;
|
||||||
|
}();
|
||||||
|
|
||||||
OSL_ENSURE( s_aFeatureSets.find( _rURL ) != s_aFeatureSets.end(), "invalid URL/pattern!" );
|
OSL_ENSURE( s_aFeatureSets.find( _rURL ) != s_aFeatureSets.end(), "invalid URL/pattern!" );
|
||||||
return s_aFeatureSets[ _rURL ];
|
return s_aFeatureSets[ _rURL ];
|
||||||
@@ -115,9 +116,9 @@ namespace dbaui
|
|||||||
|
|
||||||
static AuthenticationMode getAuthenticationMode( const OUString& _sURL )
|
static AuthenticationMode getAuthenticationMode( const OUString& _sURL )
|
||||||
{
|
{
|
||||||
static std::map< OUString, FeatureSupport > s_aSupport;
|
static std::map< OUString, FeatureSupport > s_aSupport = [&]()
|
||||||
if ( s_aSupport.empty() )
|
|
||||||
{
|
{
|
||||||
|
std::map< OUString, FeatureSupport > tmp;
|
||||||
::connectivity::DriversConfig aDriverConfig(::comphelper::getProcessComponentContext());
|
::connectivity::DriversConfig aDriverConfig(::comphelper::getProcessComponentContext());
|
||||||
const uno::Sequence< OUString > aURLs = aDriverConfig.getURLs();
|
const uno::Sequence< OUString > aURLs = aDriverConfig.getURLs();
|
||||||
const OUString* pIter = aURLs.getConstArray();
|
const OUString* pIter = aURLs.getConstArray();
|
||||||
@@ -135,9 +136,10 @@ namespace dbaui
|
|||||||
else if ( sAuth == "Password" )
|
else if ( sAuth == "Password" )
|
||||||
aInit = FeatureSupport(AuthPwd);
|
aInit = FeatureSupport(AuthPwd);
|
||||||
}
|
}
|
||||||
s_aSupport.insert(std::make_pair(*pIter,aInit));
|
tmp.insert(std::make_pair(*pIter,aInit));
|
||||||
}
|
}
|
||||||
}
|
return tmp;
|
||||||
|
}();
|
||||||
OSL_ENSURE(s_aSupport.find(_sURL) != s_aSupport.end(),"Illegal URL!");
|
OSL_ENSURE(s_aSupport.find(_sURL) != s_aSupport.end(),"Illegal URL!");
|
||||||
return s_aSupport[ _sURL ].eAuthentication;
|
return s_aSupport[ _sURL ].eAuthentication;
|
||||||
}
|
}
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
#include <cppuhelper/factory.hxx>
|
#include <cppuhelper/factory.hxx>
|
||||||
#include <dbu_reghelper.hxx>
|
#include <dbu_reghelper.hxx>
|
||||||
#include <uiservices.hxx>
|
#include <uiservices.hxx>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
using namespace ::dbaui;
|
using namespace ::dbaui;
|
||||||
using namespace ::com::sun::star::uno;
|
using namespace ::com::sun::star::uno;
|
||||||
@@ -30,8 +31,8 @@ extern "C" {
|
|||||||
|
|
||||||
static void createRegistryInfo_DBU()
|
static void createRegistryInfo_DBU()
|
||||||
{
|
{
|
||||||
static bool bInit = false;
|
static std::once_flag aInit;
|
||||||
if (!bInit)
|
std::call_once(aInit, [&]()
|
||||||
{
|
{
|
||||||
createRegistryInfo_OTableFilterDialog();
|
createRegistryInfo_OTableFilterDialog();
|
||||||
createRegistryInfo_ODataSourcePropertyDialog();
|
createRegistryInfo_ODataSourcePropertyDialog();
|
||||||
@@ -57,8 +58,8 @@ static void createRegistryInfo_DBU()
|
|||||||
createRegistryInfo_CopyTableWizard();
|
createRegistryInfo_CopyTableWizard();
|
||||||
createRegistryInfo_OTextConnectionSettingsDialog();
|
createRegistryInfo_OTextConnectionSettingsDialog();
|
||||||
createRegistryInfo_LimitBoxController();
|
createRegistryInfo_LimitBoxController();
|
||||||
bInit = true;
|
return true;
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -239,13 +239,12 @@ static TransliterationWrapper& GetIgnoreTranslWrapper()
|
|||||||
}
|
}
|
||||||
static CollatorWrapper& GetCollatorWrapper()
|
static CollatorWrapper& GetCollatorWrapper()
|
||||||
{
|
{
|
||||||
static int bIsInit = 0;
|
static CollatorWrapper aCollWrp = [&]()
|
||||||
static CollatorWrapper aCollWrp( ::comphelper::getProcessComponentContext() );
|
|
||||||
if( !bIsInit )
|
|
||||||
{
|
{
|
||||||
aCollWrp.loadDefaultCollator( GetAppLang().getLocale(), 0 );
|
CollatorWrapper tmp( ::comphelper::getProcessComponentContext() );
|
||||||
bIsInit = 1;
|
tmp.loadDefaultCollator( GetAppLang().getLocale(), 0 );
|
||||||
}
|
return tmp;
|
||||||
|
}();
|
||||||
return aCollWrp;
|
return aCollWrp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -40,20 +40,17 @@ const char cDataSourceHistory[] = "DataSourceHistory";
|
|||||||
|
|
||||||
Sequence<OUString> const & BibConfig::GetPropertyNames()
|
Sequence<OUString> const & BibConfig::GetPropertyNames()
|
||||||
{
|
{
|
||||||
static Sequence<OUString> aNames;
|
static Sequence<OUString> aNames =
|
||||||
if(!aNames.getLength())
|
|
||||||
{
|
{
|
||||||
aNames.realloc(8);
|
"CurrentDataSource/DataSourceName",
|
||||||
OUString* pNames = aNames.getArray();
|
"CurrentDataSource/Command",
|
||||||
pNames[0] = "CurrentDataSource/DataSourceName";
|
"CurrentDataSource/CommandType",
|
||||||
pNames[1] = "CurrentDataSource/Command";
|
"BeamerHeight",
|
||||||
pNames[2] = "CurrentDataSource/CommandType";
|
"ViewHeight",
|
||||||
pNames[3] = "BeamerHeight";
|
"QueryText",
|
||||||
pNames[4] = "ViewHeight";
|
"QueryField",
|
||||||
pNames[5] = "QueryText";
|
"ShowColumnAssignmentWarning"
|
||||||
pNames[6] = "QueryField";
|
};
|
||||||
pNames[7] = "ShowColumnAssignmentWarning";
|
|
||||||
}
|
|
||||||
return aNames;
|
return aNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <componentmodule.hxx>
|
#include <componentmodule.hxx>
|
||||||
#include "dbpservices.hxx"
|
#include "dbpservices.hxx"
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
using namespace ::com::sun::star::uno;
|
using namespace ::com::sun::star::uno;
|
||||||
using namespace ::com::sun::star::lang;
|
using namespace ::com::sun::star::lang;
|
||||||
@@ -28,14 +29,14 @@ extern "C" {
|
|||||||
|
|
||||||
static void dbp_initializeModule()
|
static void dbp_initializeModule()
|
||||||
{
|
{
|
||||||
static bool s_bInit = false;
|
std::once_flag aInit;
|
||||||
if (!s_bInit)
|
std::call_once(aInit, [&]()
|
||||||
{
|
{
|
||||||
createRegistryInfo_OGroupBoxWizard();
|
createRegistryInfo_OGroupBoxWizard();
|
||||||
createRegistryInfo_OListComboWizard();
|
createRegistryInfo_OListComboWizard();
|
||||||
createRegistryInfo_OGridWizard();
|
createRegistryInfo_OGridWizard();
|
||||||
s_bInit = true;
|
return true;
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "modulepcr.hxx"
|
#include "modulepcr.hxx"
|
||||||
#include "pcrservices.hxx"
|
#include "pcrservices.hxx"
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
using namespace ::com::sun::star::uno;
|
using namespace ::com::sun::star::uno;
|
||||||
using namespace ::com::sun::star::lang;
|
using namespace ::com::sun::star::lang;
|
||||||
@@ -29,8 +30,8 @@ extern "C" {
|
|||||||
|
|
||||||
static void pcr_initializeModule()
|
static void pcr_initializeModule()
|
||||||
{
|
{
|
||||||
static bool s_bInit = false;
|
std::once_flag aInit;
|
||||||
if (!s_bInit)
|
std::call_once(aInit, [&]()
|
||||||
{
|
{
|
||||||
createRegistryInfo_OPropertyBrowserController();
|
createRegistryInfo_OPropertyBrowserController();
|
||||||
createRegistryInfo_FormController();
|
createRegistryInfo_FormController();
|
||||||
@@ -51,8 +52,8 @@ static void pcr_initializeModule()
|
|||||||
createRegistryInfo_StringRepresentation();
|
createRegistryInfo_StringRepresentation();
|
||||||
createRegistryInfo_MasterDetailLinkDialog();
|
createRegistryInfo_MasterDetailLinkDialog();
|
||||||
createRegistryInfo_FormGeometryHandler();
|
createRegistryInfo_FormGeometryHandler();
|
||||||
s_bInit = true;
|
return true;
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -303,9 +303,8 @@ static void SetByte(sal_uInt16& nx, sal_uInt16 ny, vcl::bitmap::RawBitmap& rBitm
|
|||||||
|
|
||||||
//=================== methods of PictReader ==============================
|
//=================== methods of PictReader ==============================
|
||||||
rtl_TextEncoding PictReader::GetTextEncoding (sal_uInt16 fId) {
|
rtl_TextEncoding PictReader::GetTextEncoding (sal_uInt16 fId) {
|
||||||
static bool first = true;
|
static rtl_TextEncoding enc = [&]()
|
||||||
static rtl_TextEncoding enc = RTL_TEXTENCODING_APPLE_ROMAN;
|
{
|
||||||
if (first) {
|
|
||||||
rtl_TextEncoding def = osl_getThreadTextEncoding();
|
rtl_TextEncoding def = osl_getThreadTextEncoding();
|
||||||
// we keep osl_getThreadTextEncoding only if it is a mac encoding
|
// we keep osl_getThreadTextEncoding only if it is a mac encoding
|
||||||
switch(def) {
|
switch(def) {
|
||||||
@@ -329,11 +328,12 @@ rtl_TextEncoding PictReader::GetTextEncoding (sal_uInt16 fId) {
|
|||||||
case RTL_TEXTENCODING_APPLE_CHINTRAD:
|
case RTL_TEXTENCODING_APPLE_CHINTRAD:
|
||||||
case RTL_TEXTENCODING_APPLE_JAPANESE:
|
case RTL_TEXTENCODING_APPLE_JAPANESE:
|
||||||
case RTL_TEXTENCODING_APPLE_KOREAN:
|
case RTL_TEXTENCODING_APPLE_KOREAN:
|
||||||
enc = def; break;
|
return def; break;
|
||||||
default: break;
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
first = false;
|
return RTL_TEXTENCODING_APPLE_ROMAN;
|
||||||
}
|
}();
|
||||||
if (fId == 13) return RTL_TEXTENCODING_ADOBE_DINGBATS; // CHECKME
|
if (fId == 13) return RTL_TEXTENCODING_ADOBE_DINGBATS; // CHECKME
|
||||||
if (fId == 23) return RTL_TEXTENCODING_ADOBE_SYMBOL;
|
if (fId == 23) return RTL_TEXTENCODING_ADOBE_SYMBOL;
|
||||||
return enc;
|
return enc;
|
||||||
|
@@ -689,14 +689,15 @@ KeyCodeEntry const aMSKeyCodesData[] = {
|
|||||||
|
|
||||||
awt::KeyEvent parseKeyEvent( const OUString& Key )
|
awt::KeyEvent parseKeyEvent( const OUString& Key )
|
||||||
{
|
{
|
||||||
static std::map< OUString, sal_uInt16 > s_KeyCodes;
|
static std::map< OUString, sal_uInt16 > s_KeyCodes = [&]()
|
||||||
if ( s_KeyCodes.empty() )
|
|
||||||
{
|
{
|
||||||
|
std::map< OUString, sal_uInt16 > tmp;
|
||||||
for (KeyCodeEntry const & i : aMSKeyCodesData)
|
for (KeyCodeEntry const & i : aMSKeyCodesData)
|
||||||
{
|
{
|
||||||
s_KeyCodes[ OUString::createFromAscii( i.sName ) ] = i.nCode;
|
tmp[ OUString::createFromAscii( i.sName ) ] = i.nCode;
|
||||||
}
|
}
|
||||||
}
|
return tmp;
|
||||||
|
}();
|
||||||
OUString sKeyCode;
|
OUString sKeyCode;
|
||||||
sal_uInt16 nVclKey = 0;
|
sal_uInt16 nVclKey = 0;
|
||||||
|
|
||||||
|
@@ -1167,40 +1167,37 @@ static struct {
|
|||||||
{"textBox", mso_sptTextBox},
|
{"textBox", mso_sptTextBox},
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::unordered_map< const char*, const char*, rtl::CStringHash, rtl::CStringEqual> CustomShapeTypeTranslationHashMap;
|
|
||||||
static CustomShapeTypeTranslationHashMap* pCustomShapeTypeTranslationHashMap = nullptr;
|
|
||||||
|
|
||||||
const char* GetOOXMLPresetGeometry( const char* sShapeType )
|
const char* GetOOXMLPresetGeometry( const char* sShapeType )
|
||||||
{
|
{
|
||||||
if( pCustomShapeTypeTranslationHashMap == nullptr )
|
typedef std::unordered_map< const char*, const char*, rtl::CStringHash, rtl::CStringEqual> CustomShapeTypeTranslationHashMap;
|
||||||
|
static CustomShapeTypeTranslationHashMap aCustomShapeTypeTranslationHashMap = [&]()
|
||||||
{
|
{
|
||||||
pCustomShapeTypeTranslationHashMap = new CustomShapeTypeTranslationHashMap;
|
CustomShapeTypeTranslationHashMap tmp;
|
||||||
for(const msfilter::util::CustomShapeTypeTranslationTable& i : pCustomShapeTypeTranslationTable)
|
for(const msfilter::util::CustomShapeTypeTranslationTable& i : pCustomShapeTypeTranslationTable)
|
||||||
{
|
{
|
||||||
(*pCustomShapeTypeTranslationHashMap)[ i.sOOo ] = i.sMSO;
|
tmp[ i.sOOo ] = i.sMSO;
|
||||||
}
|
}
|
||||||
}
|
return tmp;
|
||||||
|
}();
|
||||||
CustomShapeTypeTranslationHashMap::iterator i(
|
CustomShapeTypeTranslationHashMap::iterator i(
|
||||||
pCustomShapeTypeTranslationHashMap->find(sShapeType));
|
aCustomShapeTypeTranslationHashMap.find(sShapeType));
|
||||||
return i == pCustomShapeTypeTranslationHashMap->end() ? "rect" : i->second;
|
return i == aCustomShapeTypeTranslationHashMap.end() ? "rect" : i->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef std::unordered_map< const char*, MSO_SPT, rtl::CStringHash, rtl::CStringEqual> DMLToVMLTranslationHashMap;
|
|
||||||
static DMLToVMLTranslationHashMap* pDMLToVMLMap;
|
|
||||||
|
|
||||||
MSO_SPT GETVMLShapeType(const OString& aType)
|
MSO_SPT GETVMLShapeType(const OString& aType)
|
||||||
{
|
{
|
||||||
const char* pDML = GetOOXMLPresetGeometry(aType.getStr());
|
typedef std::unordered_map< const char*, MSO_SPT, rtl::CStringHash, rtl::CStringEqual> DMLToVMLTranslationHashMap;
|
||||||
|
static DMLToVMLTranslationHashMap aDMLToVMLMap = [&]()
|
||||||
if (!pDMLToVMLMap)
|
|
||||||
{
|
{
|
||||||
pDMLToVMLMap = new DMLToVMLTranslationHashMap;
|
DMLToVMLTranslationHashMap tmp;
|
||||||
for (auto& i : pDMLToVMLTable)
|
for (auto& i : pDMLToVMLTable)
|
||||||
(*pDMLToVMLMap)[i.sDML] = i.nVML;
|
tmp[i.sDML] = i.nVML;
|
||||||
}
|
return tmp;
|
||||||
|
}();
|
||||||
|
|
||||||
DMLToVMLTranslationHashMap::iterator i(pDMLToVMLMap->find(pDML));
|
const char* pDML = GetOOXMLPresetGeometry(aType.getStr());
|
||||||
return i == pDMLToVMLMap->end() ? mso_sptNil : i->second;
|
DMLToVMLTranslationHashMap::iterator i(aDMLToVMLMap.find(pDML));
|
||||||
|
return i == aDMLToVMLMap.end() ? mso_sptNil : i->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HasTextBoxContent(sal_uInt32 nShapeType)
|
bool HasTextBoxContent(sal_uInt32 nShapeType)
|
||||||
|
@@ -78,7 +78,7 @@ struct application_info_impl
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
extern std::vector< application_info_impl* >& getApplicationInfos();
|
extern std::vector< application_info_impl > const & getApplicationInfos();
|
||||||
extern OUString getApplicationUIName( const OUString& rServiceName );
|
extern OUString getApplicationUIName( const OUString& rServiceName );
|
||||||
extern const application_info_impl* getApplicationInfo( const OUString& rServiceName );
|
extern const application_info_impl* getApplicationInfo( const OUString& rServiceName );
|
||||||
OUString XsltResId(const char* pId);
|
OUString XsltResId(const char* pId);
|
||||||
|
@@ -1186,74 +1186,64 @@ application_info_impl::application_info_impl( const sal_Char * pDocumentService,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector< application_info_impl* >& getApplicationInfos()
|
std::vector< application_info_impl > const & getApplicationInfos()
|
||||||
{
|
{
|
||||||
static std::vector< application_info_impl* > aInfos;
|
static std::vector< application_info_impl > const aInfos
|
||||||
|
|
||||||
if( aInfos.empty() )
|
|
||||||
{
|
{
|
||||||
aInfos.push_back( new application_info_impl(
|
{ "com.sun.star.text.TextDocument",
|
||||||
"com.sun.star.text.TextDocument",
|
|
||||||
STR_APPL_NAME_WRITER,
|
STR_APPL_NAME_WRITER,
|
||||||
"com.sun.star.comp.Writer.XMLImporter",
|
"com.sun.star.comp.Writer.XMLImporter",
|
||||||
"com.sun.star.comp.Writer.XMLExporter" ) );
|
"com.sun.star.comp.Writer.XMLExporter" },
|
||||||
|
|
||||||
aInfos.push_back( new application_info_impl(
|
{ "com.sun.star.sheet.SpreadsheetDocument",
|
||||||
"com.sun.star.sheet.SpreadsheetDocument",
|
|
||||||
STR_APPL_NAME_CALC,
|
STR_APPL_NAME_CALC,
|
||||||
"com.sun.star.comp.Calc.XMLImporter",
|
"com.sun.star.comp.Calc.XMLImporter",
|
||||||
"com.sun.star.comp.Calc.XMLExporter" ) );
|
"com.sun.star.comp.Calc.XMLExporter" },
|
||||||
|
|
||||||
aInfos.push_back( new application_info_impl(
|
{ "com.sun.star.presentation.PresentationDocument",
|
||||||
"com.sun.star.presentation.PresentationDocument",
|
|
||||||
STR_APPL_NAME_IMPRESS,
|
STR_APPL_NAME_IMPRESS,
|
||||||
"com.sun.star.comp.Impress.XMLImporter",
|
"com.sun.star.comp.Impress.XMLImporter",
|
||||||
"com.sun.star.comp.Impress.XMLExporter" ) );
|
"com.sun.star.comp.Impress.XMLExporter" },
|
||||||
|
|
||||||
aInfos.push_back( new application_info_impl(
|
{ "com.sun.star.drawing.DrawingDocument",
|
||||||
"com.sun.star.drawing.DrawingDocument",
|
|
||||||
STR_APPL_NAME_DRAW,
|
STR_APPL_NAME_DRAW,
|
||||||
"com.sun.star.comp.Draw.XMLImporter",
|
"com.sun.star.comp.Draw.XMLImporter",
|
||||||
"com.sun.star.comp.Draw.XMLExporter" ) );
|
"com.sun.star.comp.Draw.XMLExporter" },
|
||||||
|
|
||||||
// --- oasis file formats...
|
// --- oasis file formats...
|
||||||
aInfos.push_back( new application_info_impl(
|
{ "com.sun.star.text.TextDocument",
|
||||||
"com.sun.star.text.TextDocument",
|
|
||||||
STR_APPL_NAME_OASIS_WRITER,
|
STR_APPL_NAME_OASIS_WRITER,
|
||||||
"com.sun.star.comp.Writer.XMLOasisImporter",
|
"com.sun.star.comp.Writer.XMLOasisImporter",
|
||||||
"com.sun.star.comp.Writer.XMLOasisExporter" ) );
|
"com.sun.star.comp.Writer.XMLOasisExporter" },
|
||||||
|
|
||||||
aInfos.push_back( new application_info_impl(
|
{ "com.sun.star.sheet.SpreadsheetDocument",
|
||||||
"com.sun.star.sheet.SpreadsheetDocument",
|
|
||||||
STR_APPL_NAME_OASIS_CALC,
|
STR_APPL_NAME_OASIS_CALC,
|
||||||
"com.sun.star.comp.Calc.XMLOasisImporter",
|
"com.sun.star.comp.Calc.XMLOasisImporter",
|
||||||
"com.sun.star.comp.Calc.XMLOasisExporter" ) );
|
"com.sun.star.comp.Calc.XMLOasisExporter" },
|
||||||
|
|
||||||
aInfos.push_back( new application_info_impl(
|
{ "com.sun.star.presentation.PresentationDocument",
|
||||||
"com.sun.star.presentation.PresentationDocument",
|
|
||||||
STR_APPL_NAME_OASIS_IMPRESS,
|
STR_APPL_NAME_OASIS_IMPRESS,
|
||||||
"com.sun.star.comp.Impress.XMLOasisImporter",
|
"com.sun.star.comp.Impress.XMLOasisImporter",
|
||||||
"com.sun.star.comp.Impress.XMLOasisExporter" ) );
|
"com.sun.star.comp.Impress.XMLOasisExporter" },
|
||||||
|
|
||||||
aInfos.push_back( new application_info_impl(
|
{ "com.sun.star.drawing.DrawingDocument",
|
||||||
"com.sun.star.drawing.DrawingDocument",
|
|
||||||
STR_APPL_NAME_OASIS_DRAW,
|
STR_APPL_NAME_OASIS_DRAW,
|
||||||
"com.sun.star.comp.Draw.XMLOasisImporter",
|
"com.sun.star.comp.Draw.XMLOasisImporter",
|
||||||
"com.sun.star.comp.Draw.XMLOasisExporter" ) );
|
"com.sun.star.comp.Draw.XMLOasisExporter" },
|
||||||
}
|
};
|
||||||
|
|
||||||
return aInfos;
|
return aInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
const application_info_impl* getApplicationInfo( const OUString& rServiceName )
|
const application_info_impl* getApplicationInfo( const OUString& rServiceName )
|
||||||
{
|
{
|
||||||
std::vector< application_info_impl* >& rInfos = getApplicationInfos();
|
std::vector< application_info_impl > const & rInfos = getApplicationInfos();
|
||||||
for (auto const& info : rInfos)
|
for (auto const& info : rInfos)
|
||||||
{
|
{
|
||||||
if( rServiceName == info->maXMLExporter ||
|
if( rServiceName == info.maXMLExporter ||
|
||||||
rServiceName == info->maXMLImporter)
|
rServiceName == info.maXMLImporter)
|
||||||
{
|
{
|
||||||
return info;
|
return &info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@@ -34,10 +34,10 @@ XMLFilterTabPageBasic::XMLFilterTabPageBasic(weld::Widget* pPage)
|
|||||||
{
|
{
|
||||||
m_xEDDescription->set_size_request(-1, m_xEDDescription->get_height_rows(4));
|
m_xEDDescription->set_size_request(-1, m_xEDDescription->get_height_rows(4));
|
||||||
|
|
||||||
std::vector< application_info_impl* >& rInfos = getApplicationInfos();
|
std::vector< application_info_impl > const & rInfos = getApplicationInfos();
|
||||||
for (auto const& info : rInfos)
|
for (auto const& info : rInfos)
|
||||||
{
|
{
|
||||||
OUString aEntry( info->maDocumentUIName );
|
OUString aEntry( info.maDocumentUIName );
|
||||||
m_xCBApplication->append_text( aEntry );
|
m_xCBApplication->append_text( aEntry );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -92,14 +92,14 @@ void XMLFilterTabPageBasic::FillInfo( filter_info_impl* pInfo )
|
|||||||
|
|
||||||
if( !pInfo->maDocumentService.isEmpty() )
|
if( !pInfo->maDocumentService.isEmpty() )
|
||||||
{
|
{
|
||||||
std::vector< application_info_impl* >& rInfos = getApplicationInfos();
|
std::vector< application_info_impl > const & rInfos = getApplicationInfos();
|
||||||
for (auto const& info : rInfos)
|
for (auto const& info : rInfos)
|
||||||
{
|
{
|
||||||
if( pInfo->maDocumentService == info->maDocumentUIName )
|
if( pInfo->maDocumentService == info.maDocumentUIName )
|
||||||
{
|
{
|
||||||
pInfo->maDocumentService = info->maDocumentService;
|
pInfo->maDocumentService = info.maDocumentService;
|
||||||
pInfo->maExportService = info->maXMLExporter;
|
pInfo->maExportService = info.maXMLExporter;
|
||||||
pInfo->maImportService = info->maXMLImporter;
|
pInfo->maImportService = info.maXMLImporter;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user