[Libreoffice-commits] core.git: 4 commits - include/sfx2 sfx2/source svtools/source
Caolán McNamara
caolanm at redhat.com
Fri Oct 7 09:46:26 UTC 2016
include/sfx2/sidebar/Sidebar.hrc | 60 -----------------------------
include/sfx2/sidebar/SidebarResource.hxx | 35 -----------------
sfx2/source/sidebar/DeckTitleBar.cxx | 2
sfx2/source/sidebar/PanelTitleBar.cxx | 2
sfx2/source/sidebar/Sidebar.hrc | 60 +++++++++++++++++++++++++++++
sfx2/source/sidebar/Sidebar.src | 29 +++++++-------
sfx2/source/sidebar/SidebarController.cxx | 10 +---
sfx2/source/sidebar/TabBar.cxx | 2
sfx2/source/sidebar/Theme.cxx | 3 -
svtools/source/svhtml/htmlout.cxx | 61 +++++++++++++-----------------
10 files changed, 110 insertions(+), 154 deletions(-)
New commits:
commit 6a64d97ea118c3252ce21a157368a3a15f1607f5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 7 10:22:05 2016 +0100
we don't need the code, but we need the images in the src file
apparently so they can be found at postprocess time and
inserted into the image zips for the use of the pngs by
other consumers
Change-Id: Ib45834da69462109fdf7502176a6f4721057d980
diff --git a/include/sfx2/sidebar/SidebarResource.hxx b/include/sfx2/sidebar/SidebarResource.hxx
deleted file mode 100644
index 78ce96b..0000000
--- a/include/sfx2/sidebar/SidebarResource.hxx
+++ /dev/null
@@ -1,35 +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_SFX2_SOURCE_SIDEBAR_SIDEBARRESOURCE_HXX
-#define INCLUDED_SFX2_SOURCE_SIDEBAR_SIDEBARRESOURCE_HXX
-
-#include <sfx2/sidebar/Sidebar.hrc>
-#include <sfx2/sfxresid.hxx>
-#include <tools/rc.hxx>
-
-class SidebarResource : public Resource
-{
-public:
- SidebarResource() : Resource(SfxResId(RID_SIDEBAR_RESOURCE)){}
- ~SidebarResource() { FreeResource(); }
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/sidebar/DeckTitleBar.cxx b/sfx2/source/sidebar/DeckTitleBar.cxx
index 22ddec1..29067d1 100644
--- a/sfx2/source/sidebar/DeckTitleBar.cxx
+++ b/sfx2/source/sidebar/DeckTitleBar.cxx
@@ -21,7 +21,7 @@
#include <sfx2/sidebar/Theme.hxx>
#include <sfx2/sfxresid.hxx>
-#include <sfx2/sidebar/Sidebar.hrc>
+#include "Sidebar.hrc"
#include <vcl/image.hxx>
diff --git a/sfx2/source/sidebar/PanelTitleBar.cxx b/sfx2/source/sidebar/PanelTitleBar.cxx
index 7a16f33..d13dc74 100644
--- a/sfx2/source/sidebar/PanelTitleBar.cxx
+++ b/sfx2/source/sidebar/PanelTitleBar.cxx
@@ -20,7 +20,7 @@
#include <sfx2/sidebar/PanelTitleBar.hxx>
#include <sfx2/sfxresid.hxx>
-#include <sfx2/sidebar/Sidebar.hrc>
+#include "Sidebar.hrc"
#include <sfx2/sidebar/Paint.hxx>
#include <sfx2/sidebar/Panel.hxx>
diff --git a/include/sfx2/sidebar/Sidebar.hrc b/sfx2/source/sidebar/Sidebar.hrc
similarity index 84%
rename from include/sfx2/sidebar/Sidebar.hrc
rename to sfx2/source/sidebar/Sidebar.hrc
index 96597cf..79d5a81 100644
--- a/include/sfx2/sidebar/Sidebar.hrc
+++ b/sfx2/source/sidebar/Sidebar.hrc
@@ -49,12 +49,12 @@
#define IMAGE_SIDEBAR_DECK_TRANSITION_SMALL 122
#define IMAGE_SIDEBAR_DECK_FUNCTIONS_LARGE 130
#define IMAGE_SIDEBAR_DECK_FUNCTIONS_SMALL 132
-#define STRING_CUSTOMIZATION 200
-#define STRING_RESTORE 201
-#define STRING_HIDE_SIDEBAR 202
-#define SFX_STR_SIDEBAR_MORE_OPTIONS (RID_SFX_SIDEBAR_START + 1)
-#define SFX_STR_SIDEBAR_CLOSE_DECK (RID_SFX_SIDEBAR_START + 2)
-#define SFX_STR_SIDEBAR_SETTINGS (RID_SFX_SIDEBAR_START + 3)
+#define SFX_STR_SIDEBAR_MORE_OPTIONS (RID_SFX_SIDEBAR_START + 1)
+#define SFX_STR_SIDEBAR_CLOSE_DECK (RID_SFX_SIDEBAR_START + 2)
+#define SFX_STR_SIDEBAR_SETTINGS (RID_SFX_SIDEBAR_START + 3)
+#define SFX_STR_SIDEBAR_CUSTOMIZATION (RID_SFX_SIDEBAR_START + 4)
+#define SFX_STR_SIDEBAR_RESTORE (RID_SFX_SIDEBAR_START + 5)
+#define SFX_STR_SIDEBAR_HIDE_SIDEBAR (RID_SFX_SIDEBAR_START + 6)
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/sidebar/Sidebar.src b/sfx2/source/sidebar/Sidebar.src
index 2320307..9179a2f 100644
--- a/sfx2/source/sidebar/Sidebar.src
+++ b/sfx2/source/sidebar/Sidebar.src
@@ -16,7 +16,7 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <sfx2/sidebar/Sidebar.hrc>
+#include "Sidebar.hrc"
Resource RID_SIDEBAR_RESOURCE
{
@@ -141,18 +141,6 @@ Resource RID_SIDEBAR_RESOURCE
{
ImageBitmap = Bitmap { File = "symphony/sidebar-functions-small.png" ;};
};
- String STRING_CUSTOMIZATION
- {
- Text [en-US] = "Customization";
- };
- String STRING_RESTORE
- {
- Text [en-US] = "Restore Default";
- };
- String STRING_HIDE_SIDEBAR
- {
- Text [en-US] = "Close Sidebar";
- };
};
String SFX_STR_SIDEBAR_MORE_OPTIONS
@@ -170,4 +158,19 @@ String SFX_STR_SIDEBAR_SETTINGS
Text [en-US] = "Sidebar Settings";
};
+String SFX_STR_SIDEBAR_CUSTOMIZATION
+{
+ Text [en-US] = "Customization";
+};
+
+String SFX_STR_SIDEBAR_RESTORE
+{
+ Text [en-US] = "Restore Default";
+};
+
+String SFX_STR_SIDEBAR_HIDE_SIDEBAR
+{
+ Text [en-US] = "Close Sidebar";
+};
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 56e8888..71d8592 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -21,7 +21,6 @@
#include <sfx2/sidebar/DeckTitleBar.hxx>
#include <sfx2/sidebar/Panel.hxx>
#include <sfx2/sidebar/PanelTitleBar.hxx>
-#include <sfx2/sidebar/SidebarResource.hxx>
#include <sfx2/sidebar/TabBar.hxx>
#include <sfx2/sidebar/Theme.hxx>
#include <sfx2/sidebar/SidebarChildWindow.hxx>
@@ -35,6 +34,7 @@
#include <sfx2/sfxsids.hrc>
#include <sfx2/titledockwin.hxx>
#include "sfxlocal.hrc"
+#include "Sidebar.hrc"
#include <framework/ContextChangeEventMultiplexerTunnel.hxx>
#include <vcl/floatwin.hxx>
#include <vcl/fixed.hxx>
@@ -943,8 +943,6 @@ VclPtr<PopupMenu> SidebarController::CreatePopupMenu (
// Create sub menu for customization (hiding of deck tabs.)
VclPtr<PopupMenu> pCustomizationMenu = VclPtr<PopupMenu>::Create();
- SidebarResource aLocalResource;
-
// Add one entry for every tool panel element to individually make
// them visible or hide them.
sal_Int32 nIndex (0);
@@ -981,11 +979,11 @@ VclPtr<PopupMenu> SidebarController::CreatePopupMenu (
else
pMenu->InsertItem(MID_UNLOCK_TASK_PANEL, SFX2_RESSTR(STR_SFX_UNDOCK));
- pMenu->InsertItem(MID_HIDE_SIDEBAR, SFX2_RESSTR(STRING_HIDE_SIDEBAR));
+ pMenu->InsertItem(MID_HIDE_SIDEBAR, SFX2_RESSTR(SFX_STR_SIDEBAR_HIDE_SIDEBAR));
pCustomizationMenu->InsertSeparator();
- pCustomizationMenu->InsertItem(MID_RESTORE_DEFAULT, SFX2_RESSTR(STRING_RESTORE));
+ pCustomizationMenu->InsertItem(MID_RESTORE_DEFAULT, SFX2_RESSTR(SFX_STR_SIDEBAR_RESTORE));
- pMenu->InsertItem(MID_CUSTOMIZATION, SFX2_RESSTR(STRING_CUSTOMIZATION));
+ pMenu->InsertItem(MID_CUSTOMIZATION, SFX2_RESSTR(SFX_STR_SIDEBAR_CUSTOMIZATION));
pMenu->SetPopupMenu(MID_CUSTOMIZATION, pCustomizationMenu);
pMenu->RemoveDisabledEntries(false);
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index 0471cac..87777de 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -28,7 +28,7 @@
#include <sfx2/sidebar/SidebarController.hxx>
#include <sfx2/sfxresid.hxx>
-#include <sfx2/sidebar/Sidebar.hrc>
+#include "Sidebar.hrc"
#include <vcl/gradient.hxx>
#include <vcl/image.hxx>
diff --git a/sfx2/source/sidebar/Theme.cxx b/sfx2/source/sidebar/Theme.cxx
index 6858627..b821f4f 100644
--- a/sfx2/source/sidebar/Theme.cxx
+++ b/sfx2/source/sidebar/Theme.cxx
@@ -18,7 +18,6 @@
*/
#include <sfx2/sidebar/Theme.hxx>
#include <sfx2/sidebar/Paint.hxx>
-#include <sfx2/sidebar/SidebarResource.hxx>
#include <sfx2/sidebar/Tools.hxx>
#include <sfx2/app.hxx>
@@ -144,8 +143,6 @@ void Theme::InitializeTheme()
void Theme::UpdateTheme()
{
- SidebarResource aLocalResource;
-
try
{
const StyleSettings& rStyle (Application::GetSettings().GetStyleSettings());
commit 4dab1026198907dc7821dc5fdf1971945d552cb7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 7 10:01:27 2016 +0100
merge copies of flushing code together
and give it descriptive name cause it confused me as to what it did
Change-Id: I37b761ab917a75c8364db9c3f7b4896c2dd217bc
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
index 7a0df72..a8a3fb5 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -388,6 +388,17 @@ static const sal_Char *lcl_svhtml_GetEntityForChar( sal_Unicode c,
return pStr;
}
+static sal_Size lcl_FlushContext(HTMLOutContext& rContext, sal_Char* pBuffer, sal_uInt32 nFlags)
+{
+ sal_uInt32 nInfo = 0;
+ sal_Size nSrcChars;
+ sal_Size nLen = rtl_convertUnicodeToText(rContext.m_hConv, rContext.m_hContext, nullptr, 0,
+ pBuffer, TXTCONV_BUFFER_SIZE, nFlags|RTL_UNICODETOTEXT_FLAGS_FLUSH,
+ &nInfo, &nSrcChars);
+ DBG_ASSERT((nInfo & (RTL_UNICODETOTEXT_INFO_ERROR|RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL)) == 0, "HTMLOut: error while flushing");
+ return nLen;
+}
+
static OString lcl_ConvertCharToHTML( sal_Unicode c,
HTMLOutContext& rContext,
OUString *pNonConvertableChars )
@@ -418,20 +429,13 @@ static OString lcl_ConvertCharToHTML( sal_Unicode c,
}
sal_Char cBuffer[TXTCONV_BUFFER_SIZE];
- sal_uInt32 nInfo = 0;
- sal_Size nSrcChars;
const sal_uInt32 nFlags = RTL_UNICODETOTEXT_FLAGS_NONSPACING_IGNORE|
- RTL_UNICODETOTEXT_FLAGS_CONTROL_IGNORE|
- RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR|
- RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR;
+ RTL_UNICODETOTEXT_FLAGS_CONTROL_IGNORE|
+ RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR|
+ RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR;
if( pStr )
{
- sal_Size nLen = rtl_convertUnicodeToText(
- rContext.m_hConv, rContext.m_hContext, nullptr, 0,
- cBuffer, TXTCONV_BUFFER_SIZE,
- nFlags|RTL_UNICODETOTEXT_FLAGS_FLUSH,
- &nInfo, &nSrcChars );
- DBG_ASSERT( (nInfo & (RTL_UNICODETOTEXT_INFO_ERROR|RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL)) == 0, "HTMLOut: error while flushing" );
+ sal_Size nLen = lcl_FlushContext(rContext, cBuffer, nFlags);
sal_Char *pBuffer = cBuffer;
while( nLen-- )
aDest.append(*pBuffer++);
@@ -439,11 +443,13 @@ static OString lcl_ConvertCharToHTML( sal_Unicode c,
}
else
{
- sal_Size nLen = rtl_convertUnicodeToText( rContext.m_hConv,
- rContext.m_hContext, &c, 1,
- cBuffer, TXTCONV_BUFFER_SIZE,
- nFlags,
- &nInfo, &nSrcChars );
+ sal_uInt32 nInfo = 0;
+ sal_Size nSrcChars;
+
+ sal_Size nLen = rtl_convertUnicodeToText(rContext.m_hConv,
+ rContext.m_hContext, &c, 1,
+ cBuffer, TXTCONV_BUFFER_SIZE,
+ nFlags, &nInfo, &nSrcChars);
if( nLen > 0 && (nInfo & (RTL_UNICODETOTEXT_INFO_ERROR|RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL)) == 0 )
{
sal_Char *pBuffer = cBuffer;
@@ -456,12 +462,7 @@ static OString lcl_ConvertCharToHTML( sal_Unicode c,
// character set, the UNICODE character is exported as character
// entity.
// coverity[callee_ptr_arith]
- nLen = rtl_convertUnicodeToText(
- rContext.m_hConv, rContext.m_hContext, nullptr, 0,
- cBuffer, TXTCONV_BUFFER_SIZE,
- nFlags|RTL_UNICODETOTEXT_FLAGS_FLUSH,
- &nInfo, &nSrcChars );
- DBG_ASSERT( (nInfo & (RTL_UNICODETOTEXT_INFO_ERROR|RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL)) == 0, "HTMLOut: error while flushing" );
+ nLen = lcl_FlushContext(rContext, cBuffer, nFlags);
sal_Char *pBuffer = cBuffer;
while( nLen-- )
aDest.append(*pBuffer++);
@@ -481,18 +482,11 @@ static OString lcl_FlushToAscii( HTMLOutContext& rContext )
OStringBuffer aDest;
sal_Char cBuffer[TXTCONV_BUFFER_SIZE];
- sal_uInt32 nInfo = 0;
- sal_Size nSrcChars;
const sal_uInt32 nFlags = RTL_UNICODETOTEXT_FLAGS_NONSPACING_IGNORE|
- RTL_UNICODETOTEXT_FLAGS_CONTROL_IGNORE|
- RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR|
- RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR;
- sal_Size nLen = rtl_convertUnicodeToText(
- rContext.m_hConv, rContext.m_hContext, nullptr, 0,
- cBuffer, TXTCONV_BUFFER_SIZE,
- nFlags|RTL_UNICODETOTEXT_FLAGS_FLUSH,
- &nInfo, &nSrcChars );
- DBG_ASSERT( (nInfo & (RTL_UNICODETOTEXT_INFO_ERROR|RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL)) == 0, "HTMLOut: error while flushing" );
+ RTL_UNICODETOTEXT_FLAGS_CONTROL_IGNORE|
+ RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR|
+ RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR;
+ sal_Size nLen = lcl_FlushContext(rContext, cBuffer, nFlags);
sal_Char *pBuffer = cBuffer;
while( nLen-- )
aDest.append(*pBuffer++);
commit a47d1a47184e84755f0f28300a1e477b2a6c1176
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 7 09:49:47 2016 +0100
might as well rearrange these flushes to all look the same
no logic change intended
Change-Id: I0f2552ad604d83eea46822aba137cc780c3be60a
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
index aa30af1..7a0df72 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -486,11 +486,11 @@ static OString lcl_FlushToAscii( HTMLOutContext& rContext )
const sal_uInt32 nFlags = RTL_UNICODETOTEXT_FLAGS_NONSPACING_IGNORE|
RTL_UNICODETOTEXT_FLAGS_CONTROL_IGNORE|
RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR|
- RTL_UNICODETOTEXT_FLAGS_FLUSH|
RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR;
sal_Size nLen = rtl_convertUnicodeToText(
rContext.m_hConv, rContext.m_hContext, nullptr, 0,
- cBuffer, TXTCONV_BUFFER_SIZE, nFlags,
+ cBuffer, TXTCONV_BUFFER_SIZE,
+ nFlags|RTL_UNICODETOTEXT_FLAGS_FLUSH,
&nInfo, &nSrcChars );
DBG_ASSERT( (nInfo & (RTL_UNICODETOTEXT_INFO_ERROR|RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL)) == 0, "HTMLOut: error while flushing" );
sal_Char *pBuffer = cBuffer;
commit 35dce8716bcc60b967e704564a30e2110167ad58
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 7 09:47:48 2016 +0100
for 0 len arg, the source might as well be nullptr for these flushing cases
Change-Id: I59a3c04d0cbeb92cd0d9348c2ed0cf65cb5683d4
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
index 82e4f8c..aa30af1 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -427,7 +427,7 @@ static OString lcl_ConvertCharToHTML( sal_Unicode c,
if( pStr )
{
sal_Size nLen = rtl_convertUnicodeToText(
- rContext.m_hConv, rContext.m_hContext, &c, 0,
+ rContext.m_hConv, rContext.m_hContext, nullptr, 0,
cBuffer, TXTCONV_BUFFER_SIZE,
nFlags|RTL_UNICODETOTEXT_FLAGS_FLUSH,
&nInfo, &nSrcChars );
@@ -457,7 +457,7 @@ static OString lcl_ConvertCharToHTML( sal_Unicode c,
// entity.
// coverity[callee_ptr_arith]
nLen = rtl_convertUnicodeToText(
- rContext.m_hConv, rContext.m_hContext, &c, 0,
+ rContext.m_hConv, rContext.m_hContext, nullptr, 0,
cBuffer, TXTCONV_BUFFER_SIZE,
nFlags|RTL_UNICODETOTEXT_FLAGS_FLUSH,
&nInfo, &nSrcChars );
@@ -480,7 +480,6 @@ static OString lcl_FlushToAscii( HTMLOutContext& rContext )
{
OStringBuffer aDest;
- sal_Unicode c = 0;
sal_Char cBuffer[TXTCONV_BUFFER_SIZE];
sal_uInt32 nInfo = 0;
sal_Size nSrcChars;
@@ -490,7 +489,7 @@ static OString lcl_FlushToAscii( HTMLOutContext& rContext )
RTL_UNICODETOTEXT_FLAGS_FLUSH|
RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR;
sal_Size nLen = rtl_convertUnicodeToText(
- rContext.m_hConv, rContext.m_hContext, &c, 0,
+ rContext.m_hConv, rContext.m_hContext, nullptr, 0,
cBuffer, TXTCONV_BUFFER_SIZE, nFlags,
&nInfo, &nSrcChars );
DBG_ASSERT( (nInfo & (RTL_UNICODETOTEXT_INFO_ERROR|RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL)) == 0, "HTMLOut: error while flushing" );
More information about the Libreoffice-commits
mailing list