[Libreoffice-commits] core.git: 4 commits - include/svx sc/source svx/source sw/inc sw/source uui/source vcl/headless vcl/inc vcl/unx
Caolán McNamara
caolanm at redhat.com
Tue Feb 7 13:08:24 UTC 2017
include/svx/swframeposstrings.hxx | 6
sc/source/core/data/funcdesc.cxx | 8
sc/source/core/src/compiler.src | 58 +---
svx/source/dialog/swframeposstrings.cxx | 27 --
svx/source/dialog/swframeposstrings.src | 259 +++----------------
sw/inc/shellres.hxx | 3
sw/source/ui/utlui/utlui.src | 114 +-------
sw/source/uibase/inc/utlui.hrc | 40 ++
sw/source/uibase/utlui/initui.cxx | 32 --
sw/source/uibase/utlui/initui.hrc | 58 ----
sw/source/uibase/utlui/initui.src | 332 ++++++++++++------------
uui/source/iahndl.cxx | 10
uui/source/iahndl.hxx | 8
uui/source/ids.src | 429 ++++++++++----------------------
vcl/headless/svpframe.cxx | 4
vcl/headless/svpgdi.cxx | 131 ++++++---
vcl/headless/svpvd.cxx | 21 -
vcl/inc/headless/svpgdi.hxx | 5
vcl/inc/headless/svpvd.hxx | 1
vcl/inc/unx/gtk/gtkframe.hxx | 2
vcl/unx/gtk3/gtk3gtkframe.cxx | 50 +--
21 files changed, 585 insertions(+), 1013 deletions(-)
New commits:
commit eee0206831f9682f1fa1806d08bbbeaf4783b4e9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Feb 6 20:10:13 2017 +0000
interim convert to ResArray
Change-Id: I74c8ad1242611321401f6282dfbce3205977394a
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index f2915b1..fe4aebb 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -1302,14 +1302,10 @@ bool
ErrorResource::getString(ErrCode nErrorCode, OUString &rString)
const
{
- ResId aResId(static_cast< sal_uInt16 >(nErrorCode & ERRCODE_RES_MASK),
- *m_pResMgr);
- aResId.SetRT(RSC_STRING);
- if (!IsAvailableRes(aResId))
+ sal_uInt32 nIdx = m_aStringArray.FindIndex(nErrorCode & ERRCODE_RES_MASK);
+ if (nIdx == RESARRAY_INDEX_NOTFOUND)
return false;
- aResId.SetAutoRelease(false);
- rString = aResId.toString();
- m_pResMgr->PopContext();
+ rString = m_aStringArray.GetString(nIdx);
return true;
}
diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx
index 6543b34..6e6cda4 100644
--- a/uui/source/iahndl.hxx
+++ b/uui/source/iahndl.hxx
@@ -32,6 +32,7 @@
#include <tools/errcode.hxx>
#include <tools/rc.hxx>
+#include <tools/resary.hxx>
#include <tools/wintypes.hxx>
#include <unordered_map>
@@ -247,12 +248,11 @@ private:
css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > const & rContinuations );
};
-class ErrorResource: private Resource
+class ErrorResource
{
+ ResStringArray m_aStringArray;
public:
- explicit ErrorResource(ResId & rResId): Resource(rResId) {}
-
- ~ErrorResource() { FreeResource(); }
+ explicit ErrorResource(ResId& rResId) : m_aStringArray(rResId) {}
bool getString(ErrCode nErrorCode, OUString &rString) const;
};
diff --git a/uui/source/ids.src b/uui/source/ids.src
index d7ae643..b5e5f37 100644
--- a/uui/source/ids.src
+++ b/uui/source/ids.src
@@ -41,362 +41,223 @@ String STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE
Text [ en-US ] = "Non-Encrypted Streams" ;
};
-Resource RID_UUI_ERRHDL
+StringArray RID_UUI_ERRHDL
{
- String (ERRCODE_UUI_IO_ABORT & ERRCODE_RES_MASK)
+ ItemList [ en-US ] =
{
- Text [ en-US ] = "The operation executed on $(ARG1) was aborted.";
- };
+ < "The operation executed on $(ARG1) was aborted." ;
+ (ERRCODE_UUI_IO_ABORT & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_ACCESSDENIED & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "Access to $(ARG1) was denied.";
- };
+ < "Access to $(ARG1) was denied." ;
+ (ERRCODE_UUI_IO_ACCESSDENIED & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_ALREADYEXISTS & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "$(ARG1) already exists.";
- };
+ < "$(ARG1) already exists.";
+ (ERRCODE_UUI_IO_ALREADYEXISTS & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_TARGETALREADYEXISTS & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "Target already exists.";
- };
+ < "Target already exists." ;
+ (ERRCODE_UUI_IO_TARGETALREADYEXISTS & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_MODULESIZEEXCEEDED & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "You are about to save/export a password protected basic library containing module(s) \n$(ARG1)\nwhich are too large to store in binary format. If you wish users that don't have access to the library password to be able to run macros in those module(s) you must split those modules into a number of smaller modules. Do you wish to continue to save/export this library?" ;
- };
+ < "You are about to save/export a password protected basic library containing module(s) \n$(ARG1)\nwhich are too large to store in binary format. If you wish users that don't have access to the library password to be able to run macros in those module(s) you must split those modules into a number of smaller modules. Do you wish to continue to save/export this library?" ;
+ (ERRCODE_UUI_IO_MODULESIZEEXCEEDED & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_BADCRC & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The data from $(ARG1) has an incorrect checksum.";
- };
+ < "The data from $(ARG1) has an incorrect checksum." ;
+ (ERRCODE_UUI_IO_BADCRC & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_CANTCREATE & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The object $(ARG1) cannot be created in directory $(ARG2).";
- };
+ < "The object $(ARG1) cannot be created in directory $(ARG2)." ;
+ (ERRCODE_UUI_IO_CANTCREATE & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_CANTREAD & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "Data of $(ARG1) could not be read.";
- };
+ < "Data of $(ARG1) could not be read." ;
+ (ERRCODE_UUI_IO_CANTREAD & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_CANTSEEK & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The seek operation on $(ARG1) could not be performed.";
- };
+ < "The seek operation on $(ARG1) could not be performed." ;
+ (ERRCODE_UUI_IO_CANTSEEK & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_CANTTELL & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The tell operation on $(ARG1) could not be performed.";
- };
+ < "The tell operation on $(ARG1) could not be performed." ;
+ (ERRCODE_UUI_IO_CANTTELL & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_CANTWRITE & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "Data for $(ARG1) could not be written.";
- };
+ < "Data for $(ARG1) could not be written." ;
+ (ERRCODE_UUI_IO_CANTWRITE & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_CURRENTDIR & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "Action impossible: $(ARG1) is the current directory.";
- };
+ < "Action impossible: $(ARG1) is the current directory." ;
+ (ERRCODE_UUI_IO_CURRENTDIR & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_NOTREADY & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "$(ARG1) is not ready.";
- };
+ < "$(ARG1) is not ready." ;
+ (ERRCODE_UUI_IO_NOTREADY & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_NOTSAMEDEVICE & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "Action impossible: $(ARG1) and $(ARG2) are different devices (drives).";
- };
+ < "Action impossible: $(ARG1) and $(ARG2) are different devices (drives)." ;
+ (ERRCODE_UUI_IO_NOTSAMEDEVICE & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_GENERAL & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "General input/output error while accessing $(ARG1).";
- };
+ < "General input/output error while accessing $(ARG1)." ;
+ (ERRCODE_UUI_IO_GENERAL & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_INVALIDACCESS & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "An attempt was made to access $(ARG1) in an invalid way.";
- };
+ < "An attempt was made to access $(ARG1) in an invalid way." ;
+ (ERRCODE_UUI_IO_INVALIDACCESS & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_INVALIDCHAR & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "$(ARG1) contains invalid characters.";
- };
+ < "$(ARG1) contains invalid characters." ;
+ (ERRCODE_UUI_IO_INVALIDCHAR & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_INVALIDDEVICE & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The device (drive) $(ARG1) is invalid.";
- };
+ < "The device (drive) $(ARG1) is invalid." ;
+ (ERRCODE_UUI_IO_INVALIDDEVICE & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_INVALIDLENGTH & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The data from $(ARG1) has an invalid length.";
- };
+ < "The data from $(ARG1) has an invalid length." ;
+ (ERRCODE_UUI_IO_INVALIDLENGTH & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_INVALIDPARAMETER & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The operation on $(ARG1) was started with an invalid parameter.";
- };
+ < "The operation on $(ARG1) was started with an invalid parameter." ;
+ (ERRCODE_UUI_IO_INVALIDPARAMETER & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_ISWILDCARD & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The operation cannot be performed because $(ARG1) contains wildcards.";
- };
+ < "The operation cannot be performed because $(ARG1) contains wildcards." ;
+ (ERRCODE_UUI_IO_ISWILDCARD & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_LOCKVIOLATION & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "Error during shared access to $(ARG1).";
- };
+ < "Error during shared access to $(ARG1)." ;
+ (ERRCODE_UUI_IO_LOCKVIOLATION & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_MISPLACEDCHAR & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "$(ARG1) contains misplaced characters.";
- };
+ < "$(ARG1) contains misplaced characters." ;
+ (ERRCODE_UUI_IO_MISPLACEDCHAR & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_NAMETOOLONG & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The name $(ARG1) contains too many characters.";
- };
+ < "The name $(ARG1) contains too many characters." ;
+ (ERRCODE_UUI_IO_NAMETOOLONG & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_NOTEXISTS & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "$(ARG1) does not exist.";
- };
+ < "$(ARG1) does not exist." ;
+ (ERRCODE_UUI_IO_NOTEXISTS & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_NOTEXISTSPATH & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The path $(ARG1) does not exist.";
- };
+ < "The path $(ARG1) does not exist." ;
+ (ERRCODE_UUI_IO_NOTEXISTSPATH & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_NOTSUPPORTED & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The operation on $(ARG1) is not supported on this operating system.";
- };
+ < "The operation on $(ARG1) is not supported on this operating system." ;
+ (ERRCODE_UUI_IO_NOTSUPPORTED & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_NOTADIRECTORY & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "$(ARG1) is not a directory.";
- };
+ < "$(ARG1) is not a directory." ;
+ (ERRCODE_UUI_IO_NOTADIRECTORY & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_NOTAFILE & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "$(ARG1) is not a file.";
- };
+ < "$(ARG1) is not a file." ;
+ (ERRCODE_UUI_IO_NOTAFILE & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_OUTOFSPACE & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "There is no space left on device $(ARG1).";
- };
+ < "There is no space left on device $(ARG1)." ;
+ (ERRCODE_UUI_IO_OUTOFSPACE & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_TOOMANYOPENFILES & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The operation on $(ARG1) cannot be performed because too many files are already open.";
- };
+ < "The operation on $(ARG1) cannot be performed because too many files are already open." ;
+ (ERRCODE_UUI_IO_TOOMANYOPENFILES & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_OUTOFMEMORY & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The operation on $(ARG1) cannot be performed because there is no more memory available.";
- };
+ < "The operation on $(ARG1) cannot be performed because there is no more memory available." ;
+ (ERRCODE_UUI_IO_OUTOFMEMORY & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_PENDING & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The operation on $(ARG1) cannot continue because more data is pending.";
- };
+ < "The operation on $(ARG1) cannot continue because more data is pending." ;
+ (ERRCODE_UUI_IO_PENDING & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_RECURSIVE & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "$(ARG1) cannot be copied into itself.";
- };
+ < "$(ARG1) cannot be copied into itself." ;
+ (ERRCODE_UUI_IO_RECURSIVE & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_UNKNOWN & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "Unknown input/output error while accessing $(ARG1).";
- };
+ < "Unknown input/output error while accessing $(ARG1)." ;
+ (ERRCODE_UUI_IO_UNKNOWN & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_WRITEPROTECTED & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "$(ARG1) is write protected.";
- };
+ < "$(ARG1) is write protected." ;
+ (ERRCODE_UUI_IO_WRITEPROTECTED & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_WRONGFORMAT & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "$(ARG1) is not in the correct format.";
- };
+ < "$(ARG1) is not in the correct format." ;
+ (ERRCODE_UUI_IO_WRONGFORMAT & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_WRONGVERSION & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The version of $(ARG1) is not correct.";
- };
+ < "The version of $(ARG1) is not correct." ;
+ (ERRCODE_UUI_IO_WRONGVERSION & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_NOTEXISTS_VOLUME & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "Drive $(ARG1) does not exist.";
- };
+ < "Drive $(ARG1) does not exist." ;
+ (ERRCODE_UUI_IO_NOTEXISTS_VOLUME & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_NOTEXISTS_FOLDER & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "Folder $(ARG1) does not exist.";
- };
+ < "Folder $(ARG1) does not exist." ;
+ (ERRCODE_UUI_IO_NOTEXISTS_FOLDER & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_WRONGJAVA & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The installed Java version is not supported.";
- };
+ < "The installed Java version is not supported." ;
+ (ERRCODE_UUI_WRONGJAVA & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_WRONGJAVA_VERSION & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The installed Java version $(ARG1) is not supported.";
- };
- String (ERRCODE_UUI_WRONGJAVA_MIN & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The installed Java version is not supported, at least version $(ARG1) is required.";
- };
+ < "The installed Java version $(ARG1) is not supported." ;
+ (ERRCODE_UUI_WRONGJAVA_VERSION & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_WRONGJAVA_VERSION_MIN & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The installed Java version $(ARG1) is not supported, at least version $(ARG2) is required.";
- };
+ < "The installed Java version is not supported, at least version $(ARG1) is required." ;
+ (ERRCODE_UUI_WRONGJAVA_MIN & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_BADPARTNERSHIP & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The data associated with the partnership is corrupted.";
- };
+ < "The installed Java version $(ARG1) is not supported, at least version $(ARG2) is required." ;
+ (ERRCODE_UUI_WRONGJAVA_VERSION_MIN & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_BADPARTNERSHIP_NAME & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The data associated with the partnership $(ARG1) is corrupted.";
- };
+ < "The data associated with the partnership is corrupted." ;
+ (ERRCODE_UUI_BADPARTNERSHIP & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_NOTREADY_VOLUME & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "Volume $(ARG1) is not ready.";
- };
+ < "The data associated with the partnership $(ARG1) is corrupted." ;
+ (ERRCODE_UUI_BADPARTNERSHIP_NAME & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_NOTREADY_REMOVABLE & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "$(ARG1) is not ready; please insert a storage medium.";
- };
+ < "Volume $(ARG1) is not ready." ;
+ (ERRCODE_UUI_IO_NOTREADY_VOLUME & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_NOTREADY_VOLUME_REMOVABLE & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "Volume $(ARG1) is not ready; please insert a storage medium.";
- };
+ < "$(ARG1) is not ready; please insert a storage medium." ;
+ (ERRCODE_UUI_IO_NOTREADY_REMOVABLE & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_WRONGMEDIUM & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "Please insert disk $(ARG1).";
- };
+ < "Volume $(ARG1) is not ready; please insert a storage medium." ;
+ (ERRCODE_UUI_IO_NOTREADY_VOLUME_REMOVABLE & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_CANTCREATE_NONAME & ERRCODE_RES_MASK)
- {
- Text[ en-US ] = "The object cannot be created in directory $(ARG1).";
- };
+ < "Please insert disk $(ARG1)." ;
+ (ERRCODE_UUI_WRONGMEDIUM & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_UNSUPPORTEDOVERWRITE & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "%PRODUCTNAME cannot keep files from being overwritten when this transmission protocol is used. Do you want to continue anyway?";
- };
+ < "The object cannot be created in directory $(ARG1)." ;
+ (ERRCODE_UUI_IO_CANTCREATE_NONAME & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_BROKENPACKAGE & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The file '$(ARG1)' is corrupt and therefore cannot be opened. %PRODUCTNAME can try to repair the file.\n\nThe corruption could be the result of document manipulation or of structural document damage due to data transmission.\n\nWe recommend that you do not trust the content of the repaired document.\nExecution of macros is disabled for this document.\n\nShould %PRODUCTNAME repair the file?\n";
- };
+ < "%PRODUCTNAME cannot keep files from being overwritten when this transmission protocol is used. Do you want to continue anyway?" ;
+ (ERRCODE_UUI_IO_UNSUPPORTEDOVERWRITE & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_IO_BROKENPACKAGE_CANTREPAIR & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The file '$(ARG1)' could not be repaired and therefore cannot be opened.";
- };
+ < "The file '$(ARG1)' is corrupt and therefore cannot be opened. %PRODUCTNAME can try to repair the file.\n\nThe corruption could be the result of document manipulation or of structural document damage due to data transmission.\n\nWe recommend that you do not trust the content of the repaired document.\nExecution of macros is disabled for this document.\n\nShould %PRODUCTNAME repair the file?\n" ;
+ (ERRCODE_UUI_IO_BROKENPACKAGE & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_CONFIGURATION_BROKENDATA_NOREMOVE & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "Configuration data in '$(ARG1)' is corrupted. Without this data some functions may not operate correctly.\nDo you want to continue startup of %PRODUCTNAME without the corrupted configuration data?";
- };
+ < "The file '$(ARG1)' could not be repaired and therefore cannot be opened." ;
+ (ERRCODE_UUI_IO_BROKENPACKAGE_CANTREPAIR & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_CONFIGURATION_BROKENDATA_WITHREMOVE & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The personal configuration file '$(ARG1)' is corrupted and must be deleted to continue. Some of your personal settings may be lost.\nDo you want to continue startup of %PRODUCTNAME without the corrupted configuration data?";
- };
+ < "Configuration data in '$(ARG1)' is corrupted. Without this data some functions may not operate correctly.\nDo you want to continue startup of %PRODUCTNAME without the corrupted configuration data?" ;
+ (ERRCODE_UUI_CONFIGURATION_BROKENDATA_NOREMOVE & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_CONFIGURATION_BACKENDMISSING & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The configuration data source '$(ARG1)' is unavailable. Without this data some functions may not operate correctly.";
- };
+ < "The personal configuration file '$(ARG1)' is corrupted and must be deleted to continue. Some of your personal settings may be lost.\nDo you want to continue startup of %PRODUCTNAME without the corrupted configuration data?" ;
+ (ERRCODE_UUI_CONFIGURATION_BROKENDATA_WITHREMOVE & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_CONFIGURATION_BACKENDMISSING_WITHRECOVER & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The configuration data source '$(ARG1)' is unavailable. Without this data some functions may not operate correctly.\nDo you want to continue startup of %PRODUCTNAME without the missing configuration data?";
- };
+ < "The configuration data source '$(ARG1)' is unavailable. Without this data some functions may not operate correctly." ;
+ (ERRCODE_UUI_CONFIGURATION_BACKENDMISSING & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_INVALID_XFORMS_SUBMISSION_DATA & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The form contains invalid data. Do you still want to continue?";
- };
+ < "The configuration data source '$(ARG1)' is unavailable. Without this data some functions may not operate correctly.\nDo you want to continue startup of %PRODUCTNAME without the missing configuration data?" ;
+ (ERRCODE_UUI_CONFIGURATION_BACKENDMISSING_WITHRECOVER & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_LOCKING_LOCKED & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The file $(ARG1) is locked by another user. Currently, another write access to this file cannot be granted.";
+ < "The form contains invalid data. Do you still want to continue?" ;
+ (ERRCODE_UUI_INVALID_XFORMS_SUBMISSION_DATA & ERRCODE_RES_MASK) ; >;
- };
+ < "The file $(ARG1) is locked by another user. Currently, another write access to this file cannot be granted." ;
+ (ERRCODE_UUI_LOCKING_LOCKED & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_LOCKING_LOCKED_SELF & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The file $(ARG1) is locked by yourself. Currently, another write access to this file cannot be granted.";
- };
+ < "The file $(ARG1) is locked by yourself. Currently, another write access to this file cannot be granted." ;
+ (ERRCODE_UUI_LOCKING_LOCKED_SELF & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_LOCKING_NOT_LOCKED & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The file $(ARG1) is currently not locked by yourself.";
- };
+ < "The file $(ARG1) is currently not locked by yourself." ;
+ (ERRCODE_UUI_LOCKING_NOT_LOCKED & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_LOCKING_LOCK_EXPIRED & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "The previously obtained lock for file $(ARG1) has expired.\nThis can happen due to problems on the server managing the file lock. It cannot be guaranteed that write operations on this file will not overwrite changes done by other users!";
- };
+ < "The previously obtained lock for file $(ARG1) has expired.\nThis can happen due to problems on the server managing the file lock. It cannot be guaranteed that write operations on this file will not overwrite changes done by other users!" ;
+ (ERRCODE_UUI_LOCKING_LOCK_EXPIRED & ERRCODE_RES_MASK) ; >;
- String (ERRCODE_UUI_UNKNOWNAUTH_UNTRUSTED)
- {
- Text [ en-US ] = "Unable to verify the identity of $(ARG1) site.\n\nBefore accepting this certificate, you should examine this site's certificate carefully. Are you willing to accept this certificate for the purpose of identifying the Web site $(ARG1)?";
- };
+ < "Unable to verify the identity of $(ARG1) site.\n\nBefore accepting this certificate, you should examine this site's certificate carefully. Are you willing to accept this certificate for the purpose of identifying the Web site $(ARG1)?" ;
+ (ERRCODE_UUI_UNKNOWNAUTH_UNTRUSTED) ; >;
- String (ERRCODE_UUI_SSLWARN_EXPIRED_1)
- {
- Text [ en-US ] = "$(ARG1) is a site that uses a security certificate to encrypt data during transmission, but its certificate expired on $(ARG2).\n\nYou should check to make sure that your computer's time is correct.";
- };
+ < "$(ARG1) is a site that uses a security certificate to encrypt data during transmission, but its certificate expired on $(ARG2).\n\nYou should check to make sure that your computer's time is correct." ;
+ (ERRCODE_UUI_SSLWARN_EXPIRED_1) ; >;
- String (ERRCODE_UUI_SSLWARN_DOMAINMISMATCH_1)
- {
- Text [ en-US ] = "You have attempted to establish a connection with $(ARG1). However, the security certificate presented belongs to $(ARG2). It is possible, though unlikely, that someone may be trying to intercept your communication with this web site.\n\nIf you suspect the certificate shown does not belong to $(ARG1), please cancel the connection and notify the site administrator.\n\nWould you like to continue anyway?";
- };
+ < "You have attempted to establish a connection with $(ARG1). However, the security certificate presented belongs to $(ARG2). It is possible, though unlikely, that someone may be trying to intercept your communication with this web site.\n\nIf you suspect the certificate shown does not belong to $(ARG1), please cancel the connection and notify the site administrator.\n\nWould you like to continue anyway?" ;
+ (ERRCODE_UUI_SSLWARN_DOMAINMISMATCH_1) ; >;
- String (ERRCODE_UUI_SSLWARN_INVALID_1)
- {
- Text [ en-US ] = "The certificate could not be validated. You should examine this site's certificate carefully.\n\nIf you suspect the certificate shown, please cancel the connection and notify the site administrator.";
- };
- String (TITLE_UUI_SSLWARN_DOMAINMISMATCH)
- {
- Text [ en-US ] = "Security Warning: Domain Name Mismatch";
- };
+ < "The certificate could not be validated. You should examine this site's certificate carefully.\n\nIf you suspect the certificate shown, please cancel the connection and notify the site administrator." ;
+ (ERRCODE_UUI_SSLWARN_INVALID_1) ; >;
- String (TITLE_UUI_SSLWARN_EXPIRED)
- {
- Text [ en-US ] = "Security Warning: Server Certificate Expired";
- };
+ < "Security Warning: Domain Name Mismatch" ;
+ (TITLE_UUI_SSLWARN_DOMAINMISMATCH) ; >;
- String (TITLE_UUI_SSLWARN_INVALID)
- {
- Text [ en-US ] = "Security Warning: Server Certificate Invalid";
- };
+ < "Security Warning: Server Certificate Expired" ;
+ (TITLE_UUI_SSLWARN_EXPIRED) ; >;
- String (ERRCODE_UUI_CANNOT_ACTIVATE_FACTORY & ERRCODE_RES_MASK)
- {
- Text [ en-US ] = "Component cannot be loaded, possibly broken or incomplete installation.\nFull error message:\n\n $(ARG1).";
- };
+ < "Security Warning: Server Certificate Invalid" ;
+ (TITLE_UUI_SSLWARN_INVALID) ; >;
+ < "Component cannot be loaded, possibly broken or incomplete installation.\nFull error message:\n\n $(ARG1)." ;
+ (ERRCODE_UUI_CANNOT_ACTIVATE_FACTORY & ERRCODE_RES_MASK) ; >;
+ };
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit e51f247484e4c967838971a0ff5f915cc7f2e376
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Feb 6 14:16:56 2017 +0000
flatten ShellResource resource
Change-Id: I6094f86eb7da89ba5e21be909417b23f9f375351
diff --git a/sw/inc/shellres.hxx b/sw/inc/shellres.hxx
index f324299..5f391b7 100644
--- a/sw/inc/shellres.hxx
+++ b/sw/inc/shellres.hxx
@@ -24,7 +24,7 @@
#include <tools/rc.hxx>
#include <vcl/bitmap.hxx>
-struct SW_DLLPUBLIC ShellResource : public Resource
+struct SW_DLLPUBLIC ShellResource
{
OUString aPostItAuthor;
OUString aPostItPage;
@@ -80,7 +80,6 @@ struct SW_DLLPUBLIC ShellResource : public Resource
OUString GetPageDescName(sal_uInt16 nNo, PageNameMode eMode);
ShellResource();
- ~ShellResource();
private:
void GetAutoFormatNameLst_() const;
diff --git a/sw/source/uibase/inc/utlui.hrc b/sw/source/uibase/inc/utlui.hrc
index 1711108..e8b9bd1 100644
--- a/sw/source/uibase/inc/utlui.hrc
+++ b/sw/source/uibase/inc/utlui.hrc
@@ -22,7 +22,6 @@
#include "rcid.hrc"
-#define RID_SW_SHELLRES (RC_UTLUI_BEGIN + 1)
#define RID_STR_SYSTEM (RC_UTLUI_BEGIN + 2)
// Strings in NumberFormatter-Listbox
@@ -70,7 +69,7 @@
#define STR_CONTENT_TYPE_SINGLE_DRAWOBJECT (STR_CONTENT_TYPE_SINGLE_FIRST + 11)
#define STR_CONTENT_SINGLE_END STR_CONTENT_TYPE_SINGLE_DRAWOBJECT
-#define FLD_DOCINFO_BEGIN STR_CONTENT_SINGLE_END
+#define FLD_DOCINFO_BEGIN (STR_CONTENT_SINGLE_END + 1)
#define FLD_DOCINFO_TITEL FLD_DOCINFO_BEGIN
#define FLD_DOCINFO_THEMA (FLD_DOCINFO_BEGIN + 1)
#define FLD_DOCINFO_KEYS (FLD_DOCINFO_BEGIN + 2)
@@ -190,7 +189,42 @@
#define STR_IDXEXAMPLE_IDXTXT_IMAGE1 (STR_IDXEXAMPLE_IDXTXT_BEGIN + 8)
#define STR_IDXEXAMPLE_IDXTXT_END STR_IDXEXAMPLE_IDXTXT_IMAGE1
-#if STR_IDXEXAMPLE_IDXTXT_END > RC_IDXTXT_END
+#define RID_SW_SHELLRES_BEGIN (STR_IDXEXAMPLE_IDXTXT_IMAGE1 + 1)
+#define STR_POSTIT_PAGE (RID_SW_SHELLRES_BEGIN + 1)
+#define STR_POSTIT_AUTHOR (RID_SW_SHELLRES_BEGIN + 2)
+#define STR_CALC_SYNTAX (RID_SW_SHELLRES_BEGIN + 3)
+#define STR_CALC_ZERODIV (RID_SW_SHELLRES_BEGIN + 4)
+#define STR_CALC_BRACK (RID_SW_SHELLRES_BEGIN + 5)
+#define STR_CALC_POW (RID_SW_SHELLRES_BEGIN + 6)
+#define STR_CALC_VARNFND (RID_SW_SHELLRES_BEGIN + 7)
+#define STR_CALC_OVERFLOW (RID_SW_SHELLRES_BEGIN + 8)
+#define STR_CALC_WRONGTIME (RID_SW_SHELLRES_BEGIN + 9)
+#define STR_CALC_DEFAULT (RID_SW_SHELLRES_BEGIN + 10)
+#define STR_CALC_ERROR (RID_SW_SHELLRES_BEGIN + 11)
+#define STR_GETREFFLD_UP (RID_SW_SHELLRES_BEGIN + 12)
+#define STR_GETREFFLD_DOWN (RID_SW_SHELLRES_BEGIN + 13)
+#define STR_ALLPAGE_HEADFOOT (RID_SW_SHELLRES_BEGIN + 14)
+#define STR_TEMPLATE_NONE (RID_SW_SHELLRES_BEGIN + 15)
+#define STR_POSTIT_LINE (RID_SW_SHELLRES_BEGIN + 16)
+#define STR_FIELD_FIXED (RID_SW_SHELLRES_BEGIN + 17)
+#define STR_TOI (RID_SW_SHELLRES_BEGIN + 18)
+#define STR_TOU (RID_SW_SHELLRES_BEGIN + 19)
+#define STR_TOC (RID_SW_SHELLRES_BEGIN + 20)
+#define STR_TOX_ILL (RID_SW_SHELLRES_BEGIN + 21)
+#define STR_TOX_OBJ (RID_SW_SHELLRES_BEGIN + 22)
+#define STR_TOX_TBL (RID_SW_SHELLRES_BEGIN + 23)
+#define STR_TOX_AUTH (RID_SW_SHELLRES_BEGIN + 24)
+#define STR_PAGEDESC_NAME (RID_SW_SHELLRES_BEGIN + 25)
+#define STR_PAGEDESC_FIRSTNAME (RID_SW_SHELLRES_BEGIN + 26)
+#define STR_PAGEDESC_FOLLOWNAME (RID_SW_SHELLRES_BEGIN + 27)
+#define STR_LINK_CTRL_CLICK (RID_SW_SHELLRES_BEGIN + 28)
+#define STR_LINK_CLICK (RID_SW_SHELLRES_BEGIN + 29)
+#define STR_GETREFFLD_REFITEMNOTFOUND (RID_SW_SHELLRES_BEGIN + 30)
+#define STR_DURATION_FORMAT (RID_SW_SHELLRES_BEGIN + 31)
+#define STR_TOX_CITATION (RID_SW_SHELLRES_BEGIN + 32)
+#define RID_SW_SHELLRES_END STR_TOX_CITATION
+
+#if STR_IDXEXAMPLE_IDXTXT_END > RID_SW_SHELLRES_END
#error Resource-Id Ueberlauf in #file, #line
#endif
diff --git a/sw/source/uibase/utlui/initui.cxx b/sw/source/uibase/utlui/initui.cxx
index 8e641e3..b2a1dad 100644
--- a/sw/source/uibase/utlui/initui.cxx
+++ b/sw/source/uibase/utlui/initui.cxx
@@ -30,7 +30,6 @@
#include <gloslst.hxx>
#include <utlui.hrc>
-#include <initui.hrc>
#include <comcore.hrc>
#include <authfld.hxx>
#include <dbmgr.hxx>
@@ -175,8 +174,7 @@ void InitUI()
}
ShellResource::ShellResource()
- : Resource( SW_RES(RID_SW_SHELLRES) ),
- aPostItAuthor( SW_RES( STR_POSTIT_AUTHOR ) ),
+ : aPostItAuthor( SW_RES( STR_POSTIT_AUTHOR ) ),
aPostItPage( SW_RES( STR_POSTIT_PAGE ) ),
aPostItLine( SW_RES( STR_POSTIT_LINE ) ),
@@ -222,12 +220,6 @@ ShellResource::ShellResource()
for(sal_uInt16 i = 0; i < nCount; ++i)
aDocInfoLst.push_back(OUString(SW_RESSTR(FLD_DOCINFO_BEGIN + i)));
-
- FreeResource();
-}
-
-ShellResource::~ShellResource()
-{
}
OUString ShellResource::GetPageDescName(sal_uInt16 nNo, PageNameMode eMode)
diff --git a/sw/source/uibase/utlui/initui.hrc b/sw/source/uibase/utlui/initui.hrc
deleted file mode 100644
index bd9f60e..0000000
--- a/sw/source/uibase/utlui/initui.hrc
+++ /dev/null
@@ -1,58 +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 .
- */
-
-#ifndef INCLUDED_SW_SOURCE_UIBASE_UTLUI_INITUI_HRC
-#define INCLUDED_SW_SOURCE_UIBASE_UTLUI_INITUI_HRC
-
-// Local Resources for the shells:
-#define STR_POSTIT_PAGE 1
-#define STR_POSTIT_AUTHOR 2
-#define STR_CALC_SYNTAX 3
-#define STR_CALC_ZERODIV 4
-#define STR_CALC_BRACK 5
-#define STR_CALC_POW 6
-#define STR_CALC_VARNFND 7
-#define STR_CALC_OVERFLOW 8
-#define STR_CALC_WRONGTIME 9
-#define STR_CALC_DEFAULT 10
-#define STR_CALC_ERROR 11
-#define STR_GETREFFLD_UP 12
-#define STR_GETREFFLD_DOWN 13
-#define STR_ALLPAGE_HEADFOOT 14
-#define STR_TEMPLATE_NONE 15
-#define STR_POSTIT_LINE 16
-#define STR_FIELD_FIXED 17
-#define STR_TOI 18
-#define STR_TOU 19
-#define STR_TOC 20
-#define STR_TOX_ILL 21
-#define STR_TOX_OBJ 22
-#define STR_TOX_TBL 23
-#define STR_TOX_AUTH 24
-#define STR_PAGEDESC_NAME 25
-#define STR_PAGEDESC_FIRSTNAME 26
-#define STR_PAGEDESC_FOLLOWNAME 27
-#define STR_LINK_CTRL_CLICK 28
-#define STR_LINK_CLICK 29
-#define STR_GETREFFLD_REFITEMNOTFOUND 30
-#define STR_DURATION_FORMAT 31
-#define STR_TOX_CITATION 32
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/utlui/initui.src b/sw/source/uibase/utlui/initui.src
index faf9681..676dc10 100644
--- a/sw/source/uibase/utlui/initui.src
+++ b/sw/source/uibase/utlui/initui.src
@@ -20,185 +20,181 @@
#include "globals.hrc"
#include "utlui.hrc"
#include "helpid.h"
-#include "initui.hrc"
// Error calculator
-Resource RID_SW_SHELLRES
-{
- String STR_POSTIT_PAGE
- {
- Text [ en-US ] = "Page" ;
- };
- String STR_POSTIT_LINE
- {
- Text [ en-US ] = "Line" ;
- };
- String STR_POSTIT_AUTHOR
- {
- Text [ en-US ] = "Author" ;
- };
- String STR_CALC_SYNTAX
- {
- Text [ en-US ] = "** Syntax Error **" ;
- };
- String STR_CALC_ZERODIV
- {
- Text [ en-US ] = "** Division by zero **" ;
- };
- String STR_CALC_BRACK
- {
- Text [ en-US ] = "** Wrong use of brackets **" ;
- };
- String STR_CALC_POW
- {
- Text [ en-US ] = "** Square function overflow **" ;
- };
- String STR_CALC_VARNFND
- {
- Text [ en-US ] = "** Variable not found **" ;
- };
- String STR_CALC_OVERFLOW
- {
- Text [ en-US ] = "** Overflow **" ;
- };
- String STR_CALC_WRONGTIME
- {
- Text [ en-US ] = "** Wrong time format **" ;
- };
- String STR_CALC_DEFAULT
- {
- Text [ en-US ] = "** Error **" ;
- };
- String STR_CALC_ERROR
- {
- Text [ en-US ] = "** Expression is faulty **" ;
- };
- String STR_GETREFFLD_UP
- {
- Text [ en-US ] = "above" ;
- };
- String STR_GETREFFLD_DOWN
- {
- Text [ en-US ] = "below" ;
- };
- String STR_GETREFFLD_REFITEMNOTFOUND
- {
- Text [ en-US ] = "Error: Reference source not found" ;
- };
- String STR_ALLPAGE_HEADFOOT
- {
- Text [ en-US ] = "All" ;
- };
- String STR_TEMPLATE_NONE
- {
- Text [ en-US ] = "None" ;
- };
- String STR_FIELD_FIXED
- {
- Text [ en-US ] = "(fixed)" ;
- };
- String STR_DURATION_FORMAT
- {
- Text [en-US] = " Y: %1 M: %2 D: %3 H: %4 M: %5 S: %6";
- };
- String STR_TOI
- {
- Text [ en-US ] = "Alphabetical Index" ;
- };
+String STR_POSTIT_PAGE
+{
+ Text [ en-US ] = "Page" ;
+};
+String STR_POSTIT_LINE
+{
+ Text [ en-US ] = "Line" ;
+};
+String STR_POSTIT_AUTHOR
+{
+ Text [ en-US ] = "Author" ;
+};
+String STR_CALC_SYNTAX
+{
+ Text [ en-US ] = "** Syntax Error **" ;
+};
+String STR_CALC_ZERODIV
+{
+ Text [ en-US ] = "** Division by zero **" ;
+};
+String STR_CALC_BRACK
+{
+ Text [ en-US ] = "** Wrong use of brackets **" ;
+};
+String STR_CALC_POW
+{
+ Text [ en-US ] = "** Square function overflow **" ;
+};
+String STR_CALC_VARNFND
+{
+ Text [ en-US ] = "** Variable not found **" ;
+};
+String STR_CALC_OVERFLOW
+{
+ Text [ en-US ] = "** Overflow **" ;
+};
+String STR_CALC_WRONGTIME
+{
+ Text [ en-US ] = "** Wrong time format **" ;
+};
+String STR_CALC_DEFAULT
+{
+ Text [ en-US ] = "** Error **" ;
+};
+String STR_CALC_ERROR
+{
+ Text [ en-US ] = "** Expression is faulty **" ;
+};
+String STR_GETREFFLD_UP
+{
+ Text [ en-US ] = "above" ;
+};
+String STR_GETREFFLD_DOWN
+{
+ Text [ en-US ] = "below" ;
+};
+String STR_GETREFFLD_REFITEMNOTFOUND
+{
+ Text [ en-US ] = "Error: Reference source not found" ;
+};
+String STR_ALLPAGE_HEADFOOT
+{
+ Text [ en-US ] = "All" ;
+};
+String STR_TEMPLATE_NONE
+{
+ Text [ en-US ] = "None" ;
+};
+String STR_FIELD_FIXED
+{
+ Text [ en-US ] = "(fixed)" ;
+};
+String STR_DURATION_FORMAT
+{
+ Text [en-US] = " Y: %1 M: %2 D: %3 H: %4 M: %5 S: %6";
+};
+String STR_TOI
+{
+ Text [ en-US ] = "Alphabetical Index" ;
+};
- String STR_TOU
- {
- Text [ en-US ] = "User-Defined" ;
- };
+String STR_TOU
+{
+ Text [ en-US ] = "User-Defined" ;
+};
- String STR_TOC
- {
- Text [ en-US ] = "Table of Contents" ;
- };
+String STR_TOC
+{
+ Text [ en-US ] = "Table of Contents" ;
+};
- String STR_TOX_AUTH
- {
- Text [ en-US ] = "Bibliography";
- };
+String STR_TOX_AUTH
+{
+ Text [ en-US ] = "Bibliography";
+};
- String STR_TOX_CITATION
- {
- Text [ en-US ] = "Citation";
- };
+String STR_TOX_CITATION
+{
+ Text [ en-US ] = "Citation";
+};
- String STR_TOX_TBL
- {
- Text [ en-US ] = "Index of Tables";
- };
- String STR_TOX_OBJ
- {
- Text [ en-US ] = "Table of Objects";
- };
- String STR_TOX_ILL
- {
- Text [ en-US ] = "Illustration Index";
- };
- String STR_LINK_CTRL_CLICK
- {
- Text [ en-US ] = "%s-Click to follow link";
- };
- String STR_LINK_CLICK
- {
- Text [ en-US ] = "Click to follow link";
- };
+String STR_TOX_TBL
+{
+ Text [ en-US ] = "Index of Tables";
+};
+String STR_TOX_OBJ
+{
+ Text [ en-US ] = "Table of Objects";
+};
+String STR_TOX_ILL
+{
+ Text [ en-US ] = "Illustration Index";
+};
+String STR_LINK_CTRL_CLICK
+{
+ Text [ en-US ] = "%s-Click to follow link";
+};
+String STR_LINK_CLICK
+{
+ Text [ en-US ] = "Click to follow link";
+};
- // SubType DocInfo
+ // SubType DocInfo
- String FLD_DOCINFO_TITEL
- {
- Text [ en-US ] = "Title" ;
- };
- String FLD_DOCINFO_THEMA
- {
- Text [ en-US ] = "Subject" ;
- };
- String FLD_DOCINFO_KEYS
- {
- Text [ en-US ] = "Keywords" ;
- };
- String FLD_DOCINFO_COMMENT
- {
- Text [ en-US ] = "Comments" ;
- };
- String FLD_DOCINFO_CREATE
- {
- Text [ en-US ] = "Created" ;
- };
- String FLD_DOCINFO_CHANGE
- {
- Text [ en-US ] = "Modified" ;
- };
- String FLD_DOCINFO_PRINT
- {
- Text [ en-US ] = "Last printed" ;
- };
- String FLD_DOCINFO_DOCNO
- {
- Text [ en-US ] = "Revision number" ;
- };
- String FLD_DOCINFO_EDIT
- {
- Text [ en-US ] = "Total editing time" ;
- };
+String FLD_DOCINFO_TITEL
+{
+ Text [ en-US ] = "Title" ;
+};
+String FLD_DOCINFO_THEMA
+{
+ Text [ en-US ] = "Subject" ;
+};
+String FLD_DOCINFO_KEYS
+{
+ Text [ en-US ] = "Keywords" ;
+};
+String FLD_DOCINFO_COMMENT
+{
+ Text [ en-US ] = "Comments" ;
+};
+String FLD_DOCINFO_CREATE
+{
+ Text [ en-US ] = "Created" ;
+};
+String FLD_DOCINFO_CHANGE
+{
+ Text [ en-US ] = "Modified" ;
+};
+String FLD_DOCINFO_PRINT
+{
+ Text [ en-US ] = "Last printed" ;
+};
+String FLD_DOCINFO_DOCNO
+{
+ Text [ en-US ] = "Revision number" ;
+};
+String FLD_DOCINFO_EDIT
+{
+ Text [ en-US ] = "Total editing time" ;
+};
- String STR_PAGEDESC_NAME
- {
- Text [ en-US ] = "Convert $(ARG1)";
- };
- String STR_PAGEDESC_FIRSTNAME
- {
- Text [ en-US ] = "First convert $(ARG1)";
- };
- String STR_PAGEDESC_FOLLOWNAME
- {
- Text [ en-US ] = "Next convert $(ARG1)";
- };
+String STR_PAGEDESC_NAME
+{
+ Text [ en-US ] = "Convert $(ARG1)";
+};
+String STR_PAGEDESC_FIRSTNAME
+{
+ Text [ en-US ] = "First convert $(ARG1)";
+};
+String STR_PAGEDESC_FOLLOWNAME
+{
+ Text [ en-US ] = "Next convert $(ARG1)";
};
String STR_AUTH_TYPE_ARTICLE
commit 1c48275a28fa3bccdeb6bc12e4f0bcea6c05a81b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Feb 6 11:51:27 2017 +0000
convert resources containing strings to stringarray resources
Change-Id: I8a306b417dcf533a148e34a6314e37589dcdda12
diff --git a/include/svx/swframeposstrings.hxx b/include/svx/swframeposstrings.hxx
index b81765a..e04522e 100644
--- a/include/svx/swframeposstrings.hxx
+++ b/include/svx/swframeposstrings.hxx
@@ -27,7 +27,7 @@
contains strings needed for positioning dialogs
of frames and drawing in Writer
*/
-class SvxSwFramePosString_Impl;
+class ResStringArray;
class SVX_DLLPUBLIC SvxSwFramePosString
{
public:
@@ -80,10 +80,10 @@ public:
STR_MAX
};
- const OUString& GetString(StringId eId);
+ OUString GetString(StringId eId) const;
private:
- std::unique_ptr<SvxSwFramePosString_Impl> pImpl;
+ std::unique_ptr<ResStringArray> pImpl;
};
#endif
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index 56288b9..b0c2671 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -629,7 +629,7 @@ sal_uInt32 ScFunctionCategory::getCount() const
OUString ScFunctionCategory::getName() const
{
if ( m_sName.isEmpty() )
- m_sName = ScFunctionMgr::GetCategoryName(m_nCategory+1);
+ m_sName = ScFunctionMgr::GetCategoryName(m_nCategory);
return m_sName;
}
@@ -770,14 +770,14 @@ void ScFunctionMgr::fillLastRecentlyUsedFunctions(::std::vector< const formula::
OUString ScFunctionMgr::GetCategoryName(sal_uInt32 _nCategoryNumber )
{
- if ( _nCategoryNumber > SC_FUNCGROUP_COUNT )
+ if (_nCategoryNumber >= SC_FUNCGROUP_COUNT)
{
OSL_FAIL("Invalid category number!");
return OUString();
}
- std::unique_ptr<ScResourcePublisher> pCategories( new ScResourcePublisher( ScResId( RID_FUNCTION_CATEGORIES ) ) );
- return SC_RESSTR(static_cast<sal_uInt16>(_nCategoryNumber));
+ ResStringArray aStringArray(ScResId(RID_FUNCTION_CATEGORIES));
+ return aStringArray.GetString(_nCategoryNumber);
}
sal_Unicode ScFunctionMgr::getSingleToken(const formula::IFunctionManager::EToken _eToken) const
diff --git a/sc/source/core/src/compiler.src b/sc/source/core/src/compiler.src
index d89ad70..dd3199e 100644
--- a/sc/source/core/src/compiler.src
+++ b/sc/source/core/src/compiler.src
@@ -20,51 +20,21 @@
#include "sc.hrc"
#include <formula/compiler.hrc>
-Resource RID_FUNCTION_CATEGORIES
+StringArray RID_FUNCTION_CATEGORIES
{
- String 1
- {
- Text[ en-US ] = "Database" ;
- };
- String 2
- {
- Text[ en-US ] = "Date&Time" ;
- };
- String 3
- {
- Text[ en-US ] = "Financial" ;
- };
- String 4
- {
- Text[ en-US ] = "Information" ;
- };
- String 5
- {
- Text[ en-US ] = "Logical" ;
- };
- String 6
- {
- Text[ en-US ] = "Mathematical" ;
- };
- String 7
- {
- Text[ en-US ] = "Array" ;
- };
- String 8
- {
- Text[ en-US ] = "Statistical" ;
- };
- String 9
- {
- Text[ en-US ] = "Spreadsheet" ;
- };
- String 10
- {
- Text[ en-US ] = "Text" ;
- };
- String 11
- {
- Text[ en-US ] = "Add-in" ;
+ ItemList [ en-US ] =
+ {
+ < "Database" ; >;
+ < "Date&Time" ; >;
+ < "Financial" ; >;
+ < "Information" ; >;
+ < "Logical" ; >;
+ < "Mathematical" ; >;
+ < "Array" ; >;
+ < "Statistical" ; >;
+ < "Spreadsheet" ; >;
+ < "Text" ; >;
+ < "Add-in" ; >;
};
};
diff --git a/svx/source/dialog/swframeposstrings.cxx b/svx/source/dialog/swframeposstrings.cxx
index a055b77..731b17d 100644
--- a/svx/source/dialog/swframeposstrings.cxx
+++ b/svx/source/dialog/swframeposstrings.cxx
@@ -18,44 +18,27 @@
*/
#include <svx/swframeposstrings.hxx>
-#include <tools/rc.hxx>
+#include <tools/resary.hxx>
#include <tools/debug.hxx>
#include <svx/dialmgr.hxx>
#include <svx/dialogs.hrc>
-class SvxSwFramePosString_Impl : public Resource
-{
- friend class SvxSwFramePosString;
- OUString aStrings[SvxSwFramePosString::STR_MAX];
-public:
- SvxSwFramePosString_Impl();
-};
-SvxSwFramePosString_Impl::SvxSwFramePosString_Impl() :
- Resource(SVX_RES(RID_SVXSW_FRAMEPOSITIONS))
-{
- for(sal_uInt16 i = 0; i < SvxSwFramePosString::STR_MAX; i++)
- {
- //string ids have to start at 1
- aStrings[i] = SVX_RESSTR(i + 1);
- }
- FreeResource();
-}
-
SvxSwFramePosString::SvxSwFramePosString() :
- pImpl(new SvxSwFramePosString_Impl)
+ pImpl(new ResStringArray(SVX_RES(RID_SVXSW_FRAMEPOSITIONS)))
{
+ assert(pImpl->Count() == SvxSwFramePosString::STR_MAX);
}
SvxSwFramePosString::~SvxSwFramePosString()
{
}
-const OUString& SvxSwFramePosString::GetString(StringId eId)
+OUString SvxSwFramePosString::GetString(StringId eId) const
{
DBG_ASSERT(eId >= 0 && eId < STR_MAX, "invalid StringId");
if(!(eId >= 0 && eId < STR_MAX))
eId = LEFT;
- return pImpl->aStrings[eId];
+ return pImpl->GetString(eId);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/swframeposstrings.src b/svx/source/dialog/swframeposstrings.src
index 6ba0bbd..c36efbf 100644
--- a/svx/source/dialog/swframeposstrings.src
+++ b/svx/source/dialog/swframeposstrings.src
@@ -18,220 +18,53 @@
*/
#include <svx/dialogs.hrc>
-//the following defines have to match the (enum values + 1) in svx/swframeposstrings.hxx!
-#define STR_LEFT 1
-#define STR_RIGHT 2
-#define STR_FROMLEFT 3
-#define STR_MIR_LEFT 4
-#define STR_MIR_RIGHT 5
-#define STR_MIR_FROMLEFT 6
-#define STR_FRAME 7
-#define STR_PRTAREA 8
-#define STR_REL_PG_LEFT 9
-#define STR_REL_PG_RIGHT 10
-#define STR_REL_FRM_LEFT 11
-#define STR_REL_FRM_RIGHT 12
-#define STR_MIR_REL_PG_LEFT 13
-#define STR_MIR_REL_PG_RIGHT 14
-#define STR_MIR_REL_FRM_LEFT 15
-#define STR_MIR_REL_FRM_RIGHT 16
-#define STR_REL_PG_FRAME 17
-#define STR_REL_PG_PRTAREA 18
-#define STR_REL_BASE 19
-#define STR_REL_CHAR 20
-#define STR_REL_ROW 21
-#define STR_REL_BORDER 22
-#define STR_REL_PRTAREA 23
-#define STR_FLY_REL_PG_LEFT 24
-#define STR_FLY_REL_PG_RIGHT 25
-#define STR_FLY_REL_PG_FRAME 26
-#define STR_FLY_REL_PG_PRTAREA 27
-#define STR_FLY_MIR_REL_PG_LEFT 28
-#define STR_FLY_MIR_REL_PG_RIGHT 29
-#define STR_TOP 30
-#define STR_BOTTOM 31
-#define STR_CENTER_HORI 32
-#define STR_CENTER_VERT 33
-#define STR_FROMTOP 34
-#define STR_FROMBOTTOM 35
-#define STR_BELOW 36
-#define STR_FROMRIGHT 37
-#define STR_REL_PG_TOP 38
-#define STR_REL_PG_BOTTOM 39
-#define STR_REL_FRM_TOP 40
-#define STR_REL_FRM_BOTTOM 41
-#define STR_REL_LINE 42
-
-Resource RID_SVXSW_FRAMEPOSITIONS
+//the following string have to match the (enum values) positions in svx/swframeposstrings.hxx!
+StringArray RID_SVXSW_FRAMEPOSITIONS
{
- String STR_LEFT
- {
- Text [ en-US ] = "Left" ;
- };
- String STR_MIR_LEFT
- {
- Text [ en-US ] = "Inside" ;
- };
- String STR_RIGHT
- {
- Text [ en-US ] = "Right" ;
- };
- String STR_MIR_RIGHT
- {
- Text [ en-US ] = "Outside" ;
- };
- String STR_CENTER_VERT
- {
- Text [ en-US ] = "Center" ;
- };
- String STR_FROMLEFT
- {
- Text [ en-US ] = "From left" ;
- };
- String STR_MIR_FROMLEFT
- {
- Text [ en-US ] = "From inside" ;
- };
- String STR_FRAME
- {
- Text [ en-US ] = "Paragraph area" ;
- };
- String STR_PRTAREA
- {
- Text [ en-US ] = "Paragraph text area" ;
- };
- String STR_REL_PG_LEFT
- {
- Text [ en-US ] = "Left page border" ;
- };
- String STR_MIR_REL_PG_LEFT
- {
- Text [ en-US ] = "Inner page border" ;
- };
- String STR_REL_PG_RIGHT
- {
- Text [ en-US ] = "Right page border" ;
- };
- String STR_MIR_REL_PG_RIGHT
- {
- Text [ en-US ] = "Outer page border" ;
- };
- String STR_REL_FRM_LEFT
- {
- Text [ en-US ] = "Left paragraph border" ;
- };
- String STR_MIR_REL_FRM_LEFT
- {
- Text [ en-US ] = "Inner paragraph border" ;
- };
- String STR_REL_FRM_RIGHT
- {
- Text [ en-US ] = "Right paragraph border" ;
- };
- String STR_MIR_REL_FRM_RIGHT
- {
- Text [ en-US ] = "Outer paragraph border" ;
- };
- String STR_REL_PG_FRAME
- {
- Text [ en-US ] = "Entire page" ;
- };
- String STR_REL_PG_PRTAREA
- {
- Text [ en-US ] = "Page text area" ;
- };
- String STR_TOP
- {
- Text [ en-US ] = "Top" ;
- };
- String STR_BOTTOM
- {
- Text [ en-US ] = "Bottom" ;
- };
- String STR_CENTER_HORI
- {
- Text [ en-US ] = "Center" ;
- };
- String STR_FROMTOP
- {
- Text [ en-US ] = "From top" ;
- };
- String STR_FROMBOTTOM
- {
- Text [ en-US ] = "From bottom" ;
- };
- String STR_BELOW
- {
- Text [ en-US ] = "Below" ;
- };
- String STR_FROMRIGHT
- {
- Text [ en-US ] = "From right" ;
- };
- String STR_REL_PG_TOP
- {
- Text [ en-US ] = "Top page border" ;
- };
- String STR_REL_PG_BOTTOM
- {
- Text [ en-US ] = "Bottom page border" ;
- };
- String STR_REL_FRM_TOP
- {
- Text [ en-US ] = "Top paragraph border" ;
- };
- String STR_REL_FRM_BOTTOM
- {
- Text [ en-US ] = "Bottom paragraph border" ;
- };
- String STR_REL_BORDER
- {
- Text [ en-US ] = "Margin" ;
- };
- String STR_REL_PRTAREA
- {
- Text [ en-US ] = "Paragraph text area" ;
- };
- String STR_FLY_REL_PG_LEFT
- {
- Text [ en-US ] = "Left frame border" ;
- };
- String STR_FLY_MIR_REL_PG_LEFT
- {
- Text [ en-US ] = "Inner frame border" ;
- };
- String STR_FLY_REL_PG_RIGHT
- {
- Text [ en-US ] = "Right frame border" ;
- };
- String STR_FLY_MIR_REL_PG_RIGHT
- {
- Text [ en-US ] = "Outer frame border" ;
- };
- String STR_FLY_REL_PG_FRAME
- {
- Text [ en-US ] = "Entire frame" ;
- };
- String STR_FLY_REL_PG_PRTAREA
- {
- Text [ en-US ] = "Frame text area" ;
- };
- String STR_REL_BASE
- {
- Text [ en-US ] = "Base line" ;
- };
- String STR_REL_CHAR
- {
- Text [ en-US ] = "Character" ;
- };
- String STR_REL_ROW
- {
- Text [ en-US ] = "Row" ;
- };
- // #i22341#
- String STR_REL_LINE
- {
- Text [ en-US ] = "Line of text" ;
+ ItemList [ en-US ] =
+ {
+ < "Left" ; > ;
+ < "Inside" ; > ;
+ < "Right" ; > ;
+ < "Outside" ; > ;
+ < "Center" ; > ;
+ < "From left" ; > ;
+ < "From inside" ; > ;
+ < "Paragraph area" ; > ;
+ < "Paragraph text area" ; > ;
+ < "Left page border" ; > ;
+ < "Inner page border" ; > ;
+ < "Right page border" ; > ;
+ < "Outer page border" ; > ;
+ < "Left paragraph border" ; > ;
+ < "Inner paragraph border" ; > ;
+ < "Right paragraph border" ; > ;
+ < "Outer paragraph border" ; > ;
+ < "Entire page" ; > ;
+ < "Page text area" ; > ;
+ < "Top" ; > ;
+ < "Bottom" ; > ;
+ < "Center" ; > ;
+ < "From top" ; > ;
+ < "From bottom" ; > ;
+ < "Below" ; > ;
+ < "From right" ; > ;
+ < "Top page border" ; > ;
+ < "Bottom page border" ; > ;
+ < "Top paragraph border" ; > ;
+ < "Bottom paragraph border" ; > ;
+ < "Margin" ; > ;
+ < "Paragraph text area" ; > ;
+ < "Left frame border" ; > ;
+ < "Inner frame border" ; > ;
+ < "Right frame border" ; > ;
+ < "Outer frame border" ; > ;
+ < "Entire frame" ; > ;
+ < "Frame text area" ; > ;
+ < "Base line" ; > ;
+ < "Character" ; > ;
+ < "Row" ; > ;
+ < "Line of text" ; > ;
};
};
diff --git a/sw/source/ui/utlui/utlui.src b/sw/source/ui/utlui/utlui.src
index 61f4653..574f52e 100644
--- a/sw/source/ui/utlui/utlui.src
+++ b/sw/source/ui/utlui/utlui.src
@@ -22,99 +22,33 @@
#include "helpid.h"
#include "comcore.hrc"
-Resource RID_SHELLRES_AUTOFMTSTRS
+StringArray RID_SHELLRES_AUTOFMTSTRS
{
- String STR_AUTOFMTREDL_DEL_EMPTY_PARA+1
+ ItemList [ en-US ] =
{
- Text [ en-US ] = "Remove empty paragraphs" ;
+ < "Remove empty paragraphs" ; > ;
+ < "Use replacement table" ; > ;
+ < "Correct TWo INitial CApitals" ; > ;
+ < "Capitalize first letter of sentences" ; > ;
+ < "Replace \"standard\" quotes with %1 \bcustom%2 quotes" ; > ;
+ < "Replace Custom Styles" ; > ;
+ < "Bullets replaced"; > ;
+ < "Automatic _underline_"; > ;
+ < "Automatic *bold*"; > ;
+ < "Replace 1/2 ... with ½ ..." ; > ;
+ < "URL recognition" ; > ;
+ < "Replace dashes" ; > ;
+ < "Replace 1st... with 1^st..." ; > ;
+ < "Combine single line paragraphs"; > ;
+ < "Set \"Text body\" Style"; > ;
+ < "Set \"Text body indent\" Style"; > ;
+ < "Set \"Hanging indent\" Style"; > ;
+ < "Set \"Text body indent\" Style"; > ;
+ < "Set \"Heading $(ARG1)\" Style"; > ;
+ < "Set \"Bullet\" or \"Numbering\" Style"; > ;
+ < "Combine paragraphs"; > ;
+ < "Add non breaking space"; > ;
};
- String STR_AUTOFMTREDL_USE_REPLACE+1
- {
- Text [ en-US ] = "Use replacement table" ;
- };
- String STR_AUTOFMTREDL_CPTL_STT_WORD+1
- {
- Text [ en-US ] = "Correct TWo INitial CApitals" ;
- };
- String STR_AUTOFMTREDL_CPTL_STT_SENT+1
- {
- Text [ en-US ] = "Capitalize first letter of sentences" ;
- };
- String STR_AUTOFMTREDL_TYPO+1
- {
- Text [ en-US ] = "Replace \"standard\" quotes with %1 \bcustom%2 quotes" ;
- };
- String STR_AUTOFMTREDL_USER_STYLE+1
- {
- Text [ en-US ] = "Replace Custom Styles" ;
- };
- String STR_AUTOFMTREDL_BULLET+1
- {
- Text [ en-US ] = "Bullets replaced";
- };
- String STR_AUTOFMTREDL_UNDER+1
- {
- Text [ en-US ] = "Automatic _underline_";
- };
- String STR_AUTOFMTREDL_BOLD+1
- {
- Text [ en-US ] = "Automatic *bold*";
- };
- String STR_AUTOFMTREDL_FRACTION+1
- {
- Text [ en-US ] = "Replace 1/2 ... with ½ ..." ;
- };
- String STR_AUTOFMTREDL_DETECT_URL+1
- {
- Text [ en-US ] = "URL recognition" ;
- };
- String STR_AUTOFMTREDL_DASH+1
- {
- Text [ en-US ] = "Replace dashes" ;
- };
- String STR_AUTOFMTREDL_ORDINAL+1
- {
- Text [ en-US ] = "Replace 1st... with 1^st..." ;
- };
- String STR_AUTOFMTREDL_RIGHT_MARGIN+1
- {
- Text [ en-US ] = "Combine single line paragraphs";
- };
-
- String STR_AUTOFMTREDL_SET_TMPL_TEXT +1
- {
- Text [ en-US ] = "Set \"Text body\" Style";
- };
- String STR_AUTOFMTREDL_SET_TMPL_INDENT +1
- {
- Text [ en-US ] = "Set \"Text body indent\" Style";
- };
- String STR_AUTOFMTREDL_SET_TMPL_NEG_INDENT +1
- {
- Text [ en-US ] = "Set \"Hanging indent\" Style";
- };
- String STR_AUTOFMTREDL_SET_TMPL_TEXT_INDENT +1
- {
- Text [ en-US ] = "Set \"Text body indent\" Style";
- };
- String STR_AUTOFMTREDL_SET_TMPL_HEADLINE +1
- {
- Text [ en-US ] = "Set \"Heading $(ARG1)\" Style";
- };
- String STR_AUTOFMTREDL_SET_NUMBULET +1
- {
- Text [ en-US ] = "Set \"Bullet\" or \"Numbering\" Style";
- };
-
- String STR_AUTOFMTREDL_DEL_MORELINES +1
- {
- Text [ en-US ] = "Combine paragraphs";
- };
- String STR_AUTOFMTREDL_NON_BREAK_SPACE +1
- {
- Text [ en-US ] = "Add non breaking space";
- };
-
};
// Miscellaneous
diff --git a/sw/source/uibase/utlui/initui.cxx b/sw/source/uibase/utlui/initui.cxx
index ab67b03..8e641e3 100644
--- a/sw/source/uibase/utlui/initui.cxx
+++ b/sw/source/uibase/utlui/initui.cxx
@@ -19,6 +19,7 @@
#include <config_features.h>
+#include <tools/resary.hxx>
#include <unotools/localedatawrapper.hxx>
#include <viewsh.hxx>
#include <initui.hxx>
@@ -269,35 +270,26 @@ SwGlossaryList* GetGlossaryList()
return pGlossaryList;
}
-struct ImpAutoFormatNameListLoader : public Resource
-{
- explicit ImpAutoFormatNameListLoader( std::vector<OUString>& rLst );
-};
-
void ShellResource::GetAutoFormatNameLst_() const
{
assert(!pAutoFormatNameLst);
pAutoFormatNameLst.reset( new std::vector<OUString> );
pAutoFormatNameLst->reserve(STR_AUTOFMTREDL_END);
- ImpAutoFormatNameListLoader aTmp(*pAutoFormatNameLst);
-}
-ImpAutoFormatNameListLoader::ImpAutoFormatNameListLoader( std::vector<OUString>& rLst )
- : Resource( ResId(RID_SHELLRES_AUTOFMTSTRS, *pSwResMgr) )
-{
- for( sal_uInt16 n = 0; n < STR_AUTOFMTREDL_END; ++n )
+ ResStringArray aStringArray(ResId(RID_SHELLRES_AUTOFMTSTRS, *pSwResMgr));
+ assert(aStringArray.Count() === STR_AUTOFMTREDL_END);
+ for (sal_uInt16 n = 0; n < STR_AUTOFMTREDL_END; ++n)
{
- OUString p(ResId(n + 1, *pSwResMgr));
- if(STR_AUTOFMTREDL_TYPO == n)
+ OUString p(aStringArray.GetString(n));
+ if (STR_AUTOFMTREDL_TYPO == n)
{
const SvtSysLocale aSysLocale;
const LocaleDataWrapper& rLclD = aSysLocale.GetLocaleData();
p = p.replaceFirst("%1", rLclD.getDoubleQuotationMarkStart());
p = p.replaceFirst("%2", rLclD.getDoubleQuotationMarkEnd());
}
- rLst.insert(rLst.begin() + n, p);
+ pAutoFormatNameLst->push_back(p);
}
- FreeResource();
}
OUString SwAuthorityFieldType::GetAuthFieldName(ToxAuthorityField eType)
commit 7863798f2ab420fdb91ba3dcda6cea2ab2aded9d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Feb 4 21:14:59 2017 +0000
bubble the original gtk surface type through rendering
this may make scrolling a tad faster
Change-Id: I5f11f9b3196c3d42c82ac03bc332ef84189f3737
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index 0ce76cf..962cea0 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -150,7 +150,7 @@ SalGraphics* SvpSalFrame::AcquireGraphics()
{
SvpSalGraphics* pGraphics = new SvpSalGraphics();
#ifndef IOS
- pGraphics->setSurface( m_pSurface );
+ pGraphics->setSurface(m_pSurface, B2IVector(maGeometry.nWidth, maGeometry.nHeight));
#endif
m_aGraphics.push_back( pGraphics );
return pGraphics;
@@ -281,7 +281,7 @@ void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u
for( std::list< SvpSalGraphics* >::iterator it = m_aGraphics.begin();
it != m_aGraphics.end(); ++it )
{
- (*it)->setSurface(m_pSurface);
+ (*it)->setSurface(m_pSurface, aFrameSize);
}
}
if( m_bVisible )
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 34bb744..e05617d 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -133,6 +133,22 @@ namespace
{
return source;
}
+ void mark_dirty()
+ {
+ cairo_surface_mark_dirty(source);
+ }
+ unsigned char* getBits(sal_Int32 &rStride)
+ {
+ cairo_surface_flush(source);
+
+ unsigned char *mask_data = cairo_image_surface_get_data(source);
+
+ cairo_format_t nFormat = cairo_image_surface_get_format(source);
+ assert(nFormat == CAIRO_FORMAT_ARGB32 && "need to implement CAIRO_FORMAT_A1 after all here");
+ rStride = cairo_format_stride_for_width(nFormat, cairo_image_surface_get_width(source));
+
+ return mask_data;
+ }
private:
SvpSalBitmap aTmpBmp;
cairo_surface_t* source;
@@ -386,9 +402,10 @@ SvpSalGraphics::~SvpSalGraphics()
{
}
-void SvpSalGraphics::setSurface(cairo_surface_t* pSurface)
+void SvpSalGraphics::setSurface(cairo_surface_t* pSurface, const basegfx::B2IVector& rSize)
{
m_pSurface = pSurface;
+ m_aFrameSize = rSize;
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
cairo_surface_get_device_scale(pSurface, &m_fScale, nullptr);
#endif
@@ -402,14 +419,14 @@ void SvpSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY )
sal_uInt16 SvpSalGraphics::GetBitCount() const
{
- if (CAIRO_FORMAT_A1 == cairo_image_surface_get_format(m_pSurface))
+ if (cairo_surface_get_content(m_pSurface) != CAIRO_CONTENT_COLOR_ALPHA)
return 1;
return 32;
}
long SvpSalGraphics::GetGraphicsWidth() const
{
- return m_pSurface ? cairo_image_surface_get_width(m_pSurface) / m_fScale : 0;
+ return m_pSurface ? m_aFrameSize.getX() : 0;
}
void SvpSalGraphics::ResetClipRegion()
@@ -885,7 +902,7 @@ bool SvpSalGraphics::drawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPoly, d
void SvpSalGraphics::applyColor(cairo_t *cr, SalColor aColor)
{
- if (CAIRO_FORMAT_ARGB32 == cairo_image_surface_get_format(m_pSurface))
+ if (cairo_surface_get_content(m_pSurface) == CAIRO_CONTENT_COLOR_ALPHA)
{
cairo_set_source_rgba(cr, SALCOLOR_RED(aColor)/255.0,
SALCOLOR_GREEN(aColor)/255.0,
@@ -982,17 +999,10 @@ void SvpSalGraphics::copyBits( const SalTwoRect& rTR,
if (pSrc == this)
{
//self copy is a problem, so dup source in that case
-#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 12, 0)
pCopy = cairo_surface_create_similar(source,
cairo_surface_get_content(m_pSurface),
aTR.mnSrcWidth * m_fScale,
aTR.mnSrcHeight * m_fScale);
-#else
- pCopy = cairo_surface_create_similar_image(source,
- cairo_image_surface_get_format(m_pSurface),
- aTR.mnSrcWidth * m_fScale,
- aTR.mnSrcHeight * m_fScale);
-#endif
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
cairo_surface_set_device_scale(pCopy, m_fScale, m_fScale);
#endif
@@ -1049,16 +1059,8 @@ void SvpSalGraphics::drawMask( const SalTwoRect& rTR,
/** creates an image from the given rectangle, replacing all black pixels
* with nMaskColor and make all other full transparent */
SourceHelper aSurface(rSalBitmap);
- cairo_surface_t* mask = aSurface.getSurface();
-
- cairo_surface_flush(mask);
-
- unsigned char *mask_data = cairo_image_surface_get_data(mask);
-
- cairo_format_t nFormat = cairo_image_surface_get_format(mask);
- assert(nFormat == CAIRO_FORMAT_ARGB32 && "need to implement CAIRO_FORMAT_A1 after all here");
- sal_Int32 nStride = cairo_format_stride_for_width(nFormat,
- cairo_image_surface_get_width(mask));
+ sal_Int32 nStride;
+ unsigned char *mask_data = aSurface.getBits(nStride);
for (sal_Int32 y = rTR.mnSrcY ; y < rTR.mnSrcY + rTR.mnSrcHeight; ++y)
{
unsigned char *row = mask_data + (nStride*y);
@@ -1085,7 +1087,7 @@ void SvpSalGraphics::drawMask( const SalTwoRect& rTR,
data+=4;
}
}
- cairo_surface_mark_dirty(mask);
+ aSurface.mark_dirty();
cairo_t* cr = getCairoContext(false);
clipRegion(cr);
@@ -1098,7 +1100,7 @@ void SvpSalGraphics::drawMask( const SalTwoRect& rTR,
cairo_translate(cr, rTR.mnDestX, rTR.mnDestY);
cairo_scale(cr, (double)(rTR.mnDestWidth)/rTR.mnSrcWidth, ((double)rTR.mnDestHeight)/rTR.mnSrcHeight);
- cairo_set_source_surface(cr, mask, -rTR.mnSrcX, -rTR.mnSrcY);
+ cairo_set_source_surface(cr, aSurface.getSurface(), -rTR.mnSrcX, -rTR.mnSrcY);
cairo_paint(cr);
releaseCairoContext(cr, false, extents);
@@ -1123,18 +1125,24 @@ SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeigh
SalColor SvpSalGraphics::getPixel( long nX, long nY )
{
- cairo_surface_flush(m_pSurface);
- cairo_format_t nFormat = cairo_image_surface_get_format(m_pSurface);
- assert(nFormat == CAIRO_FORMAT_ARGB32 && "need to implement CAIRO_FORMAT_A1 after all here");
- sal_Int32 nStride = cairo_format_stride_for_width(nFormat,
- cairo_image_surface_get_width(m_pSurface));
- unsigned char *surface_data = cairo_image_surface_get_data(m_pSurface);
- unsigned char *row = surface_data + (nStride*nY);
- unsigned char *data = row + (nX * 4);
+ cairo_surface_t *target = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 1, 1);
+ cairo_t* cr = cairo_create(target);
+
+ cairo_rectangle(cr, 0, 0, 1, 1);
+ cairo_set_source_surface(cr, m_pSurface, -nX, -nY);
+ cairo_paint(cr);
+ cairo_destroy(cr);
+
+ cairo_surface_flush(target);
+ unsigned char *data = cairo_image_surface_get_data(target);
sal_uInt8 b = unpremultiply(data[SVP_CAIRO_BLUE], data[SVP_CAIRO_ALPHA]);
sal_uInt8 g = unpremultiply(data[SVP_CAIRO_GREEN], data[SVP_CAIRO_ALPHA]);
sal_uInt8 r = unpremultiply(data[SVP_CAIRO_RED], data[SVP_CAIRO_ALPHA]);
- return MAKE_SALCOLOR(r, g, b);
+ SalColor nRet = MAKE_SALCOLOR(r, g, b);
+
+ cairo_surface_destroy(target);
+
+ return nRet;
}
namespace
@@ -1268,17 +1276,17 @@ cairo_surface_t* SvpSalGraphics::createCairoSurface(const BitmapBuffer *pBuffer)
return target;
}
-static cairo_t* createTmpCompatibleCairoContext(cairo_surface_t* pSurface, double fScale)
+cairo_t* SvpSalGraphics::createTmpCompatibleCairoContext() const
{
- cairo_surface_t *target = cairo_image_surface_create(
- cairo_image_surface_get_format(pSurface),
- cairo_image_surface_get_width(pSurface),
- cairo_image_surface_get_height(pSurface));
+ cairo_surface_t *target = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
+ m_aFrameSize.getX() * m_fScale,
+ m_aFrameSize.getY() * m_fScale);
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
- cairo_surface_set_device_scale(target, fScale, fScale);
+ cairo_surface_set_device_scale(target, m_fScale, m_fScale);
#else
(void)fScale;
#endif
+
return cairo_create(target);
}
@@ -1286,7 +1294,7 @@ cairo_t* SvpSalGraphics::getCairoContext(bool bXorModeAllowed) const
{
cairo_t* cr;
if (m_ePaintMode == XOR && bXorModeAllowed)
- cr = createTmpCompatibleCairoContext(m_pSurface, m_fScale);
+ cr = createTmpCompatibleCairoContext();
else
cr = cairo_create(m_pSurface);
cairo_set_line_width(cr, 1);
@@ -1316,8 +1324,8 @@ void SvpSalGraphics::releaseCairoContext(cairo_t* cr, bool bXorModeAllowed, cons
sal_Int32 nExtentsLeft(rExtents.getMinX()), nExtentsTop(rExtents.getMinY());
sal_Int32 nExtentsRight(rExtents.getMaxX()), nExtentsBottom(rExtents.getMaxY());
- sal_Int32 nWidth = cairo_image_surface_get_width(m_pSurface);
- sal_Int32 nHeight = cairo_image_surface_get_height(m_pSurface);
+ sal_Int32 nWidth = m_aFrameSize.getX();
+ sal_Int32 nHeight = m_aFrameSize.getY();
nExtentsLeft = std::max<sal_Int32>(nExtentsLeft, 0);
nExtentsTop = std::max<sal_Int32>(nExtentsTop, 0);
nExtentsRight = std::min<sal_Int32>(nExtentsRight, nWidth);
@@ -1331,21 +1339,35 @@ void SvpSalGraphics::releaseCairoContext(cairo_t* cr, bool bXorModeAllowed, cons
//emulate it (slowly) here.
if (m_ePaintMode == XOR && bXorModeAllowed)
{
- cairo_surface_t* true_surface = m_pSurface;
- cairo_surface_flush(true_surface);
- unsigned char *true_surface_data = cairo_image_surface_get_data(true_surface);
+ cairo_surface_t* target_surface = m_pSurface;
+ if (cairo_surface_get_type(target_surface) != CAIRO_SURFACE_TYPE_IMAGE)
+ {
+ //in the unlikely case we can't use m_pSurface directly, copy contents
+ //to another temp image surface
+ cairo_t* copycr = createTmpCompatibleCairoContext();
+ cairo_rectangle(copycr, nExtentsLeft, nExtentsTop,
+ nExtentsRight - nExtentsLeft,
+ nExtentsBottom - nExtentsTop);
+ cairo_set_source_surface(copycr, m_pSurface, 0, 0);
+ cairo_paint(copycr);
+ target_surface = cairo_get_target(copycr);
+ cairo_destroy(copycr);
+ }
+
+ cairo_surface_flush(target_surface);
+ unsigned char *target_surface_data = cairo_image_surface_get_data(target_surface);
unsigned char *xor_surface_data = cairo_image_surface_get_data(surface);
cairo_format_t nFormat = cairo_image_surface_get_format(m_pSurface);
assert(nFormat == CAIRO_FORMAT_ARGB32 && "need to implement CAIRO_FORMAT_A1 after all here");
- sal_Int32 nStride = cairo_format_stride_for_width(nFormat, nWidth);
+ sal_Int32 nStride = cairo_format_stride_for_width(nFormat, nWidth * m_fScale);
sal_Int32 nUnscaledExtentsLeft = nExtentsLeft * m_fScale;
sal_Int32 nUnscaledExtentsRight = nExtentsRight * m_fScale;
sal_Int32 nUnscaledExtentsTop = nExtentsTop * m_fScale;
sal_Int32 nUnscaledExtentsBottom = nExtentsBottom * m_fScale;
for (sal_Int32 y = nUnscaledExtentsTop; y < nUnscaledExtentsBottom; ++y)
{
- unsigned char *true_row = true_surface_data + (nStride*y);
+ unsigned char *true_row = target_surface_data + (nStride*y);
unsigned char *xor_row = xor_surface_data + (nStride*y);
unsigned char *true_data = true_row + (nUnscaledExtentsLeft * 4);
unsigned char *xor_data = xor_row + (nUnscaledExtentsLeft * 4);
@@ -1364,7 +1386,22 @@ void SvpSalGraphics::releaseCairoContext(cairo_t* cr, bool bXorModeAllowed, cons
xor_data+=4;
}
}
- cairo_surface_mark_dirty(true_surface);
+ cairo_surface_mark_dirty(target_surface);
+
+ if (target_surface != m_pSurface)
+ {
+ cairo_t* copycr = cairo_create(m_pSurface);
+ //unlikely case we couldn't use m_pSurface directly, copy contents
+ //back from image surface
+ cairo_rectangle(copycr, nExtentsLeft, nExtentsTop,
+ nExtentsRight - nExtentsLeft,
+ nExtentsBottom - nExtentsTop);
+ cairo_set_source_surface(copycr, target_surface, 0, 0);
+ cairo_paint(copycr);
+ cairo_destroy(copycr);
+ cairo_surface_destroy(target_surface);
+ }
+
cairo_surface_destroy(surface);
}
diff --git a/vcl/headless/svpvd.cxx b/vcl/headless/svpvd.cxx
index ca28a52..b5ab755 100644
--- a/vcl/headless/svpvd.cxx
+++ b/vcl/headless/svpvd.cxx
@@ -38,7 +38,7 @@ SvpSalVirtualDevice::~SvpSalVirtualDevice()
SalGraphics* SvpSalVirtualDevice::AcquireGraphics()
{
SvpSalGraphics* pGraphics = new SvpSalGraphics();
- pGraphics->setSurface(m_pSurface);
+ pGraphics->setSurface(m_pSurface, m_aFrameSize);
m_aGraphics.push_back( pGraphics );
return pGraphics;
}
@@ -62,12 +62,14 @@ bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY,
if (nNewDY == 0)
nNewDY = 1;
- nNewDX *= m_fScale;
- nNewDY *= m_fScale;
-
- if (!m_pSurface || cairo_image_surface_get_width(m_pSurface) != nNewDX ||
- cairo_image_surface_get_height(m_pSurface) != nNewDY )
+ if (!m_pSurface || m_aFrameSize.getX() != nNewDX ||
+ m_aFrameSize.getY() != nNewDY )
{
+ m_aFrameSize = basegfx::B2IVector(nNewDX, nNewDY);
+
+ nNewDX *= m_fScale;
+ nNewDY *= m_fScale;
+
if (m_pSurface)
{
cairo_surface_destroy(m_pSurface);
@@ -96,20 +98,19 @@ bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY,
// update device in existing graphics
for( std::list< SvpSalGraphics* >::iterator it = m_aGraphics.begin();
it != m_aGraphics.end(); ++it )
- (*it)->setSurface(m_pSurface);
-
+ (*it)->setSurface(m_pSurface, m_aFrameSize);
}
return true;
}
long SvpSalVirtualDevice::GetWidth() const
{
- return m_pSurface ? cairo_image_surface_get_width(m_pSurface) : 0;
+ return m_pSurface ? m_aFrameSize.getX() : 0;
}
long SvpSalVirtualDevice::GetHeight() const
{
- return m_pSurface ? cairo_image_surface_get_height(m_pSurface) : 0;
+ return m_pSurface ? m_aFrameSize.getY() : 0;
}
#endif
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index 8083474..5673706 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -80,6 +80,7 @@ struct VCL_DLLPUBLIC DamageHandler
class VCL_DLLPUBLIC SvpSalGraphics : public SalGraphics
{
cairo_surface_t* m_pSurface;
+ basegfx::B2IVector m_aFrameSize;
double m_fScale;
SalColor m_aLineColor;
SalColor m_aFillColor;
@@ -87,7 +88,7 @@ class VCL_DLLPUBLIC SvpSalGraphics : public SalGraphics
public:
static GlyphCache& getPlatformGlyphCache();
- void setSurface(cairo_surface_t* pSurface);
+ void setSurface(cairo_surface_t* pSurface, const basegfx::B2IVector& rSize);
static cairo_user_data_key_t* getDamageKey();
private:
@@ -115,6 +116,8 @@ protected:
const SalBitmap* pAlphaBitmap) override;
virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ) override;
+ cairo_t* createTmpCompatibleCairoContext() const;
+
public:
SvpSalGraphics();
virtual ~SvpSalGraphics() override;
diff --git a/vcl/inc/headless/svpvd.hxx b/vcl/inc/headless/svpvd.hxx
index 882f36d..7ac1563 100644
--- a/vcl/inc/headless/svpvd.hxx
+++ b/vcl/inc/headless/svpvd.hxx
@@ -31,6 +31,7 @@ class VCL_DLLPUBLIC SvpSalVirtualDevice : public SalVirtualDevice
{
DeviceFormat m_eFormat;
cairo_surface_t* m_pSurface;
+ basegfx::B2IVector m_aFrameSize;
double m_fScale;
std::list< SvpSalGraphics* > m_aGraphics;
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index a0c86b3..51977c25 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -246,6 +246,7 @@ class GtkSalFrame : public SalFrame
#endif
#if GTK_CHECK_VERSION(3,0,0)
static gboolean signalDraw( GtkWidget*, cairo_t *cr, gpointer );
+ static void signalRealize(GtkWidget*, gpointer frame);
static void sizeAllocated(GtkWidget*, GdkRectangle *pAllocation, gpointer frame);
static gboolean signalTooltipQuery(GtkWidget*, gint x, gint y,
gboolean keyboard_mode, GtkTooltip *tooltip,
@@ -346,6 +347,7 @@ class GtkSalFrame : public SalFrame
public:
#if GTK_CHECK_VERSION(3,0,0)
cairo_surface_t* m_pSurface;
+ basegfx::B2IVector m_aFrameSize;
DamageHandler m_aDamageHandler;
int m_nGrabLevel;
bool m_bSalObjectSetPosSize;
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index a74555f..e2d19fe 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -1039,6 +1039,7 @@ void GtkSalFrame::InitCommon()
m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "scroll-event", G_CALLBACK(signalScroll), this ));
g_signal_connect( G_OBJECT(m_pFixedContainer), "draw", G_CALLBACK(signalDraw), this );
+ g_signal_connect( G_OBJECT(m_pFixedContainer), "realize", G_CALLBACK(signalRealize), this );
g_signal_connect( G_OBJECT(m_pFixedContainer), "size-allocate", G_CALLBACK(sizeAllocated), this );
#if GTK_CHECK_VERSION(3,14,0)
GtkGesture *pSwipe = gtk_gesture_swipe_new(pEventWidget);
@@ -1335,7 +1336,7 @@ SalGraphics* GtkSalFrame::AcquireGraphics()
AllocateFrame();
TriggerPaintEvent();
}
- m_pGraphics->setSurface(m_pSurface);
+ m_pGraphics->setSurface(m_pSurface, m_aFrameSize);
}
m_bGraphics = true;
return m_pGraphics;
@@ -1562,13 +1563,11 @@ void GtkSalFrame::SetMinClientSize( long nWidth, long nHeight )
}
}
-// FIXME: we should really be an SvpSalFrame sub-class, and
-// share their AllocateFrame !
void GtkSalFrame::AllocateFrame()
{
basegfx::B2IVector aFrameSize( maGeometry.nWidth, maGeometry.nHeight );
- if (!m_pSurface || cairo_image_surface_get_width(m_pSurface) != aFrameSize.getX() ||
- cairo_image_surface_get_height(m_pSurface) != aFrameSize.getY() )
+ if (!m_pSurface || m_aFrameSize.getX() != aFrameSize.getX() ||
+ m_aFrameSize.getY() != aFrameSize.getY() )
{
if( aFrameSize.getX() == 0 )
aFrameSize.setX( 1 );
@@ -1578,30 +1577,17 @@ void GtkSalFrame::AllocateFrame()
if (m_pSurface)
cairo_surface_destroy(m_pSurface);
-#if GTK_CHECK_VERSION(3,10,0)
-#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
- int scale = gtk_widget_get_scale_factor(m_pWindow);
-#else
- int scale = 1;
-#endif
- m_pSurface = gdk_window_create_similar_image_surface(widget_get_window(m_pWindow),
- CAIRO_FORMAT_ARGB32,
- aFrameSize.getX() * scale,
- aFrameSize.getY() * scale,
- scale);
-#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
- cairo_surface_set_device_scale(m_pSurface, scale, scale);
-#endif
-#else
- m_pSurface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
- aFrameSize.getX(),
- aFrameSize.getY());
-#endif
+ m_pSurface = gdk_window_create_similar_surface(widget_get_window(m_pWindow),
+ CAIRO_CONTENT_COLOR_ALPHA,
+ aFrameSize.getX(),
+ aFrameSize.getY());
+ m_aFrameSize = aFrameSize;
+
cairo_surface_set_user_data(m_pSurface, SvpSalGraphics::getDamageKey(), &m_aDamageHandler, nullptr);
SAL_INFO("vcl.gtk3", "allocated Frame size of " << maGeometry.nWidth << " x " << maGeometry.nHeight);
if (m_pGraphics)
- m_pGraphics->setSurface(m_pSurface);
+ m_pGraphics->setSurface(m_pSurface, m_aFrameSize);
}
}
@@ -2889,13 +2875,23 @@ gboolean GtkSalFrame::signalDraw(GtkWidget*, cairo_t *cr, gpointer frame)
return false;
}
-void GtkSalFrame::sizeAllocated(GtkWidget*, GdkRectangle *pAllocation, gpointer frame)
+void GtkSalFrame::sizeAllocated(GtkWidget* pWidget, GdkRectangle *pAllocation, gpointer frame)
{
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
pThis->maGeometry.nWidth = pAllocation->width;
pThis->maGeometry.nHeight = pAllocation->height;
- pThis->AllocateFrame();
+ bool bRealized = gtk_widget_get_realized(pWidget);
+ if (bRealized)
+ pThis->AllocateFrame();
pThis->CallCallbackExc( SalEvent::Resize, nullptr );
+ if (bRealized && !pThis->m_bSalObjectSetPosSize)
+ pThis->TriggerPaintEvent();
+}
+
+void GtkSalFrame::signalRealize(GtkWidget*, gpointer frame)
+{
+ GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
+ pThis->AllocateFrame();
if (pThis->m_bSalObjectSetPosSize)
return;
pThis->TriggerPaintEvent();
More information about the Libreoffice-commits
mailing list