diff options
Diffstat (limited to 'writerfilter/source/dmapper/GraphicHelpers.cxx')
-rw-r--r-- | writerfilter/source/dmapper/GraphicHelpers.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx b/writerfilter/source/dmapper/GraphicHelpers.cxx index 7e21f0f2dfb1..3d410b2e809a 100644 --- a/writerfilter/source/dmapper/GraphicHelpers.cxx +++ b/writerfilter/source/dmapper/GraphicHelpers.cxx @@ -29,8 +29,12 @@ #include <com/sun/star/text/WrapTextMode.hpp> #include <oox/drawingml/drawingmltypes.hxx> +#include <tools/resmgr.hxx> +#include <vcl/svapp.hxx> +#include <svx/svdstr.hrc> #include <iostream> +#include <memory> namespace writerfilter { namespace dmapper { @@ -284,6 +288,26 @@ sal_Int32 GraphicZOrderHelper::findZOrder( sal_Int32 relativeHeight, bool bOldSt return 0; // this should not(?) happen } +GraphicNamingHelper::GraphicNamingHelper() + : m_nCounter(0) +{ +} + +OUString GraphicNamingHelper::NameGraphic(const OUString& rTemplate) +{ + OUString aRet = rTemplate; + + if (aRet.isEmpty()) + { + // Empty template: then auto-generate a unique name. + std::unique_ptr<ResMgr> pResMgr(ResMgr::CreateResMgr("svx", Application::GetSettings().GetUILanguageTag())); + OUString aPrefix(ResId(STR_ObjNameSingulGRAF, *pResMgr).toString()); + aRet += aPrefix + OUString::number(++m_nCounter); + } + + return aRet; +} + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |