add extra patches

f41
David Tardon 12 years ago
parent 2e0d961b2b
commit e21dcd9e14

@ -0,0 +1,183 @@
From 2331a7a2a748a94546c702a80e8916f548e30176 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Thu, 20 Jun 2013 10:01:10 +0100
Subject: [PATCH] move static bitmap into a svapp member
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
so it won't crash on exit when its dtor uses stuff destroyed by deinitvcl
already.
also fix comparisons, i.e. presumably
aLastColorTopLeft == aLastColorTopLeft etc
should have been aLastColorTopLeft == aColorTopLeft
Change-Id: I1f3dc47504c5add113b3a8bcadf010ca3b9f4c31
(cherry picked from commit a3694b1b32cb0677019962a5908fe775c83ed5a6)
Reviewed-on: https://gerrit.libreoffice.org/5048
Reviewed-by: Miklos Vajna <vmiklos@suse.cz>
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
---
vcl/inc/svdata.hxx | 22 ++++++++++++++++++++++
vcl/source/app/svdata.cxx | 9 +++++++++
vcl/source/app/svmain.cxx | 3 +++
vcl/source/gdi/bitmapex.cxx | 42 ++++++++++++++++++------------------------
4 files changed, 52 insertions(+), 24 deletions(-)
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 86b0d7a9..a929165 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -284,6 +284,26 @@ struct ImplSVNWFData
bool mbDDListBoxNoTextArea:1;
};
+struct BlendFrameCache
+{
+ Size m_aLastSize;
+ sal_uInt8 m_nLastAlpha;
+ Color m_aLastColorTopLeft;
+ Color m_aLastColorTopRight;
+ Color m_aLastColorBottomRight;
+ Color m_aLastColorBottomLeft;
+ BitmapEx m_aLastResult;
+
+ BlendFrameCache()
+ : m_aLastSize(0, 0)
+ , m_nLastAlpha(0)
+ , m_aLastColorTopLeft(COL_BLACK)
+ , m_aLastColorTopRight(COL_BLACK)
+ , m_aLastColorBottomRight(COL_BLACK)
+ , m_aLastColorBottomLeft(COL_BLACK)
+ {
+ }
+};
struct ImplSVData
{
@@ -312,6 +332,7 @@ struct ImplSVData
UnoWrapperBase* mpUnoWrapper;
Window* mpIntroWindow; // the splash screen
DockingManager* mpDockingManager;
+ BlendFrameCache* mpBlendFrameCache;
sal_Bool mbIsTestTool;
oslThreadIdentifier mnMainThreadId;
@@ -330,6 +351,7 @@ Window* ImplGetDefaultWindow();
VCL_PLUGIN_PUBLIC ResMgr* ImplGetResMgr();
VCL_PLUGIN_PUBLIC ResId VclResId( sal_Int32 nId ); // throws std::bad_alloc if no res mgr
DockingManager* ImplGetDockingManager();
+BlendFrameCache* ImplGetBlendFrameCache();
void ImplWindowAutoMnemonic( Window* pWindow );
void ImplUpdateSystemProcessWindow();
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index feec982..2a7bc93 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -256,6 +256,15 @@ DockingManager* ImplGetDockingManager()
return pSVData->mpDockingManager;
}
+BlendFrameCache* ImplGetBlendFrameCache()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ if ( !pSVData->mpBlendFrameCache)
+ pSVData->mpBlendFrameCache= new BlendFrameCache();
+
+ return pSVData->mpBlendFrameCache;
+}
+
class AccessBridgeCurrentContext: public cppu::WeakImplHelper1< com::sun::star::uno::XCurrentContext >
{
public:
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 21a351b..9104be9 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -540,6 +540,9 @@ void DeInitVCL()
if ( pSVData->maAppData.mpFirstEventHook )
ImplFreeEventHookData();
+ if (pSVData->mpBlendFrameCache)
+ delete pSVData->mpBlendFrameCache, pSVData->mpBlendFrameCache = NULL;
+
ImplDeletePrnQueueList();
delete pSVData->maGDIData.mpScreenFontList;
pSVData->maGDIData.mpScreenFontList = NULL;
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 1266043..094b7c7 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -959,31 +959,25 @@ BitmapEx VCL_DLLPUBLIC createBlendFrame(
Color aColorBottomRight,
Color aColorBottomLeft)
{
- static Size aLastSize(0, 0);
- static sal_uInt8 nLastAlpha(0);
- static Color aLastColorTopLeft(COL_BLACK);
- static Color aLastColorTopRight(COL_BLACK);
- static Color aLastColorBottomRight(COL_BLACK);
- static Color aLastColorBottomLeft(COL_BLACK);
- static BitmapEx aLastResult;
-
- if(aLastSize == rSize
- && nLastAlpha == nAlpha
- && aLastColorTopLeft == aLastColorTopLeft
- && aLastColorTopRight == aLastColorTopRight
- && aLastColorBottomRight == aLastColorBottomRight
- && aLastColorBottomLeft == aLastColorBottomLeft)
+ BlendFrameCache* pBlendFrameCache = ImplGetBlendFrameCache();
+
+ if(pBlendFrameCache->m_aLastSize == rSize
+ && pBlendFrameCache->m_nLastAlpha == nAlpha
+ && pBlendFrameCache->m_aLastColorTopLeft == aColorTopLeft
+ && pBlendFrameCache->m_aLastColorTopRight == aColorTopRight
+ && pBlendFrameCache->m_aLastColorBottomRight == aColorBottomRight
+ && pBlendFrameCache->m_aLastColorBottomLeft == aColorBottomLeft)
{
- return aLastResult;
+ return pBlendFrameCache->m_aLastResult;
}
- aLastSize = rSize;
- nLastAlpha = nAlpha;
- aLastColorTopLeft = aLastColorTopLeft;
- aLastColorTopRight = aLastColorTopRight;
- aLastColorBottomRight = aLastColorBottomRight;
- aLastColorBottomLeft = aLastColorBottomLeft;
- aLastResult.Clear();
+ pBlendFrameCache->m_aLastSize = rSize;
+ pBlendFrameCache->m_nLastAlpha = nAlpha;
+ pBlendFrameCache->m_aLastColorTopLeft = aColorTopLeft;
+ pBlendFrameCache->m_aLastColorTopRight = aColorTopRight;
+ pBlendFrameCache->m_aLastColorBottomRight = aColorBottomRight;
+ pBlendFrameCache->m_aLastColorBottomLeft = aColorBottomLeft;
+ pBlendFrameCache->m_aLastResult.Clear();
const long nW(rSize.Width());
const long nH(rSize.Height());
@@ -1055,7 +1049,7 @@ BitmapEx VCL_DLLPUBLIC createBlendFrame(
aContent.ReleaseAccess(pContent);
aAlpha.ReleaseAccess(pAlpha);
- aLastResult = BitmapEx(aContent, aAlpha);
+ pBlendFrameCache->m_aLastResult = BitmapEx(aContent, aAlpha);
}
else
{
@@ -1071,7 +1065,7 @@ BitmapEx VCL_DLLPUBLIC createBlendFrame(
}
}
- return aLastResult;
+ return pBlendFrameCache->m_aLastResult;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
--
1.8.3.1

@ -0,0 +1,286 @@
From 3d1ab404feb742c59652b381c54af4ca624dca15 Mon Sep 17 00:00:00 2001
From: Eike Rathke <erack@redhat.com>
Date: Tue, 23 Jul 2013 17:17:18 +0200
Subject: [PATCH] resolved fdo#67094 handle <text:s> in <text:p> and
<text:span>
821521f757569c96ded6004bb2cb0d003481b55b introduced XML_SPAN but removed
handling of XML_S repeated U+0020, SPACE
Change-Id: Ic1b00c9dbc33c750b9a8cae910b4ca0bed42ab5a
(cherry picked from commit be10607d358f7587f10e76084893ceed3a4c9215)
Reviewed-on: https://gerrit.libreoffice.org/5052
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Tested-by: Petr Mladek <pmladek@suse.cz>
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Reviewed-by: Kohei Yoshida <kohei.yoshida@suse.de>
Tested-by: Kohei Yoshida <kohei.yoshida@suse.de>
---
sc/source/filter/xml/celltextparacontext.cxx | 84 ++++++++++++++++++++++++++++
sc/source/filter/xml/celltextparacontext.hxx | 23 +++++++-
sc/source/filter/xml/xmlimprt.cxx | 19 +++++++
sc/source/filter/xml/xmlimprt.hxx | 14 ++++-
4 files changed, 138 insertions(+), 2 deletions(-)
diff --git a/sc/source/filter/xml/celltextparacontext.cxx b/sc/source/filter/xml/celltextparacontext.cxx
index fbbcf6f..f251f11 100644
--- a/sc/source/filter/xml/celltextparacontext.cxx
+++ b/sc/source/filter/xml/celltextparacontext.cxx
@@ -12,6 +12,7 @@
#include "xmlcelli.hxx"
#include "xmloff/nmspmap.hxx"
+#include "comphelper/string.hxx"
#include <com/sun/star/xml/sax/XAttributeList.hpp>
@@ -53,6 +54,8 @@ SvXMLImportContext* ScXMLCellTextParaContext::CreateChildContext(
const SvXMLTokenMap& rTokenMap = GetScImport().GetCellTextParaElemTokenMap();
switch (rTokenMap.Get(nPrefix, rLocalName))
{
+ case XML_TOK_CELL_TEXT_S:
+ return new ScXMLCellFieldSContext(GetScImport(), nPrefix, rLocalName, *this);
case XML_TOK_CELL_TEXT_SPAN:
return new ScXMLCellTextSpanContext(GetScImport(), nPrefix, rLocalName, *this);
case XML_TOK_CELL_TEXT_SHEET_NAME:
@@ -179,6 +182,12 @@ SvXMLImportContext* ScXMLCellTextSpanContext::CreateChildContext(
p->SetStyleName(maStyleName);
return p;
}
+ case XML_TOK_CELL_TEXT_SPAN_ELEM_S:
+ {
+ ScXMLCellFieldSContext* p = new ScXMLCellFieldSContext(GetScImport(), nPrefix, rLocalName, mrParentCxt);
+ p->SetStyleName(maStyleName);
+ return p;
+ }
default:
;
}
@@ -338,4 +347,79 @@ SvXMLImportContext* ScXMLCellFieldURLContext::CreateChildContext(
return new SvXMLImportContext(GetImport(), nPrefix, rLocalName);
}
+ScXMLCellFieldSContext::ScXMLCellFieldSContext(
+ ScXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLName, ScXMLCellTextParaContext& rParent) :
+ ScXMLImportContext(rImport, nPrefix, rLName),
+ mrParentCxt(rParent),
+ mnCount(1)
+{
+}
+
+void ScXMLCellFieldSContext::SetStyleName(const OUString& rStyleName)
+{
+ maStyleName = rStyleName;
+}
+
+void ScXMLCellFieldSContext::StartElement(const uno::Reference<xml::sax::XAttributeList>& xAttrList)
+{
+ if (!xAttrList.is())
+ return;
+
+ OUString aLocalName;
+ sal_Int16 nAttrCount = xAttrList->getLength();
+
+ const SvXMLTokenMap& rTokenMap = GetScImport().GetCellTextSAttrTokenMap();
+ for (sal_Int16 i = 0; i < nAttrCount; ++i)
+ {
+ sal_uInt16 nAttrPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName(
+ xAttrList->getNameByIndex(i), &aLocalName);
+
+ const OUString& rAttrValue = xAttrList->getValueByIndex(i);
+ sal_uInt16 nToken = rTokenMap.Get(nAttrPrefix, aLocalName);
+ switch (nToken)
+ {
+ case XML_TOK_CELL_TEXT_S_ATTR_C:
+ mnCount = rAttrValue.toInt32();
+ if (mnCount <= 0)
+ mnCount = 1; // worth a warning?
+ break;
+ default:
+ ;
+ }
+ }
+}
+
+void ScXMLCellFieldSContext::EndElement()
+{
+ if (mnCount)
+ PushSpaces();
+}
+
+SvXMLImportContext* ScXMLCellFieldSContext::CreateChildContext(
+ sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& /*xAttrList*/)
+{
+ // <text:s> does not have child elements, but ...
+ if (mnCount)
+ {
+ PushSpaces();
+ }
+
+ return new SvXMLImportContext(GetImport(), nPrefix, rLocalName);
+}
+
+void ScXMLCellFieldSContext::PushSpaces()
+{
+ if (mnCount > 0)
+ {
+ if (mnCount == 1)
+ mrParentCxt.PushSpan(" ", maStyleName);
+ else
+ {
+ OUStringBuffer aBuf( mnCount);
+ comphelper::string::padToLength( aBuf, mnCount, ' ');
+ mrParentCxt.PushSpan( aBuf.makeStringAndClear(), maStyleName);
+ }
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/celltextparacontext.hxx b/sc/source/filter/xml/celltextparacontext.hxx
index 10e5a23..68adaae 100644
--- a/sc/source/filter/xml/celltextparacontext.hxx
+++ b/sc/source/filter/xml/celltextparacontext.hxx
@@ -134,6 +134,27 @@ public:
sal_uInt16 nPrefix, const OUString& rLocalName, const com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList>& xAttrList);
};
+/**
+ * This context handles <text:s> element inside <text:p> or <text:span>.
+ */
+class ScXMLCellFieldSContext : public ScXMLImportContext
+{
+ ScXMLCellTextParaContext& mrParentCxt;
+ OUString maStyleName;
+ sal_Int32 mnCount;
+
+ void PushSpaces();
+public:
+ ScXMLCellFieldSContext(ScXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLName, ScXMLCellTextParaContext& rParent);
+
+ void SetStyleName(const OUString& rStyleName);
+
+ virtual void StartElement(const com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList>& xAttrList);
+ virtual void EndElement();
+ virtual SvXMLImportContext* CreateChildContext(
+ sal_uInt16 nPrefix, const OUString& rLocalName, const com::sun::star::uno::Reference<com::sun::star::xml::sax::XAttributeList>& xAttrList);
+};
+
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index d1e5e47..87a781a 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1848,6 +1848,7 @@ const SvXMLTokenMap& ScXMLImport::GetCellTextParaElemTokenMap()
{
static SvXMLTokenMapEntry aMap[] =
{
+ { XML_NAMESPACE_TEXT, XML_S, XML_TOK_CELL_TEXT_S },
{ XML_NAMESPACE_TEXT, XML_SPAN, XML_TOK_CELL_TEXT_SPAN },
{ XML_NAMESPACE_TEXT, XML_SHEET_NAME, XML_TOK_CELL_TEXT_SHEET_NAME },
{ XML_NAMESPACE_TEXT, XML_DATE, XML_TOK_CELL_TEXT_DATE },
@@ -1871,6 +1872,7 @@ const SvXMLTokenMap& ScXMLImport::GetCellTextSpanElemTokenMap()
{ XML_NAMESPACE_TEXT, XML_DATE, XML_TOK_CELL_TEXT_SPAN_ELEM_DATE },
{ XML_NAMESPACE_TEXT, XML_TITLE, XML_TOK_CELL_TEXT_SPAN_ELEM_TITLE },
{ XML_NAMESPACE_TEXT, XML_A, XML_TOK_CELL_TEXT_SPAN_ELEM_URL },
+ { XML_NAMESPACE_TEXT, XML_S, XML_TOK_CELL_TEXT_SPAN_ELEM_S },
XML_TOKEN_MAP_END
};
@@ -1910,6 +1912,21 @@ const SvXMLTokenMap& ScXMLImport::GetCellTextURLAttrTokenMap()
return *pCellTextURLAttrTokenMap;
}
+const SvXMLTokenMap& ScXMLImport::GetCellTextSAttrTokenMap()
+{
+ if (!pCellTextSAttrTokenMap)
+ {
+ static const SvXMLTokenMapEntry aMap[] =
+ {
+ { XML_NAMESPACE_TEXT, XML_C, XML_TOK_CELL_TEXT_S_ATTR_C },
+ XML_TOKEN_MAP_END
+ };
+
+ pCellTextSAttrTokenMap = new SvXMLTokenMap(aMap);
+ }
+ return *pCellTextSAttrTokenMap;
+}
+
SvXMLImportContext *ScXMLImport::CreateContext( sal_uInt16 nPrefix,
const OUString& rLocalName,
const uno::Reference<xml::sax::XAttributeList>& xAttrList )
@@ -2035,6 +2052,7 @@ ScXMLImport::ScXMLImport(
pCellTextSpanElemTokenMap(NULL),
pCellTextSpanAttrTokenMap(NULL),
pCellTextURLAttrTokenMap(NULL),
+ pCellTextSAttrTokenMap(NULL),
aTables(*this),
pMyNamedExpressions(NULL),
pMyLabelRanges(NULL),
@@ -2176,6 +2194,7 @@ ScXMLImport::~ScXMLImport() throw()
delete pCellTextSpanElemTokenMap;
delete pCellTextSpanAttrTokenMap;
delete pCellTextURLAttrTokenMap;
+ delete pCellTextSAttrTokenMap;
delete pChangeTrackingImportHelper;
delete pNumberFormatAttributesExportHelper;
diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx
index aa85f7e..9386614 100644
--- a/sc/source/filter/xml/xmlimprt.hxx
+++ b/sc/source/filter/xml/xmlimprt.hxx
@@ -688,6 +688,7 @@ enum ScXMLConsolidationAttrTokens
*/
enum ScXMLCellTextParaElemTokens
{
+ XML_TOK_CELL_TEXT_S,
XML_TOK_CELL_TEXT_SPAN,
XML_TOK_CELL_TEXT_SHEET_NAME,
XML_TOK_CELL_TEXT_DATE,
@@ -703,7 +704,8 @@ enum ScXMLCellTextSpanElemTokens
XML_TOK_CELL_TEXT_SPAN_ELEM_SHEET_NAME,
XML_TOK_CELL_TEXT_SPAN_ELEM_DATE,
XML_TOK_CELL_TEXT_SPAN_ELEM_TITLE,
- XML_TOK_CELL_TEXT_SPAN_ELEM_URL
+ XML_TOK_CELL_TEXT_SPAN_ELEM_URL,
+ XML_TOK_CELL_TEXT_SPAN_ELEM_S
};
/**
@@ -720,6 +722,14 @@ enum ScXMLCellTextURLAttrTokens
XML_TOK_CELL_TEXT_URL_ATTR_TYPE,
};
+/**
+ * Tokens for attributes for <text:s>
+ */
+enum ScXMLCellTextSAttrTokens
+{
+ XML_TOK_CELL_TEXT_S_ATTR_C
+};
+
class SvXMLTokenMap;
class XMLShapeImportHelper;
class ScXMLChangeTrackingImportHelper;
@@ -892,6 +902,7 @@ class ScXMLImport: public SvXMLImport, boost::noncopyable
SvXMLTokenMap *pCellTextSpanElemTokenMap;
SvXMLTokenMap *pCellTextSpanAttrTokenMap;
SvXMLTokenMap *pCellTextURLAttrTokenMap;
+ SvXMLTokenMap *pCellTextSAttrTokenMap;
ScMyTables aTables;
@@ -1061,6 +1072,7 @@ public:
const SvXMLTokenMap& GetCellTextSpanElemTokenMap();
const SvXMLTokenMap& GetCellTextSpanAttrTokenMap();
const SvXMLTokenMap& GetCellTextURLAttrTokenMap();
+ const SvXMLTokenMap& GetCellTextSAttrTokenMap();
void AddNamedExpression(ScMyNamedExpression* pMyNamedExpression)
{
--
1.8.3.1

@ -255,6 +255,8 @@ Patch17: 0002-Related-rhbz-968892-discard-impossible-languages-for.patch
Patch18: 0001-rhbz-980387-fix-filter-selection-from-file-ext.patch
Patch19: 0001-WaE-assuming-signed-overflow-does-not-occur-when-ass.patch
Patch20: 0001-Resolves-fdo-48835-application-menu-for-LibreOffice.patch
Patch21: 0001-move-static-bitmap-into-a-svapp-member.patch
Patch22: 0001-resolved-fdo-67094-handle-text-s-in-text-p-and-text-.patch
%define instdir %{_libdir}
%define baseinstdir %{instdir}/libreoffice
@ -1007,6 +1009,8 @@ mv -f redhat.soc extras/source/palettes/standard.soc
%patch18 -p1 -b .rhbz-980387-fix-filter-selection-from-file-ext.patch
%patch19 -p1 -b .WaE-assuming-signed-overflow-does-not-occur-when-ass.patch
%patch20 -p1 -b .fdo-48835-application-menu-for-LibreOffice.patch
%patch21 -p1 -b .move-static-bitmap-into-a-svapp-member.patch
%patch22 -p1 -b .resolved-fdo-67094-handle-text-s-in-text-p-and-text-.patch
# TODO: check this
# these are horribly incomplete--empty translations and copied english

Loading…
Cancel
Save