[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - 11 commits - canvas/source drawinglayer/source include/svx reportdesign/source sc/inc sc/source sd/source svx/source sw/qa sw/source vcl/inc vcl/unx
Michael Stahl
mstahl at redhat.com
Mon Oct 10 08:43:26 UTC 2016
canvas/source/cairo/cairo_canvashelper.cxx | 5
drawinglayer/source/processor2d/vclhelperbufferdevice.cxx | 1
include/svx/svdundo.hxx | 14 --
reportdesign/source/core/inc/ReportUndoFactory.hxx | 2
reportdesign/source/core/sdr/ReportUndoFactory.cxx | 4
sc/inc/rangelst.hxx | 2
sc/inc/textuno.hxx | 21 +--
sc/source/core/data/attrib.cxx | 9 +
sc/source/core/data/drwlayer.cxx | 2
sc/source/core/tool/rangelst.cxx | 22 +++
sc/source/filter/xml/celltextparacontext.cxx | 9 +
sc/source/filter/xml/celltextparacontext.hxx | 3
sc/source/filter/xml/xmlcelli.cxx | 6 -
sc/source/filter/xml/xmlcelli.hxx | 2
sc/source/filter/xml/xmlexprt.cxx | 6 -
sc/source/filter/xml/xmlimprt.cxx | 1
sc/source/filter/xml/xmlimprt.hxx | 1
sc/source/ui/undo/undoblk3.cxx | 2
sc/source/ui/unoobj/fielduno.cxx | 12 +-
sc/source/ui/unoobj/textuno.cxx | 38 ++++--
sd/source/core/drawdoc3.cxx | 20 ---
sd/source/ui/annotations/annotationwindow.cxx | 4
sd/source/ui/func/undoback.cxx | 43 -------
sd/source/ui/inc/undoback.hxx | 6 -
svx/source/dialog/frmsel.cxx | 1
svx/source/svdraw/svdundo.cxx | 84 --------------
sw/qa/extras/odfimport/data/tdf103025.odt |binary
sw/qa/extras/odfimport/odfimport.cxx | 9 +
sw/source/core/layout/pagechg.cxx | 16 --
vcl/inc/unx/gtk/gtkframe.hxx | 6 -
vcl/inc/unx/gtk/gtkinst.hxx | 3
vcl/unx/gtk/gtkinst.cxx | 21 +++
vcl/unx/gtk/gtksalframe.cxx | 16 ++
vcl/unx/gtk3/gtk3gtkframe.cxx | 27 ++--
34 files changed, 184 insertions(+), 234 deletions(-)
New commits:
commit 6c787e4a7a28d84b8a3f2ad5fa84d9d66ad4594e
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Oct 5 23:09:25 2016 +0200
tdf#103025 sw: don't format header/footer in SwPageFrame::PreparePage()
This has always been dead code because it used wrong constants
FRMTYPE_HEADER|FRMTYPE_FOOTER which is actually Page|Column and
SwPageFrame and SwColumnFrame are not direct children of SwPageFrame.
Then commit 901e5c3a21a1299d10c44bc844246fe8c329bb82 fixed the
constants but somehow the early formatting of header/footer results
in wrong expansion of variable text fields, so just remove this code.
(cherry picked from commit f933da55797566cf725e35ab0df17e91c7d5598f)
Reviewed-on: https://gerrit.libreoffice.org/29558
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
(cherry picked from commit 63ba0dc9e12169e9a929231a01172c85fab2f628)
Change-Id: I0af13168970f26355a1b247e071235166d08b7a4
diff --git a/sw/qa/extras/odfimport/data/tdf103025.odt b/sw/qa/extras/odfimport/data/tdf103025.odt
new file mode 100644
index 0000000..bd1e573
Binary files /dev/null and b/sw/qa/extras/odfimport/data/tdf103025.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 79dae52..3a8e2a5 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -631,6 +631,15 @@ DECLARE_ODFIMPORT_TEST(testBnc800714, "bnc800714.fodt")
CPPUNIT_ASSERT(getProperty<bool>(getParagraph(2), "ParaKeepTogether"));
}
+DECLARE_ODFIMPORT_TEST(testTdf103025, "tdf103025.odt")
+{
+ CPPUNIT_ASSERT_EQUAL(OUString("2014-01"), parseDump("/root/page[1]/header/tab[2]/row[2]/cell[3]/txt/Special", "rText"));
+ CPPUNIT_ASSERT_EQUAL(OUString("2014-01"), parseDump("/root/page[2]/header/tab[2]/row[2]/cell[3]/txt/Special", "rText"));
+ CPPUNIT_ASSERT_EQUAL(OUString("2014-02"), parseDump("/root/page[3]/header/tab[2]/row[2]/cell[3]/txt/Special", "rText"));
+ CPPUNIT_ASSERT_EQUAL(OUString("2014-03"), parseDump("/root/page[4]/header/tab[2]/row[2]/cell[3]/txt/Special", "rText"));
+ CPPUNIT_ASSERT_EQUAL(OUString("2014-03"), parseDump("/root/page[5]/header/tab[2]/row[2]/cell[3]/txt/Special", "rText"));
+}
+
DECLARE_ODFIMPORT_TEST(testTdf76322_columnBreakInHeader, "tdf76322_columnBreakInHeader.docx")
{
// column breaks were ignored. First line should start in column 2
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index b9babcb..b9861b2 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -465,22 +465,6 @@ void SwPageFrame::PreparePage( bool bFootnote )
if ( GetPrev() && static_cast<SwPageFrame*>(GetPrev())->IsEmptyPage() )
lcl_MakeObjs( *pDoc->GetSpzFrameFormats(), static_cast<SwPageFrame*>(GetPrev()) );
lcl_MakeObjs( *pDoc->GetSpzFrameFormats(), this );
-
- // format footer/ header
- SwLayoutFrame *pLow = static_cast<SwLayoutFrame*>(Lower());
- while ( pLow )
- {
- if ( pLow->GetType() & (FRM_HEADER|FRM_FOOTER) )
- {
- SwContentFrame *pContent = pLow->ContainsContent();
- while ( pContent && pLow->IsAnLower( pContent ) )
- {
- pContent->OptCalc(); // not the predecessors
- pContent = pContent->GetNextContentFrame();
- }
- }
- pLow = static_cast<SwLayoutFrame*>(pLow->GetNext());
- }
}
}
commit 44bac1d70b8f267fa4ac938078927ad9d79d64f2
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Oct 5 21:10:12 2016 +0100
tdf#93967 - better fix for leak around calc header-footer UNO objects
Change-Id: I950479e8e1c634aa9ad13bf3e0e9d24485a1e6b2
(cherry picked from commit 052f98d0b1a6b0607069f0a50d4e03fcd4a1d52a)
diff --git a/sc/inc/textuno.hxx b/sc/inc/textuno.hxx
index 9a64157..fb51b01 100644
--- a/sc/inc/textuno.hxx
+++ b/sc/inc/textuno.hxx
@@ -29,6 +29,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <cppuhelper/implbase.hxx>
+#include <cppuhelper/weakref.hxx>
#include <rtl/ref.hxx>
#include "scdllapi.h"
@@ -66,12 +67,8 @@ private:
rtl::Reference<ScHeaderFooterTextObj> mxCenterText;
rtl::Reference<ScHeaderFooterTextObj> mxRightText;
- ScHeaderFooterContentObj(); // disabled
-
public:
- ScHeaderFooterContentObj( const EditTextObject* pLeft,
- const EditTextObject* pCenter,
- const EditTextObject* pRight );
+ ScHeaderFooterContentObj();
virtual ~ScHeaderFooterContentObj();
// for ScPageHFItem (using getImplementation)
@@ -79,6 +76,10 @@ public:
const EditTextObject* GetCenterEditObject() const;
const EditTextObject* GetRightEditObject() const;
+ void Init( const EditTextObject* pLeft,
+ const EditTextObject* pCenter,
+ const EditTextObject* pRight);
+
// XHeaderFooterContent
virtual css::uno::Reference< css::text::XText > SAL_CALL
getLeftText() throw(css::uno::RuntimeException, std::exception) override;
@@ -110,15 +111,15 @@ class ScHeaderFooterTextData : boost::noncopyable
{
private:
EditTextObject* mpTextObj;
- rtl::Reference<ScHeaderFooterContentObj> rContentObj;
- sal_uInt16 nPart;
+ css::uno::WeakReference<css::sheet::XHeaderFooterContent> xContentObj;
+ sal_uInt16 nPart;
ScEditEngineDefaulter* pEditEngine;
SvxEditEngineForwarder* pForwarder;
bool bDataValid;
public:
ScHeaderFooterTextData(
- rtl::Reference<ScHeaderFooterContentObj> const & rContent, sal_uInt16 nP, const EditTextObject* pTextObj);
+ css::uno::WeakReference<css::sheet::XHeaderFooterContent> xContent, sal_uInt16 nP, const EditTextObject* pTextObj);
~ScHeaderFooterTextData();
// helper functions
@@ -128,7 +129,7 @@ public:
ScEditEngineDefaulter* GetEditEngine() { GetTextForwarder(); return pEditEngine; }
sal_uInt16 GetPart() const { return nPart; }
- rtl::Reference<ScHeaderFooterContentObj> GetContentObj() const { return rContentObj; }
+ const css::uno::Reference<css::sheet::XHeaderFooterContent> GetContentObj() const { return xContentObj; }
const EditTextObject* GetTextObject() const { return mpTextObj;}
};
@@ -154,7 +155,7 @@ private:
public:
ScHeaderFooterTextObj(
- rtl::Reference<ScHeaderFooterContentObj> const & rContent, sal_uInt16 nP, const EditTextObject* pTextObj);
+ css::uno::WeakReference<css::sheet::XHeaderFooterContent> xContent, sal_uInt16 nP, const EditTextObject* pTextObj);
virtual ~ScHeaderFooterTextObj();
const EditTextObject* GetTextObject() const;
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx
index c84b0cb..a4412eb 100644
--- a/sc/source/core/data/attrib.cxx
+++ b/sc/source/core/data/attrib.cxx
@@ -565,10 +565,13 @@ ScPageHFItem::~ScPageHFItem()
bool ScPageHFItem::QueryValue( uno::Any& rVal, sal_uInt8 /* nMemberId */ ) const
{
- uno::Reference<sheet::XHeaderFooterContent> xContent =
- new ScHeaderFooterContentObj( pLeftArea, pCenterArea, pRightArea );
+ rtl::Reference<ScHeaderFooterContentObj> xContent =
+ new ScHeaderFooterContentObj();
+ xContent->Init(pLeftArea, pCenterArea, pRightArea);
- rVal <<= xContent;
+ uno::Reference<sheet::XHeaderFooterContent> xCont(xContent.get());
+
+ rVal <<= xCont;
return true;
}
diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx
index b9a80c9..0e0b719 100644
--- a/sc/source/ui/unoobj/fielduno.cxx
+++ b/sc/source/ui/unoobj/fielduno.cxx
@@ -505,15 +505,19 @@ uno::Reference<text::XTextField> ScHeaderFieldsObj::GetObjectByIndex_Impl(sal_In
// Get the parent text range instance.
uno::Reference<text::XTextRange> xTextRange;
- rtl::Reference<ScHeaderFooterContentObj> rContentObj = mrData.GetContentObj();
+ uno::Reference<sheet::XHeaderFooterContent> xContentObj = mrData.GetContentObj();
+ if (!xContentObj.is())
+ throw uno::RuntimeException("");
+
+ rtl::Reference<ScHeaderFooterContentObj> pContentObj = ScHeaderFooterContentObj::getImplementation(xContentObj);
uno::Reference<text::XText> xText;
sal_uInt16 nPart = mrData.GetPart();
if (nPart == SC_HDFT_LEFT)
- xText = rContentObj->getLeftText();
+ xText = pContentObj->getLeftText();
else if (nPart == SC_HDFT_CENTER)
- xText = rContentObj->getCenterText();
+ xText = pContentObj->getCenterText();
else
- xText = rContentObj->getRightText();
+ xText = pContentObj->getRightText();
uno::Reference<text::XTextRange> xTemp(xText, uno::UNO_QUERY);
xTextRange = xTemp;
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index 3758fe1..3366640 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -88,15 +88,20 @@ static const SvxItemPropertySet * lcl_GetHdFtPropertySet()
SC_SIMPLE_SERVICE_INFO( ScHeaderFooterContentObj, "ScHeaderFooterContentObj", "com.sun.star.sheet.HeaderFooterContent" )
SC_SIMPLE_SERVICE_INFO( ScHeaderFooterTextObj, "ScHeaderFooterTextObj", "stardiv.one.Text.Text" )
-ScHeaderFooterContentObj::ScHeaderFooterContentObj( const EditTextObject* pLeft,
- const EditTextObject* pCenter,
- const EditTextObject* pRight ) :
- mxLeftText(new ScHeaderFooterTextObj(this, SC_HDFT_LEFT, pLeft)),
- mxCenterText(new ScHeaderFooterTextObj(this, SC_HDFT_CENTER, pCenter)),
- mxRightText(new ScHeaderFooterTextObj(this, SC_HDFT_RIGHT, pRight))
+ScHeaderFooterContentObj::ScHeaderFooterContentObj()
{
}
+void ScHeaderFooterContentObj::Init( const EditTextObject* pLeft,
+ const EditTextObject* pCenter,
+ const EditTextObject* pRight )
+{
+ uno::Reference<css::sheet::XHeaderFooterContent> xThis(this);
+ mxLeftText = rtl::Reference<ScHeaderFooterTextObj>(new ScHeaderFooterTextObj(xThis, SC_HDFT_LEFT, pLeft));
+ mxCenterText = rtl::Reference<ScHeaderFooterTextObj>(new ScHeaderFooterTextObj(xThis, SC_HDFT_CENTER, pCenter));
+ mxRightText = rtl::Reference<ScHeaderFooterTextObj>(new ScHeaderFooterTextObj(xThis, SC_HDFT_RIGHT, pRight));
+}
+
ScHeaderFooterContentObj::~ScHeaderFooterContentObj() {}
const EditTextObject* ScHeaderFooterContentObj::GetLeftEditObject() const
@@ -175,9 +180,9 @@ rtl::Reference<ScHeaderFooterContentObj> ScHeaderFooterContentObj::getImplementa
}
ScHeaderFooterTextData::ScHeaderFooterTextData(
- rtl::Reference<ScHeaderFooterContentObj> const & rContent, sal_uInt16 nP, const EditTextObject* pTextObj) :
+ uno::WeakReference<sheet::XHeaderFooterContent> xContent, sal_uInt16 nP, const EditTextObject* pTextObj) :
mpTextObj(pTextObj ? pTextObj->Clone() : nullptr),
- rContentObj( rContent ),
+ xContentObj( xContent ),
nPart( nP ),
pEditEngine( nullptr ),
pForwarder( nullptr ),
@@ -253,8 +258,8 @@ void ScHeaderFooterTextData::UpdateData(EditEngine& rEditEngine)
}
ScHeaderFooterTextObj::ScHeaderFooterTextObj(
- rtl::Reference<ScHeaderFooterContentObj> const & rContent, sal_uInt16 nP, const EditTextObject* pTextObj) :
- aTextData(rContent, nP, pTextObj)
+ uno::WeakReference<sheet::XHeaderFooterContent> xContent, sal_uInt16 nP, const EditTextObject* pTextObj) :
+ aTextData(xContent, nP, pTextObj)
{
// ScHeaderFooterTextData acquires rContent
// pUnoText is created on demand (getString/setString work without it)
@@ -321,15 +326,20 @@ OUString SAL_CALL ScHeaderFooterTextObj::getString() throw(uno::RuntimeException
OUString aRet;
const EditTextObject* pData;
+ uno::Reference<css::sheet::XHeaderFooterContent> xContentObj = aTextData.GetContentObj();
+ if (!xContentObj.is())
+ throw css::uno::RuntimeException("");
+
+ rtl::Reference<ScHeaderFooterContentObj> pContentObj = ScHeaderFooterContentObj::getImplementation(xContentObj);
+
sal_uInt16 nPart = aTextData.GetPart();
- rtl::Reference<ScHeaderFooterContentObj> rContentObj = aTextData.GetContentObj();
if (nPart == SC_HDFT_LEFT)
- pData = rContentObj->GetLeftEditObject();
+ pData = pContentObj->GetLeftEditObject();
else if (nPart == SC_HDFT_CENTER)
- pData = rContentObj->GetCenterEditObject();
+ pData = pContentObj->GetCenterEditObject();
else
- pData = rContentObj->GetRightEditObject();
+ pData = pContentObj->GetRightEditObject();
if (pData)
{
// for pure text, no font info is needed in pool defaults
commit f7c78ad2ea504ade0232337c56d4774b62ffaa19
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 6 09:56:29 2016 +0100
Resolves: tdf#103026 invalid dash causes CAIRO_STATUS_INVALID_DASH state
(cherry picked from commit c5d355e9c9cbc94eede8f438895e192d834f7096)
Change-Id: I072635ff7c67022ebfd5bdb475e390f3aab7a51c
Reviewed-on: https://gerrit.libreoffice.org/29553
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
(cherry picked from commit 91e0a73984f72e0f04e6087524332f6354f627d0)
diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx
index 8d974af..1e41b3a 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -1209,7 +1209,10 @@ namespace cairocanvas
break;
}
- if( strokeAttributes.DashArray.getLength() > 0 )
+ //tdf#103026 If the w scaling is 0, then all dashes become zero so
+ //cairo will set the cairo_t status to CAIRO_STATUS_INVALID_DASH
+ //and no further drawing will occur
+ if (strokeAttributes.DashArray.getLength() > 0 && w > 0.0)
{
double* pDashArray = new double[ strokeAttributes.DashArray.getLength() ];
for( sal_Int32 i=0; i<strokeAttributes.DashArray.getLength(); i++ )
commit 5a052d8a792fb1a5156030cf827c6f8cf15344c7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Oct 1 21:09:48 2016 +0100
Engine() return mpOutliner, so can crash if Engine() used post delete
if Deactivate called during ::dispose
(cherry picked from commit 86617760eb8bc6c0b2713b9496ade9203d1077a5)
Change-Id: I066dcc52278f12442de0281c8d783353aed5a186
Reviewed-on: https://gerrit.libreoffice.org/29444
Reviewed-by: Michael Stahl <mstahl at redhat.com>
Tested-by: jan iversen <jani at documentfoundation.org>
Tested-by: Jenkins <ci at libreoffice.org>
(cherry picked from commit 0570ddd7377c825e6cff7e71d07452223d230b6b)
diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx
index dcbeb22..1b2fd38 100644
--- a/sd/source/ui/annotations/annotationwindow.cxx
+++ b/sd/source/ui/annotations/annotationwindow.cxx
@@ -298,6 +298,7 @@ void AnnotationWindow::dispose()
mpMeta.disposeAndClear();
delete mpOutlinerView;
delete mpOutliner;
+ mpOutliner = nullptr;
mpVScrollbar.disposeAndClear();
mpTextWindow.disposeAndClear();
FloatingWindow::dispose();
@@ -613,6 +614,9 @@ void AnnotationWindow::SetColor()
void AnnotationWindow::Deactivate()
{
+ if (!mpOutliner) //in dispose
+ return;
+
Reference< XAnnotation > xAnnotation( mxAnnotation );
// write changed text back to annotation
commit 058c92aaee400815877d29bb9b20781e121f003e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Oct 2 18:27:32 2016 +0200
support TargetFrame in url field import/export code, tdf#77873
Change-Id: Id09ecbd10b8ee60371f223d62f2dd6fe1c2296ca
Reviewed-on: https://gerrit.libreoffice.org/29459
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
(cherry picked from commit b11ad787372c4b833cc58a3738e375af26309b8d)
Reviewed-on: https://gerrit.libreoffice.org/29482
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Eike Rathke <erack at redhat.com>
(cherry picked from commit 0d60b0dc1208b01b659fd1af4b33d1a7f6ee737d)
diff --git a/sc/source/filter/xml/celltextparacontext.cxx b/sc/source/filter/xml/celltextparacontext.cxx
index 3f6c64b..dc89e14 100644
--- a/sc/source/filter/xml/celltextparacontext.cxx
+++ b/sc/source/filter/xml/celltextparacontext.cxx
@@ -94,9 +94,9 @@ void ScXMLCellTextParaContext::PushFieldTitle(const OUString& rStyleName)
}
void ScXMLCellTextParaContext::PushFieldURL(
- const OUString& rURL, const OUString& rRep, const OUString& rStyleName)
+ const OUString& rURL, const OUString& rRep, const OUString& rStyleName, const OUString& rTargetFrame)
{
- mrParentCxt.PushParagraphFieldURL(rURL, rRep, rStyleName);
+ mrParentCxt.PushParagraphFieldURL(rURL, rRep, rStyleName, rTargetFrame);
}
ScXMLCellTextSpanContext::ScXMLCellTextSpanContext(
@@ -325,6 +325,9 @@ void ScXMLCellFieldURLContext::StartElement(const uno::Reference<xml::sax::XAttr
case XML_TOK_CELL_TEXT_URL_ATTR_TYPE:
// Ignored for now.
break;
+ case XML_TOK_CELL_TEXT_URL_TARGET_FRAME:
+ maTargetFrame = rAttrValue;
+ break;
default:
;
}
@@ -333,7 +336,7 @@ void ScXMLCellFieldURLContext::StartElement(const uno::Reference<xml::sax::XAttr
void ScXMLCellFieldURLContext::EndElement()
{
- mrParentCxt.PushFieldURL(maURL, maRep, maStyleName);
+ mrParentCxt.PushFieldURL(maURL, maRep, maStyleName, maTargetFrame);
}
void ScXMLCellFieldURLContext::Characters(const OUString& rChars)
diff --git a/sc/source/filter/xml/celltextparacontext.hxx b/sc/source/filter/xml/celltextparacontext.hxx
index 65487b8..f6b8e2c 100644
--- a/sc/source/filter/xml/celltextparacontext.hxx
+++ b/sc/source/filter/xml/celltextparacontext.hxx
@@ -35,7 +35,7 @@ public:
void PushFieldSheetName(const OUString& rStyleName);
void PushFieldDate(const OUString& rStyleName);
void PushFieldTitle(const OUString& rStyleName);
- void PushFieldURL(const OUString& rURL, const OUString& rRep, const OUString& rStyleName);
+ void PushFieldURL(const OUString& rURL, const OUString& rRep, const OUString& rStyleName, const OUString& rTargetFrame);
};
/**
@@ -122,6 +122,7 @@ class ScXMLCellFieldURLContext : public ScXMLImportContext
OUString maStyleName;
OUString maURL;
OUString maRep;
+ OUString maTargetFrame;
public:
ScXMLCellFieldURLContext(ScXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLName, ScXMLCellTextParaContext& rParent);
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index b3d830b..111af44 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -629,10 +629,12 @@ void ScXMLTableRowCellContext::PushParagraphFieldDocTitle(const OUString& rStyle
}
void ScXMLTableRowCellContext::PushParagraphFieldURL(
- const OUString& rURL, const OUString& rRep, const OUString& rStyleName)
+ const OUString& rURL, const OUString& rRep, const OUString& rStyleName, const OUString& rTargetFrame)
{
OUString aAbsURL = GetScImport().GetAbsoluteReference(rURL);
- PushParagraphField(new SvxURLField(aAbsURL, rRep, SVXURLFORMAT_REPR), rStyleName);
+ SvxURLField* pURLField = new SvxURLField(aAbsURL, rRep, SVXURLFORMAT_REPR);
+ pURLField->SetTargetFrame(rTargetFrame);
+ PushParagraphField(pURLField, rStyleName);
}
void ScXMLTableRowCellContext::PushParagraphEnd()
diff --git a/sc/source/filter/xml/xmlcelli.hxx b/sc/source/filter/xml/xmlcelli.hxx
index 56090ca..d72bc20 100644
--- a/sc/source/filter/xml/xmlcelli.hxx
+++ b/sc/source/filter/xml/xmlcelli.hxx
@@ -143,7 +143,7 @@ public:
void PushParagraphFieldDate(const OUString& rStyleName);
void PushParagraphFieldSheetName(const OUString& rStyleName);
void PushParagraphFieldDocTitle(const OUString& rStyleName);
- void PushParagraphFieldURL(const OUString& rURL, const OUString& rRep, const OUString& rStyleName);
+ void PushParagraphFieldURL(const OUString& rURL, const OUString& rRep, const OUString& rStyleName, const OUString& rTargetFrame);
void PushParagraphEnd();
void SetAnnotation( const ScAddress& rPosition );
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 25eb603..aa8ec4a 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2951,9 +2951,13 @@ void writeContent(
{
// <text:a xlink:href="url" xlink:type="simple">value</text:a>
- OUString aURL = static_cast<const SvxURLField*>(pField)->GetURL();
+ const SvxURLField* pURLField = static_cast<const SvxURLField*>(pField);
+ OUString aURL = pURLField->GetURL();
rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, rExport.GetRelativeReference(aURL));
rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, "simple");
+ OUString aTargetFrame = pURLField->GetTargetFrame();
+ if (!aTargetFrame.isEmpty())
+ rExport.AddAttribute(XML_NAMESPACE_OFFICE, XML_TARGET_FRAME_NAME, aTargetFrame);
OUString aElemName = rExport.GetNamespaceMap().GetQNameByKey(
XML_NAMESPACE_TEXT, GetXMLToken(XML_A));
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 2a7d485..897f66f 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1893,6 +1893,7 @@ const SvXMLTokenMap& ScXMLImport::GetCellTextURLAttrTokenMap()
{
{ XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_CELL_TEXT_URL_ATTR_UREF },
{ XML_NAMESPACE_XLINK, XML_TYPE, XML_TOK_CELL_TEXT_URL_ATTR_TYPE },
+ { XML_NAMESPACE_OFFICE, XML_TARGET_FRAME_NAME, XML_TOK_CELL_TEXT_URL_TARGET_FRAME },
XML_TOKEN_MAP_END
};
diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx
index 882f1f0..6fc09d1 100644
--- a/sc/source/filter/xml/xmlimprt.hxx
+++ b/sc/source/filter/xml/xmlimprt.hxx
@@ -739,6 +739,7 @@ enum ScXMLCellTextURLAttrTokens
{
XML_TOK_CELL_TEXT_URL_ATTR_UREF,
XML_TOK_CELL_TEXT_URL_ATTR_TYPE,
+ XML_TOK_CELL_TEXT_URL_TARGET_FRAME
};
/**
commit 549b11618a0dad1318d7cb1a244f5ad590ee9f46
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sat Oct 1 01:31:09 2016 +0200
tdf#101910, mark ScRangeList updated when DeleteArea was used
Change-Id: I98390b28c5a1bbbd391ff054b2f574951c7c00c4
Reviewed-on: https://gerrit.libreoffice.org/29422
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
Tested-by: Jenkins <ci at libreoffice.org>
(cherry picked from commit 5f658dc87794036182aa1f8586d82c5ee997cd8b)
Reviewed-on: https://gerrit.libreoffice.org/29425
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Eike Rathke <erack at redhat.com>
(cherry picked from commit ab80caf6359ac1bcf95b113b6c3b543dee0ed105)
diff --git a/sc/inc/rangelst.hxx b/sc/inc/rangelst.hxx
index 9eae5b9..9d72596 100644
--- a/sc/inc/rangelst.hxx
+++ b/sc/inc/rangelst.hxx
@@ -62,7 +62,7 @@ public:
/** For now this method assumes that nTab1 == nTab2
* The algorithm will be much more complicated if nTab1 != nTab2
*/
- void DeleteArea( SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2,
+ bool DeleteArea( SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2,
SCROW nRow2, SCTAB nTab2 );
const ScRange* Find( const ScAddress& ) const;
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index 10e7952..e26f18a 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -398,11 +398,11 @@ bool ScRangeList::UpdateReference(
{
if(nDx < 0)
{
- DeleteArea(nCol1+nDx, nRow1, nTab1, nCol1-1, nRow2, nTab2);
+ bChanged = DeleteArea(nCol1+nDx, nRow1, nTab1, nCol1-1, nRow2, nTab2);
}
if(nDy < 0)
{
- DeleteArea(nCol1, nRow1+nDy, nTab1, nCol2, nRow1-1, nTab2);
+ bChanged = DeleteArea(nCol1, nRow1+nDy, nTab1, nCol2, nRow1-1, nTab2);
}
SAL_WARN_IF(nDx < 0 && nDy < 0, "sc", "nDx and nDy are negative, check why");
}
@@ -940,9 +940,10 @@ bool handleFourRanges( const ScRange& rDelRange, ScRange* p, std::vector<ScRange
}
-void ScRangeList::DeleteArea( SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
+bool ScRangeList::DeleteArea( SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
SCCOL nCol2, SCROW nRow2, SCTAB nTab2 )
{
+ bool bChanged = false;
ScRange aRange( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
for(size_t i = 0; i < maRanges.size();)
{
@@ -950,6 +951,7 @@ void ScRangeList::DeleteArea( SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
{
ScRange* pRange = Remove(i);
delete pRange;
+ bChanged = true;
}
else
++i;
@@ -975,12 +977,18 @@ void ScRangeList::DeleteArea( SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
// r.aStart.X() <= p.aStart.X() && r.aEnd.X() >= p.aEnd.X()
// && ( r.aStart.Y() <= p.aStart.Y() || r.aEnd.Y() >= r.aEnd.Y() )
if(handleOneRange( aRange, *itr ))
+ {
+ bChanged = true;
continue;
+ }
// getting two ranges
// r.aStart.X()
else if(handleTwoRanges( aRange, *itr, aNewRanges ))
+ {
+ bChanged = true;
continue;
+ }
// getting 3 ranges
// r.aStart.X() > p.aStart.X() && r.aEnd.X() >= p.aEnd.X()
@@ -989,16 +997,24 @@ void ScRangeList::DeleteArea( SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
// r.aStart.X() <= p.aStart.X() && r.aEnd.X() < p.aEnd.X()
// && r.aStart.Y() > p.aStart.Y() && r.aEnd.Y() < p.aEnd.Y()
else if(handleThreeRanges( aRange, *itr, aNewRanges ))
+ {
+ bChanged = true;
continue;
+ }
// getting 4 ranges
// r.aStart.X() > p.aStart.X() && r.aEnd().X() < p.aEnd.X()
// && r.aStart.Y() > p.aStart.Y() && r.aEnd().Y() < p.aEnd.Y()
else if(handleFourRanges( aRange, *itr, aNewRanges ))
+ {
+ bChanged = true;
continue;
+ }
}
for(vector<ScRange>::iterator itr = aNewRanges.begin(); itr != aNewRanges.end(); ++itr)
Join( *itr);
+
+ return bChanged;
}
const ScRange* ScRangeList::Find( const ScAddress& rAdr ) const
commit 6d8fb426b1fcea2af8a64ca02ce06b9baab52feb
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Sep 28 03:55:01 2016 +0200
tdf#99386, broadcast that cell content changed after merge cells undo/redo
Change-Id: Idf41d1b07e26af66d9eefd18e5d5b582edc205e9
Reviewed-on: https://gerrit.libreoffice.org/29370
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
(cherry picked from commit f6f213bed507d1d7547f6098a67b6e460d46bce6)
Reviewed-on: https://gerrit.libreoffice.org/29377
Reviewed-by: jan iversen <jani at documentfoundation.org>
(cherry picked from commit 47d1aa87cbe8390f9c6190b13733f8c1fd240e30)
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index 9dfa81a..c1dbd34 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -725,6 +725,8 @@ void ScUndoMerge::DoChange( bool bUndo ) const
if (!bDidPaint)
ScUndoUtil::PaintMore(pDocShell, aRange);
+
+ rDoc.BroadcastCells(aRange, SC_HINT_DATACHANGED);
}
ShowTable(aCurRange);
commit 718280fa3383952afaa7a2a6cd6d3129af27d5d4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Sep 29 14:16:20 2016 +0100
Resolves: tdf#101433 reset RasterOpMode on cached virtual device before reuse
(cherry picked from commit 17f912c5bb63426f0758dccbc3357a73f56f3137)
Change-Id: I178aa499b080b0b684d41fdd4115a6398f944c43
Reviewed-on: https://gerrit.libreoffice.org/29390
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: jan iversen <jani at documentfoundation.org>
(cherry picked from commit 0537b554fd4ac56c1ac1c81e268ef1713c992cbd)
diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
index a86ebe1..c1255d1 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
@@ -196,6 +196,7 @@ namespace
{
// reused, reset some values
pRetval->SetMapMode();
+ pRetval->SetRasterOp(ROP_OVERPAINT);
}
// remember allocated buffer
commit 37daee34ad85cd9d2c69a44b470755ef346d645f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Sep 16 11:19:52 2016 +0100
Resolves: rhbz#1373933 gtk 3.21 emits a lot more "style-set" signals
also deb#837356
since gtk3 commit of...
commit 0f116135f4a5033ce4e9dfa19f10624701fa615c
Author: Matthias Clasen <mclasen at redhat.com>
Date: Fri May 6 10:12:14 2016 -0400
Avoid emitting ::style-set by name
GtkStyle is deprecated, but we still emit ::style-set quite
a bit, so lets at least not be slow while doing it.
docs say...
'GtkWidget::style-set has been deprecated since version 3.0 and should not be
used in newly-written code.
Use the “style-updated” signal'
and this code just came over from gtk2 without any thought about it at the
time, so change it over to the "style-updated" which makes everything happy
again
gtk3 still emits a lot of style-updateds signals
so don't throw away font settings every time, check if the font settings
changed and only emit FontChanged if they differ from the last seen settings.
(cherry picked from commit ef7abe81df10cb8a8c04afbb1fbe700f94e73f04)
Change-Id: I9e920d2fb2d820ff1b1b5a9ecb228484df3d6146
Reviewed-on: https://gerrit.libreoffice.org/28946
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: jan iversen <jani at documentfoundation.org>
(cherry picked from commit 243698b5520e70b54f28eed8e29bdbd551bba793)
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 3b81c54..0793b52 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -241,7 +241,11 @@ class GtkSalFrame : public SalFrame
// signals
static gboolean signalButton( GtkWidget*, GdkEventButton*, gpointer );
- static void signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer );
+#if GTK_CHECK_VERSION(3,0,0)
+ static void signalStyleUpdated(GtkWidget*, gpointer);
+#else
+ static void signalStyleSet(GtkWidget*, GtkStyle* pPrevious, gpointer);
+#endif
#if GTK_CHECK_VERSION(3,0,0)
static gboolean signalDraw( GtkWidget*, cairo_t *cr, gpointer );
static void sizeAllocated(GtkWidget*, GdkRectangle *pAllocation, gpointer frame);
diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx
index 099fa11..1e2ddba 100644
--- a/vcl/inc/unx/gtk/gtkinst.hxx
+++ b/vcl/inc/unx/gtk/gtkinst.hxx
@@ -230,6 +230,8 @@ public:
#endif
virtual const cairo_font_options_t* GetCairoFontOptions() override;
+ const cairo_font_options_t* GetLastSeenCairoFontOptions();
+ void ResetLastSeenCairoFontOptions();
void RemoveTimer (SalTimer *pTimer);
@@ -239,6 +241,7 @@ private:
std::vector<GtkSalTimer *> m_aTimers;
bool IsTimerExpired();
bool bNeedsInit;
+ cairo_font_options_t* m_pLastCairoFontOptions;
mutable std::shared_ptr<vcl::unx::GtkPrintWrapper> m_xPrintWrapper;
};
diff --git a/vcl/unx/gtk/gtkinst.cxx b/vcl/unx/gtk/gtkinst.cxx
index 6bb7bb8..0eb942c 100644
--- a/vcl/unx/gtk/gtkinst.cxx
+++ b/vcl/unx/gtk/gtkinst.cxx
@@ -157,6 +157,7 @@ GtkInstance::GtkInstance( SalYieldMutex* pMutex )
: X11SalInstance( pMutex )
#endif
, bNeedsInit(true)
+ , m_pLastCairoFontOptions(nullptr)
{
}
@@ -202,6 +203,7 @@ GtkInstance::~GtkInstance()
while( !m_aTimers.empty() )
delete *m_aTimers.begin();
DeInitAtkBridge();
+ ResetLastSeenCairoFontOptions();
}
SalFrame* GtkInstance::CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle )
@@ -478,7 +480,24 @@ GtkInstance::getPrintWrapper() const
const cairo_font_options_t* GtkInstance::GetCairoFontOptions()
{
- return gdk_screen_get_font_options(gdk_screen_get_default());
+ const cairo_font_options_t* pCairoFontOptions = gdk_screen_get_font_options(gdk_screen_get_default());
+ if (!m_pLastCairoFontOptions && pCairoFontOptions)
+ m_pLastCairoFontOptions = cairo_font_options_copy(pCairoFontOptions);
+ return pCairoFontOptions;
+}
+
+const cairo_font_options_t* GtkInstance::GetLastSeenCairoFontOptions()
+{
+ return m_pLastCairoFontOptions;
+}
+
+void GtkInstance::ResetLastSeenCairoFontOptions()
+{
+ if (m_pLastCairoFontOptions)
+ {
+ cairo_font_options_destroy(m_pLastCairoFontOptions);
+ m_pLastCairoFontOptions = nullptr;
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index 61a9637..5448611 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -3289,7 +3289,21 @@ void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer fram
// so post user event to safely dispatch the SALEVENT_SETTINGSCHANGED
// note: settings changed for multiple frames is avoided in winproc.cxx ImplHandleSettings
GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SALEVENT_SETTINGSCHANGED );
- GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SALEVENT_FONTCHANGED );
+
+ // fire off font-changed when the system cairo font hints change
+ GtkInstance *pInstance = static_cast<GtkInstance*>(GetSalData()->m_pInstance);
+ const cairo_font_options_t* pLastCairoFontOptions = pInstance->GetLastSeenCairoFontOptions();
+ const cairo_font_options_t* pCurrentCairoFontOptions = gdk_screen_get_font_options(gdk_screen_get_default());
+ bool bFontSettingsChanged = true;
+ if (pLastCairoFontOptions && pCurrentCairoFontOptions)
+ bFontSettingsChanged = !cairo_font_options_equal(pLastCairoFontOptions, pCurrentCairoFontOptions);
+ else if (!pLastCairoFontOptions && !pCurrentCairoFontOptions)
+ bFontSettingsChanged = false;
+ if (bFontSettingsChanged)
+ {
+ pInstance->ResetLastSeenCairoFontOptions();
+ GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SALEVENT_FONTCHANGED );
+ }
}
/* #i64117# gtk sets a nice background pixmap
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index d169db3..6165132 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -1019,7 +1019,7 @@ void GtkSalFrame::InitCommon()
// connect signals
- g_signal_connect( G_OBJECT(m_pWindow), "style-set", G_CALLBACK(signalStyleSet), this );
+ g_signal_connect( G_OBJECT(m_pWindow), "style-updated", G_CALLBACK(signalStyleUpdated), this );
gtk_widget_set_has_tooltip(pEventWidget, true);
m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "query-tooltip", G_CALLBACK(signalTooltipQuery), this ));
m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "button-press-event", G_CALLBACK(signalButton), this ));
@@ -3061,20 +3061,25 @@ gboolean GtkSalFrame::signalDelete( GtkWidget*, GdkEvent*, gpointer frame )
return true;
}
-void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer frame )
+void GtkSalFrame::signalStyleUpdated(GtkWidget*, gpointer frame)
{
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
- // every frame gets an initial style set on creation
- // do not post these as the whole application tends to
- // redraw itself to adjust to the new style
- // where there IS no new style resulting in tremendous unnecessary flickering
- if( pPrevious != nullptr )
+ // note: settings changed for multiple frames is avoided in winproc.cxx ImplHandleSettings
+ GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SALEVENT_SETTINGSCHANGED );
+
+ // fire off font-changed when the system cairo font hints change
+ GtkInstance *pInstance = static_cast<GtkInstance*>(GetSalData()->m_pInstance);
+ const cairo_font_options_t* pLastCairoFontOptions = pInstance->GetLastSeenCairoFontOptions();
+ const cairo_font_options_t* pCurrentCairoFontOptions = gdk_screen_get_font_options(gdk_screen_get_default());
+ bool bFontSettingsChanged = true;
+ if (pLastCairoFontOptions && pCurrentCairoFontOptions)
+ bFontSettingsChanged = !cairo_font_options_equal(pLastCairoFontOptions, pCurrentCairoFontOptions);
+ else if (!pLastCairoFontOptions && !pCurrentCairoFontOptions)
+ bFontSettingsChanged = false;
+ if (bFontSettingsChanged)
{
- // signalStyleSet does NOT usually have the gdk lock
- // so post user event to safely dispatch the SALEVENT_SETTINGSCHANGED
- // note: settings changed for multiple frames is avoided in winproc.cxx ImplHandleSettings
- GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SALEVENT_SETTINGSCHANGED );
+ pInstance->ResetLastSeenCairoFontOptions();
GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SALEVENT_FONTCHANGED );
}
}
commit fe9fd49ffccb6bee448c87515ae69ddde3b179c3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Oct 3 15:22:50 2016 +0100
Resolves: tdf#101711 revert attempt to drop unused bg images
for 5-2/5-1 simply revert the effort
Revert "Related: rhbz#1353069 don't clear XATTR_FILL* from stylesheet if..."
This reverts commit 19c191a0a92b6ae9ca86aa4ee7afb887fd42a209.
Revert "Resolves: rhbz#1353069 don't clear XATTR_FILL* from stylesheet if..."
This reverts commit fad4d7877ac8d04ab82e8acd21205f315d6eab1f.
Revert "rhbz#1326602 avoid exp. bg bitmaps from deleted slides"
This reverts commit fd45334b49c09538598f82f5ffa2f61f6bdd9d24.
Change-Id: I591083b6b1d7b08316ee24c0788386799d01724b
Reviewed-on: https://gerrit.libreoffice.org/29491
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: jan iversen <jani at documentfoundation.org>
(cherry picked from commit 8127ac5412b0af8ed7985e07ab11b3241a4e659e)
diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx
index 4ffc74b..d55de74 100644
--- a/include/svx/svdundo.hxx
+++ b/include/svx/svdundo.hxx
@@ -22,7 +22,6 @@
#include <sal/config.h>
-#include <memory>
#include <vector>
#include <svl/solar.hrc>
@@ -34,7 +33,6 @@
#include <svx/svxdllapi.h>
class SfxItemSet;
-class SfxPoolItem;
class SfxStyleSheet;
class SdrView;
class SdrPageView;
@@ -588,12 +586,9 @@ class SVX_DLLPUBLIC SdrUndoDelPage : public SdrUndoPageList
// When deleting a MasterPage, we remember all relations of the
// Character Page with the MasterPage in this UndoGroup.
SdrUndoGroup* pUndoGroup;
- std::unique_ptr<SfxPoolItem> mpFillBitmapItem;
- bool mbHasFillBitmap;
- bool mbSoleOwnerOfFillBitmapProps;
public:
- SdrUndoDelPage(SdrPage& rNewPg, bool bSoleOwnerOfFillBitmapProps);
+ SdrUndoDelPage(SdrPage& rNewPg);
virtual ~SdrUndoDelPage();
virtual void Undo() override;
@@ -604,11 +599,6 @@ public:
virtual void SdrRepeat(SdrView& rView) override;
virtual bool CanSdrRepeat(SdrView& rView) const override;
-
-private:
- void queryFillBitmap(const SfxItemSet &rItemSet);
- void clearFillBitmap();
- void restoreFillBitmap();
};
/**
@@ -765,7 +755,7 @@ public:
virtual SdrUndoAction* CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1);
// Page
- virtual SdrUndoAction* CreateUndoDeletePage(SdrPage& rPage, bool bSoleOwnerOfFillBitmapProps = true);
+ virtual SdrUndoAction* CreateUndoDeletePage(SdrPage& rPage);
virtual SdrUndoAction* CreateUndoNewPage(SdrPage& rPage);
virtual SdrUndoAction* CreateUndoCopyPage(SdrPage& rPage);
virtual SdrUndoAction* CreateUndoSetPageNum(SdrPage& rNewPg, sal_uInt16 nOldPageNum1, sal_uInt16 nNewPageNum1);
diff --git a/reportdesign/source/core/inc/ReportUndoFactory.hxx b/reportdesign/source/core/inc/ReportUndoFactory.hxx
index 1839f1f..88d0024 100644
--- a/reportdesign/source/core/inc/ReportUndoFactory.hxx
+++ b/reportdesign/source/core/inc/ReportUndoFactory.hxx
@@ -59,7 +59,7 @@ namespace rptui
virtual SdrUndoAction* CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1) override;
// page
- virtual SdrUndoAction* CreateUndoDeletePage(SdrPage& rPage, bool bSoleOwnerOfFillBitmapProps = true) override;
+ virtual SdrUndoAction* CreateUndoDeletePage(SdrPage& rPage) override;
virtual SdrUndoAction* CreateUndoNewPage(SdrPage& rPage) override;
virtual SdrUndoAction* CreateUndoCopyPage(SdrPage& rPage) override;
virtual SdrUndoAction* CreateUndoSetPageNum(SdrPage& rNewPg, sal_uInt16 nOldPageNum1, sal_uInt16 nNewPageNum1) override;
diff --git a/reportdesign/source/core/sdr/ReportUndoFactory.cxx b/reportdesign/source/core/sdr/ReportUndoFactory.cxx
index 566400c..cbb5a8a 100644
--- a/reportdesign/source/core/sdr/ReportUndoFactory.cxx
+++ b/reportdesign/source/core/sdr/ReportUndoFactory.cxx
@@ -133,9 +133,9 @@ SdrUndoAction* OReportUndoFactory::CreateUndoMoveLayer(sal_uInt16 nLayerNum, Sdr
}
// page
-SdrUndoAction* OReportUndoFactory::CreateUndoDeletePage(SdrPage& rPage, bool bSoleOwnerOfFillBitmapProps)
+SdrUndoAction* OReportUndoFactory::CreateUndoDeletePage(SdrPage& rPage)
{
- return m_pUndoFactory->CreateUndoDeletePage(rPage, bSoleOwnerOfFillBitmapProps);
+ return m_pUndoFactory->CreateUndoDeletePage( rPage );
}
SdrUndoAction* OReportUndoFactory::CreateUndoNewPage(SdrPage& rPage)
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 39956ca..6235250 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -409,7 +409,7 @@ void ScDrawLayer::ScRemovePage( SCTAB nTab )
if (bRecording)
{
SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab));
- AddCalcUndo(new SdrUndoDelPage(*pPage, true)); // Undo-Action becomes the page owner
+ AddCalcUndo(new SdrUndoDelPage(*pPage)); // Undo-Action becomes the page owner
RemovePage( static_cast<sal_uInt16>(nTab) ); // just deliver, not deleting
}
else
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 8b0c53d..55c8486 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -800,17 +800,8 @@ bool SdDrawDocument::InsertBookmarkAsPage(
aTest == aMPLayout &&
eKind == pTest->GetPageKind() )
{
- if (bUndo)
- {
- bool bSoleOwnerOfStyleSheet = true;
- if (pRefPage->IsMasterPage())
- {
- const SfxStyleSheet* pRefSheet = pRefPage->getSdrPageProperties().GetStyleSheet();
- const SfxStyleSheet* pTestSheet = pTest->getSdrPageProperties().GetStyleSheet();
- bSoleOwnerOfStyleSheet = pRefSheet != pTestSheet;
- }
- AddUndo(GetSdrUndoFactory().CreateUndoDeletePage(*pRefPage, bSoleOwnerOfStyleSheet));
- }
+ if( bUndo )
+ AddUndo(GetSdrUndoFactory().CreateUndoDeletePage(*pRefPage));
RemoveMasterPage(nPage);
@@ -1249,7 +1240,6 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl
{
// Do not delete master pages that have their precious flag set
bool bDeleteMaster = !pMaster->IsPrecious();
- bool bSoleOwnerOfStyleSheet = true;
OUString aLayoutName = pMaster->GetLayoutName();
if(bOnlyDuplicatePages )
@@ -1264,10 +1254,6 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl
{
// duplicate page found -> remove it
bDeleteMaster = true;
-
- const SfxStyleSheet* pRefSheet = pMaster->getSdrPageProperties().GetStyleSheet();
- const SfxStyleSheet* pTestSheet = pMPg->getSdrPageProperties().GetStyleSheet();
- bSoleOwnerOfStyleSheet = pRefSheet != pTestSheet;
}
}
}
@@ -1301,7 +1287,7 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl
delete pNotesMaster;
if( bUndo )
- AddUndo(GetSdrUndoFactory().CreateUndoDeletePage(*pMaster, bSoleOwnerOfStyleSheet));
+ AddUndo(GetSdrUndoFactory().CreateUndoDeletePage(*pMaster));
RemoveMasterPage( pMaster->GetPageNum() );
diff --git a/sd/source/ui/func/undoback.cxx b/sd/source/ui/func/undoback.cxx
index 704b551..126101f 100644
--- a/sd/source/ui/func/undoback.cxx
+++ b/sd/source/ui/func/undoback.cxx
@@ -21,14 +21,8 @@
#include "sdpage.hxx"
#include "sdresid.hxx"
#include "strings.hrc"
-
-#include <com/sun/star/drawing/FillStyle.hpp>
-
-#include <o3tl/make_unique.hxx>
-
#include <svl/itemset.hxx>
-#include <svx/xfillit0.hxx>
SdBackgroundObjUndoAction::SdBackgroundObjUndoAction(
SdDrawDocument& rDoc,
@@ -36,12 +30,10 @@ SdBackgroundObjUndoAction::SdBackgroundObjUndoAction(
const SfxItemSet& rItenSet)
: SdUndoAction(&rDoc),
mrPage(rPage),
- mpItemSet(new SfxItemSet(rItenSet)),
- mbHasFillBitmap(false)
+ mpItemSet(new SfxItemSet(rItenSet))
{
OUString aString( SdResId( STR_UNDO_CHANGE_PAGEFORMAT ) );
SetComment( aString );
- saveFillBitmap(*mpItemSet);
}
SdBackgroundObjUndoAction::~SdBackgroundObjUndoAction()
@@ -53,14 +45,9 @@ void SdBackgroundObjUndoAction::ImplRestoreBackgroundObj()
{
SfxItemSet* pNew = new SfxItemSet(mrPage.getSdrPageProperties().GetItemSet());
mrPage.getSdrPageProperties().ClearItem();
- if (bool(mpFillBitmapItem))
- restoreFillBitmap(*mpItemSet);
- mpFillBitmapItem.reset();
- mbHasFillBitmap = false;
mrPage.getSdrPageProperties().PutItemSet(*mpItemSet);
delete mpItemSet;
mpItemSet = pNew;
- saveFillBitmap(*mpItemSet);
// tell the page that it's visualization has changed
mrPage.ActionChanged();
@@ -78,33 +65,7 @@ void SdBackgroundObjUndoAction::Redo()
SdUndoAction* SdBackgroundObjUndoAction::Clone() const
{
- std::unique_ptr<SdBackgroundObjUndoAction> pCopy = o3tl::make_unique<SdBackgroundObjUndoAction>(*mpDoc, mrPage, *mpItemSet);
- if (mpFillBitmapItem)
- pCopy->mpFillBitmapItem.reset(mpFillBitmapItem->Clone());
- pCopy->mbHasFillBitmap = mbHasFillBitmap;
- return pCopy.release();
-}
-
-void SdBackgroundObjUndoAction::saveFillBitmap(SfxItemSet &rItemSet)
-{
- const SfxPoolItem *pItem = nullptr;
- if (rItemSet.GetItemState(XATTR_FILLBITMAP, false, &pItem) == SfxItemState::SET)
- mpFillBitmapItem.reset(pItem->Clone());
- if (bool(mpFillBitmapItem))
- {
- if (rItemSet.GetItemState(XATTR_FILLSTYLE, false, &pItem) == SfxItemState::SET)
- mbHasFillBitmap = static_cast<const XFillStyleItem*>(pItem)->GetValue() == css::drawing::FillStyle_BITMAP;
- rItemSet.ClearItem(XATTR_FILLBITMAP);
- if (mbHasFillBitmap)
- rItemSet.ClearItem(XATTR_FILLSTYLE);
- }
-}
-
-void SdBackgroundObjUndoAction::restoreFillBitmap(SfxItemSet &rItemSet)
-{
- rItemSet.Put(*mpFillBitmapItem);
- if (mbHasFillBitmap)
- rItemSet.Put(XFillStyleItem(css::drawing::FillStyle_BITMAP));
+ return new SdBackgroundObjUndoAction(*mpDoc, mrPage, *mpItemSet);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/undoback.hxx b/sd/source/ui/inc/undoback.hxx
index 35370ca..3b1553b 100644
--- a/sd/source/ui/inc/undoback.hxx
+++ b/sd/source/ui/inc/undoback.hxx
@@ -20,13 +20,11 @@
#ifndef INCLUDED_SD_SOURCE_UI_INC_UNDOBACK_HXX
#define INCLUDED_SD_SOURCE_UI_INC_UNDOBACK_HXX
-#include <memory>
#include "sdundo.hxx"
class SdDrawDocument;
class SdPage;
class SfxItemSet;
-class SfxPoolItem;
// SdBackgroundObjUndoAction
class SdBackgroundObjUndoAction : public SdUndoAction
@@ -35,12 +33,8 @@ private:
SdPage& mrPage;
SfxItemSet* mpItemSet;
- std::unique_ptr<SfxPoolItem> mpFillBitmapItem;
- bool mbHasFillBitmap;
void ImplRestoreBackgroundObj();
- void saveFillBitmap(SfxItemSet &rItemSet);
- void restoreFillBitmap(SfxItemSet &rItemSet);
public:
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index 28064e7..416ee58 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <com/sun/star/drawing/FillStyle.hpp>
#include <svl/lstner.hxx>
@@ -28,7 +27,6 @@
#include <svx/svdlayer.hxx>
#include <svx/svdmodel.hxx>
#include <svx/svdview.hxx>
-#include <svx/xfillit0.hxx>
#include "svx/svdstr.hrc"
#include "svdglob.hxx"
#include <svx/scene3d.hxx>
@@ -1455,28 +1453,13 @@ SdrUndoPageList::~SdrUndoPageList()
}
-SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg, bool bSoleOwnerOfFillBitmapProps)
+
+SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg)
: SdrUndoPageList(rNewPg)
, pUndoGroup(nullptr)
- , mbHasFillBitmap(false)
- , mbSoleOwnerOfFillBitmapProps(bSoleOwnerOfFillBitmapProps)
{
bItsMine = true;
- // keep fill bitmap separately to remove it from pool if not used elsewhere
- if (mrPage.IsMasterPage())
- {
- SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet();
- if (pStyleSheet)
- queryFillBitmap(pStyleSheet->GetItemSet());
- }
- else
- {
- queryFillBitmap(mrPage.getSdrPageProperties().GetItemSet());
- }
- if (bool(mpFillBitmapItem))
- clearFillBitmap();
-
// now remember the master page relationships
if(mrPage.IsMasterPage())
{
@@ -1511,8 +1494,6 @@ SdrUndoDelPage::~SdrUndoDelPage()
void SdrUndoDelPage::Undo()
{
- if (bool(mpFillBitmapItem))
- restoreFillBitmap();
ImpInsertPage(nPageNum);
if (pUndoGroup!=nullptr)
{
@@ -1526,8 +1507,6 @@ void SdrUndoDelPage::Undo()
void SdrUndoDelPage::Redo()
{
ImpRemovePage(nPageNum);
- if (bool(mpFillBitmapItem))
- clearFillBitmap();
// master page relations are dissolved automatically
DBG_ASSERT(!bItsMine,"RedoDeletePage: mrPage already belongs to UndoAction.");
bItsMine=true;
@@ -1556,61 +1535,6 @@ bool SdrUndoDelPage::CanSdrRepeat(SdrView& /*rView*/) const
return false;
}
-void SdrUndoDelPage::queryFillBitmap(const SfxItemSet& rItemSet)
-{
- const SfxPoolItem *pItem = nullptr;
- if (rItemSet.GetItemState(XATTR_FILLBITMAP, false, &pItem) == SfxItemState::SET)
- mpFillBitmapItem.reset(pItem->Clone());
- if (rItemSet.GetItemState(XATTR_FILLSTYLE, false, &pItem) == SfxItemState::SET)
- mbHasFillBitmap = static_cast<const XFillStyleItem*>(pItem)->GetValue() == css::drawing::FillStyle_BITMAP;
-}
-
-void SdrUndoDelPage::clearFillBitmap()
-{
- if (mrPage.IsMasterPage())
- {
- if (mbSoleOwnerOfFillBitmapProps)
- {
- SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet();
- assert(bool(pStyleSheet)); // who took away my stylesheet?
- SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
- rItemSet.ClearItem(XATTR_FILLBITMAP);
- if (mbHasFillBitmap)
- rItemSet.ClearItem(XATTR_FILLSTYLE);
- }
- }
- else
- {
- SdrPageProperties &rPageProps = mrPage.getSdrPageProperties();
- rPageProps.ClearItem(XATTR_FILLBITMAP);
- if (mbHasFillBitmap)
- rPageProps.ClearItem(XATTR_FILLSTYLE);
- }
-}
-
-void SdrUndoDelPage::restoreFillBitmap()
-{
- if (mrPage.IsMasterPage())
- {
- if (mbSoleOwnerOfFillBitmapProps)
- {
- SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet();
- assert(bool(pStyleSheet)); // who took away my stylesheet?
- SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
- rItemSet.Put(*mpFillBitmapItem);
- if (mbHasFillBitmap)
- rItemSet.Put(XFillStyleItem(css::drawing::FillStyle_BITMAP));
- }
- }
- else
- {
- SdrPageProperties &rPageProps = mrPage.getSdrPageProperties();
- rPageProps.PutItem(*mpFillBitmapItem);
- if (mbHasFillBitmap)
- rPageProps.PutItem(XFillStyleItem(css::drawing::FillStyle_BITMAP));
- }
-}
-
void SdrUndoNewPage::Undo()
{
@@ -1857,9 +1781,9 @@ SdrUndoAction* SdrUndoFactory::CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLaye
}
// page
-SdrUndoAction* SdrUndoFactory::CreateUndoDeletePage(SdrPage& rPage, bool bSoleOwnerOfFillBitmapProps)
+SdrUndoAction* SdrUndoFactory::CreateUndoDeletePage(SdrPage& rPage)
{
- return new SdrUndoDelPage(rPage, bSoleOwnerOfFillBitmapProps);
+ return new SdrUndoDelPage( rPage );
}
SdrUndoAction* SdrUndoFactory::CreateUndoNewPage(SdrPage& rPage)
commit e649c9ce40f7425fb4a4670201a1f36e028c5022
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Sep 27 20:47:16 2016 +0100
Resolves: tdf#101884 keyboard navigation in User defined border control
Change-Id: I92ea37754f057c560d19b41f814a1d649ea74876
(cherry picked from commit f20996450e409406f4f55f9eb7ca9bfe1e455c35)
Reviewed-on: https://gerrit.libreoffice.org/29345
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
(cherry picked from commit 0620f7ca99eca6c8fe00a99b999ad74b8847ffe4)
diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx
index 7a67870..605dac6 100644
--- a/svx/source/dialog/frmsel.cxx
+++ b/svx/source/dialog/frmsel.cxx
@@ -1176,6 +1176,7 @@ void FrameSelector::KeyInput( const KeyEvent& rKEvt )
DeselectAllBorders();
SelectBorder( eBorder );
}
+ bHandled = true;
}
}
break;
More information about the Libreoffice-commits
mailing list