summaryrefslogtreecommitdiff
path: root/sfx2/source/doc
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r--sfx2/source/doc/doc.src5
-rw-r--r--sfx2/source/doc/graphhelp.cxx24
-rw-r--r--sfx2/source/doc/graphhelp.hxx6
-rw-r--r--sfx2/source/doc/graphhelp.src47
-rw-r--r--sfx2/source/doc/objstor.cxx6
-rw-r--r--sfx2/source/doc/templatedlg.cxx5
6 files changed, 21 insertions, 72 deletions
diff --git a/sfx2/source/doc/doc.src b/sfx2/source/doc/doc.src
index a85b510eef75..f884e0d6651d 100644
--- a/sfx2/source/doc/doc.src
+++ b/sfx2/source/doc/doc.src
@@ -304,9 +304,4 @@ String STR_QMSG_ERROR_OPENING_FILE_CONTINUE
Text [ en-US ] = "\nProceeding with import may cause data loss or corruption, and application may become unstable or crash.\n\nDo you want to ignore the error and attempt to continue loading the file?";
};
-Bitmap BMP_ACTION_REFRESH
-{
- File = "reload.png";
-};
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx
index 581895ba693f..be1c58bc96ef 100644
--- a/sfx2/source/doc/graphhelp.cxx
+++ b/sfx2/source/doc/graphhelp.cxx
@@ -52,6 +52,7 @@
#include <sfx2/sfxresid.hxx>
#include "graphhelp.hxx"
#include "doc.hrc"
+#include "bitmaps.hlst"
#include <memory>
@@ -205,16 +206,16 @@ bool GraphicHelper::getThumbnailFormatFromGDI_Impl(GDIMetaFile* pMetaFile, const
}
// static
-bool GraphicHelper::getThumbnailReplacement_Impl( sal_Int32 nResID, const uno::Reference< io::XStream >& xStream )
+bool GraphicHelper::getThumbnailReplacement_Impl(const OUString& rResID, const uno::Reference< io::XStream >& xStream )
{
bool bResult = false;
- if ( nResID && xStream.is() )
+ if (!rResID.isEmpty() && xStream.is())
{
uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
try
{
uno::Reference< graphic::XGraphicProvider > xGraphProvider(graphic::GraphicProvider::create(xContext));
- const OUString aURL{"private:resource/sfx/bitmapex/"+OUString::number( nResID )};
+ const OUString aURL{"private:graphicrepository/" + rResID};
uno::Sequence< beans::PropertyValue > aMediaProps( 1 );
aMediaProps[0].Name = "URL";
@@ -241,34 +242,33 @@ bool GraphicHelper::getThumbnailReplacement_Impl( sal_Int32 nResID, const uno::R
return bResult;
}
-
// static
-sal_uInt16 GraphicHelper::getThumbnailReplacementIDByFactoryName_Impl( const OUString& aFactoryShortName, bool /*bIsTemplate*/ )
+OUString GraphicHelper::getThumbnailReplacementIDByFactoryName_Impl( const OUString& aFactoryShortName, bool /*bIsTemplate*/ )
{
- sal_uInt16 nResult = 0;
+ OUString sResult;
if ( aFactoryShortName == "scalc" )
{
- nResult = BMP_128X128_CALC_DOC;
+ sResult = BMP_128X128_CALC_DOC;
}
else if ( aFactoryShortName == "sdraw" )
{
- nResult = BMP_128X128_DRAW_DOC;
+ sResult = BMP_128X128_DRAW_DOC;
}
else if ( aFactoryShortName == "simpress" )
{
- nResult = BMP_128X128_IMPRESS_DOC;
+ sResult = BMP_128X128_IMPRESS_DOC;
}
else if ( aFactoryShortName == "smath" )
{
- nResult = BMP_128X128_MATH_DOC;
+ sResult = BMP_128X128_MATH_DOC;
}
else if ( aFactoryShortName == "swriter" || aFactoryShortName.startsWith("swriter/") )
{
- nResult = BMP_128X128_WRITER_DOC;
+ sResult = BMP_128X128_WRITER_DOC;
}
- return nResult;
+ return sResult;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/graphhelp.hxx b/sfx2/source/doc/graphhelp.hxx
index f70ebccf5a10..8a1d8ac89d97 100644
--- a/sfx2/source/doc/graphhelp.hxx
+++ b/sfx2/source/doc/graphhelp.hxx
@@ -52,11 +52,11 @@ public:
GDIMetaFile* pMetaFile,
const css::uno::Reference< css::io::XStream >& xStream );
- static sal_uInt16 getThumbnailReplacementIDByFactoryName_Impl( const OUString& aFactoryShortName,
- bool bIsTemplate );
+ static OUString getThumbnailReplacementIDByFactoryName_Impl(const OUString& aFactoryShortName,
+ bool bIsTemplate);
static bool getThumbnailReplacement_Impl(
- sal_Int32 nResID,
+ const OUString& rResID,
const css::uno::Reference< css::io::XStream >& xStream );
};
diff --git a/sfx2/source/doc/graphhelp.src b/sfx2/source/doc/graphhelp.src
deleted file mode 100644
index db2357fc1ab0..000000000000
--- a/sfx2/source/doc/graphhelp.src
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "doc.hrc"
-
-Bitmap BMP_128X128_CALC_DOC
-{
- File = "128x128_calc_doc-p.png";
-};
-
-Bitmap BMP_128X128_DRAW_DOC
-{
- File = "128x128_draw_doc-p.png";
-};
-
-Bitmap BMP_128X128_IMPRESS_DOC
-{
- File = "128x128_impress_doc-p.png";
-};
-
-Bitmap BMP_128X128_MATH_DOC
-{
- File = "128x128_math_doc-p.png";
-};
-
-Bitmap BMP_128X128_WRITER_DOC
-{
- File = "128x128_writer_doc-p.png";
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 68fc849b58ec..dc2c032263f2 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3471,11 +3471,11 @@ bool SfxObjectShell::WriteThumbnail(bool bEncrypted, bool bIsTemplate, const uno
xSet->setPropertyValue("MediaType", uno::makeAny(OUString("image/png")));
if (bEncrypted)
{
- const sal_uInt16 nResID = GraphicHelper::getThumbnailReplacementIDByFactoryName_Impl(
+ const OUString sResID = GraphicHelper::getThumbnailReplacementIDByFactoryName_Impl(
GetFactory().GetFactoryName(),
bIsTemplate);
- if (nResID)
- bResult = GraphicHelper::getThumbnailReplacement_Impl(nResID, xStream);
+ if (!sResID.isEmpty())
+ bResult = GraphicHelper::getThumbnailReplacement_Impl(sResID, xStream);
}
else
{
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index a0f8da28cbb4..a5ae425edc26 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -58,6 +58,7 @@
#include <com/sun/star/task/InteractionHandler.hpp>
#include "doc.hrc"
+#include "bitmaps.hlst"
const char TM_SETTING_MANAGER[] = "TemplateManager";
const char TM_SETTING_LASTFOLDER[] = "LastFolder";
@@ -170,7 +171,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(vcl::Window *parent)
mpActionMenu = VclPtr<PopupMenu>::Create();
mpActionMenu->InsertItem(MNI_ACTION_NEW_FOLDER,
SfxResId(STR_CATEGORY_NEW).toString(),
- Image(BitmapEx(SfxResId(BMP_ACTION_REFRESH))));
+ Image(BitmapEx(BMP_ACTION_REFRESH)));
mpActionMenu->InsertItem(MNI_ACTION_RENAME_FOLDER,
SfxResId(STR_CATEGORY_RENAME).toString());
mpActionMenu->InsertItem(MNI_ACTION_DELETE_FOLDER,
@@ -178,7 +179,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(vcl::Window *parent)
mpActionMenu->InsertSeparator();
mpActionMenu->InsertItem(MNI_ACTION_REFRESH,
SfxResId(STR_ACTION_REFRESH).toString(),
- Image(BitmapEx(SfxResId(BMP_ACTION_REFRESH))));
+ Image(BitmapEx(BMP_ACTION_REFRESH)));
mpActionMenu->InsertItem(MNI_ACTION_DEFAULT,SfxResId(STR_ACTION_DEFAULT).toString());
mpActionMenu->SetSelectHdl(LINK(this,SfxTemplateManagerDlg,MenuSelectHdl));