add some more goodies

f41
Caolán McNamara 10 years ago
parent 5edfb6299e
commit 460b6862c4

@ -0,0 +1,162 @@
From 0bb29affae83d0410f745f46267527e10777fcd2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Fri, 17 Oct 2014 15:03:34 +0100
Subject: [PATCH] Resolves: fdo#62682 crash on second export of svg
because the first export has left "dangling" CalcFieldValueHdl Links in
Outliners that got created based on the Drawing Outliner while it had a
temporary CalcFieldValueHdl installed, and didn't get the old CalcFieldValueHdl
installed when the old Drawing Outliner one was re-installed.
(cherry picked from commit 5bdfa8c12472eb9ff6ca054c2ada7150b1869fff)
Change-Id: I064a154ece488c9a4c3467b753451df7e73ae883
Reviewed-on: https://gerrit.libreoffice.org/12009
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
---
filter/source/svg/svgexport.cxx | 18 ++++++++++++++++--
filter/source/svg/svgfilter.hxx | 1 +
include/svx/svdmodel.hxx | 2 ++
svx/source/inc/svdoutlinercache.hxx | 7 +++++++
svx/source/svdraw/svdmodel.cxx | 11 +++++++++++
svx/source/svdraw/svdoutlinercache.cxx | 2 ++
6 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 07cf0a4..7dc2419 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -602,7 +602,8 @@ bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
SdrOutliner& rOutl = mpSdrModel->GetDrawOutliner(NULL);
maOldFieldHdl = rOutl.GetCalcFieldValueHdl();
- rOutl.SetCalcFieldValueHdl( LINK( this, SVGFilter, CalcFieldHdl) );
+ maNewFieldHdl = LINK(this, SVGFilter, CalcFieldHdl);
+ rOutl.SetCalcFieldValueHdl(maNewFieldHdl);
}
}
bRet = implExportDocument();
@@ -615,7 +616,20 @@ bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
}
if( mpSdrModel )
- mpSdrModel->GetDrawOutliner( NULL ).SetCalcFieldValueHdl( maOldFieldHdl );
+ {
+ //fdo#62682 The maNewFieldHdl can end up getting copied
+ //into various other outliners which live past this
+ //method, so get the full list of outliners and restore
+ //the maOldFieldHdl for all that have ended up using
+ //maNewFieldHdl
+ std::vector<SdrOutliner*> aOutliners(mpSdrModel->GetActiveOutliners());
+ for (std::vector<SdrOutliner*>::iterator aIter = aOutliners.begin(); aIter != aOutliners.end(); ++aIter)
+ {
+ SdrOutliner* pOutliner = *aIter;
+ if (maNewFieldHdl == pOutliner->GetCalcFieldValueHdl())
+ pOutliner->SetCalcFieldValueHdl(maOldFieldHdl);
+ }
+ }
delete mpSVGWriter, mpSVGWriter = NULL;
mpSVGExport = NULL; // pointed object is released by xSVGExport dtor at the end of this scope
diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx
index 7b68c2b..0c6371f 100644
--- a/filter/source/svg/svgfilter.hxx
+++ b/filter/source/svg/svgfilter.hxx
@@ -265,6 +265,7 @@ private:
XDrawPageSequence mMasterPageTargets;
Link maOldFieldHdl;
+ Link maNewFieldHdl;
bool implImport( const Sequence< PropertyValue >& rDescriptor ) throw (RuntimeException);
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index e982cb5..5aeeb70 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -233,6 +233,8 @@ public:
sal_uIntPtr nSwapGraphicsMode;
SdrOutlinerCache* mpOutlinerCache;
+ //get a vector of all the SdrOutliner belonging to the model
+ std::vector<SdrOutliner*> GetActiveOutliners() const;
SdrModelImpl* mpImpl;
sal_uInt16 mnCharCompressType;
sal_uInt16 mnHandoutPageCount;
diff --git a/svx/source/inc/svdoutlinercache.hxx b/svx/source/inc/svdoutlinercache.hxx
index 6dbf728..03572fc 100644
--- a/svx/source/inc/svdoutlinercache.hxx
+++ b/svx/source/inc/svdoutlinercache.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SVX_SOURCE_INC_SVDOUTLINERCACHE_HXX
#include <sal/types.h>
+#include <vector>
class SdrModel;
class SdrOutliner;
@@ -33,12 +34,18 @@ private:
SdrOutliner* mpModeOutline;
SdrOutliner* mpModeText;
+
+ std::vector<SdrOutliner*> maActiveOutliners;
public:
SdrOutlinerCache( SdrModel* pModel );
~SdrOutlinerCache();
SdrOutliner* createOutliner( sal_uInt16 nOutlinerMode );
void disposeOutliner( SdrOutliner* pOutliner );
+ std::vector<SdrOutliner*> GetActiveOutliners() const
+ {
+ return maActiveOutliners;
+ }
};
#endif
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index f3fc337..0735d14 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1929,6 +1929,17 @@ SdrOutliner* SdrModel::createOutliner( sal_uInt16 nOutlinerMode )
return mpOutlinerCache->createOutliner( nOutlinerMode );
}
+std::vector<SdrOutliner*> SdrModel::GetActiveOutliners() const
+{
+ std::vector<SdrOutliner*> aRet(mpOutlinerCache ?
+ mpOutlinerCache->GetActiveOutliners() : std::vector<SdrOutliner*>());
+
+ aRet.push_back(pDrawOutliner);
+ aRet.push_back(pHitTestOutliner);
+
+ return aRet;
+}
+
void SdrModel::disposeOutliner( SdrOutliner* pOutliner )
{
if( mpOutlinerCache )
diff --git a/svx/source/svdraw/svdoutlinercache.cxx b/svx/source/svdraw/svdoutlinercache.cxx
index 8f9eba8..810034a 100644
--- a/svx/source/svdraw/svdoutlinercache.cxx
+++ b/svx/source/svdraw/svdoutlinercache.cxx
@@ -49,6 +49,7 @@ SdrOutliner* SdrOutlinerCache::createOutliner( sal_uInt16 nOutlinerMode )
pOutliner = SdrMakeOutliner( nOutlinerMode, mpModel );
Outliner& aDrawOutliner = mpModel->GetDrawOutliner();
pOutliner->SetCalcFieldValueHdl( aDrawOutliner.GetCalcFieldValueHdl() );
+ maActiveOutliners.push_back(pOutliner);
}
return pOutliner;
@@ -95,6 +96,7 @@ void SdrOutlinerCache::disposeOutliner( SdrOutliner* pOutliner )
}
else
{
+ maActiveOutliners.erase(std::remove(maActiveOutliners.begin(), maActiveOutliners.end(), pOutliner), maActiveOutliners.end());
delete pOutliner;
}
}
--
1.9.3

@ -0,0 +1,334 @@
From 5ae6072774ab544fdfdfebf2364e97ca2fa2326a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Mon, 3 Nov 2014 09:49:37 +0000
Subject: [PATCH] Resolves: fdo#68347 fix word count with recorded changes
also see fdo#46757
a) We need to ignore redline-deleted text, but count redline-added text
b) each block of text is denoted by its end position in the model
and where that maps to in the view so a hidden portion
should record its end point not its starting point, and a non-hidden
deleted portion should always record its end point
c) when mapping a model position to the view we take the offset of
the model pos arg from the block end and use that to offset the
mapped block-end view pos to get the final view pos. But for
hidden portions that won't make a whole lot of sense, and
end up offsetting into prior portions, so map all positions within a
hidden portion to the same block-end view pos
add regression tests for these cases
(cherry picked from commit fa430e6b4e6f5d096bdf59db26e5d7393ca2297b)
Conflicts:
sw/qa/core/uwriter.cxx
Change-Id: I45c76bba47fd430bc3bccb5f919502660d415d9e
Reviewed-on: https://gerrit.libreoffice.org/12219
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
---
sw/inc/modeltoviewhelper.hxx | 25 +++++++---
sw/qa/core/uwriter.cxx | 34 ++++++++++----
sw/source/core/text/porlay.cxx | 5 +-
sw/source/core/txtnode/modeltoviewhelper.cxx | 70 +++++++++++++++++-----------
sw/source/core/txtnode/txtedt.cxx | 2 +-
5 files changed, 93 insertions(+), 43 deletions(-)
diff --git a/sw/inc/modeltoviewhelper.hxx b/sw/inc/modeltoviewhelper.hxx
index 018b67c..d99c9db 100644
--- a/sw/inc/modeltoviewhelper.hxx
+++ b/sw/inc/modeltoviewhelper.hxx
@@ -65,19 +65,30 @@ class SwTxtNode;
#define EXPANDFIELDS 0x0001
#define EXPANDFOOTNOTE 0x0002
#define HIDEINVISIBLE 0x0004
-#define HIDEREDLINED 0x0008
+#define HIDEDELETIONS 0x0008
/// do not expand to content, but replace with ZWSP
#define REPLACEMODE 0x0010
class ModelToViewHelper
{
- /** For each field in the model string, there is an entry in the conversion
- map. The first value of the ConversionMapEntry points to the field
- position in the model string, the second value points to the associated
- position in the view string. The last entry in the conversion map
- denotes the lengths of the model resp. view string.
+ /** For each expanded/hidden portion in the model string, there is an entry in
+ the conversion map. The first value of the ConversionMapEntry points to
+ the start position in the model string, the second value points to the
+ associated start position in the view string. The last entry in the
+ conversion map denotes the lengths of the model resp. view string.
*/
- typedef std::pair< sal_Int32 , sal_Int32 > ConversionMapEntry;
+ struct ConversionMapEntry
+ {
+ ConversionMapEntry(sal_Int32 nModelPos, sal_Int32 nViewPos, bool bVisible)
+ : m_nModelPos(nModelPos)
+ , m_nViewPos(nViewPos)
+ , m_bVisible(bVisible)
+ {
+ }
+ sal_Int32 m_nModelPos;
+ sal_Int32 m_nViewPos;
+ bool m_bVisible;
+ };
typedef std::vector< ConversionMapEntry > ConversionMap;
typedef std::vector<sal_Int32> Positions;
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index bd6e000..1297c65 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -321,7 +321,7 @@ void SwDocTest::testModelToViewHelper()
}
{
- ModelToViewHelper aModelToViewHelper(*pTxtNode, HIDEREDLINED);
+ ModelToViewHelper aModelToViewHelper(*pTxtNode, HIDEDELETIONS);
OUString sViewText = aModelToViewHelper.getViewText();
CPPUNIT_ASSERT_EQUAL(
OUString("AAAABB " + OUString(CH_TXTATR_BREAKWORD) + " CCCCC " + OUString(CH_TXTATR_BREAKWORD) + " DDDDD"),
@@ -349,14 +349,14 @@ void SwDocTest::testModelToViewHelper()
}
{
- ModelToViewHelper aModelToViewHelper(*pTxtNode, EXPANDFIELDS | HIDEREDLINED | EXPANDFOOTNOTE);
+ ModelToViewHelper aModelToViewHelper(*pTxtNode, EXPANDFIELDS | HIDEDELETIONS | EXPANDFOOTNOTE);
OUString sViewText = aModelToViewHelper.getViewText();
CPPUNIT_ASSERT_EQUAL(
OUString("AAAABB foo CCCCC foo DDDDD"), sViewText);
}
{
ModelToViewHelper aModelToViewHelper(*pTxtNode,
- EXPANDFIELDS | HIDEREDLINED | EXPANDFOOTNOTE | REPLACEMODE);
+ EXPANDFIELDS | HIDEDELETIONS | EXPANDFOOTNOTE | REPLACEMODE);
OUString sViewText = aModelToViewHelper.getViewText();
CPPUNIT_ASSERT_EQUAL(
OUString("AAAABB " + OUString(CHAR_ZWSP) + " CCCCC " + OUString(CHAR_ZWSP) + " DDDDD"),
@@ -372,7 +372,7 @@ void SwDocTest::testModelToViewHelper()
}
{
- ModelToViewHelper aModelToViewHelper(*pTxtNode, HIDEINVISIBLE | HIDEREDLINED);
+ ModelToViewHelper aModelToViewHelper(*pTxtNode, HIDEINVISIBLE | HIDEDELETIONS);
OUString sViewText = aModelToViewHelper.getViewText();
OUStringBuffer aBuffer;
aBuffer.append("AAAACCCCC ");
@@ -382,13 +382,13 @@ void SwDocTest::testModelToViewHelper()
}
{
- ModelToViewHelper aModelToViewHelper(*pTxtNode, EXPANDFIELDS | HIDEINVISIBLE | HIDEREDLINED | EXPANDFOOTNOTE);
+ ModelToViewHelper aModelToViewHelper(*pTxtNode, EXPANDFIELDS | HIDEINVISIBLE | HIDEDELETIONS | EXPANDFOOTNOTE);
OUString sViewText = aModelToViewHelper.getViewText();
CPPUNIT_ASSERT_EQUAL(OUString("AAAACCCCC foo DDDDD"), sViewText);
}
{
ModelToViewHelper aModelToViewHelper(*pTxtNode,
- EXPANDFIELDS | HIDEINVISIBLE | HIDEREDLINED | EXPANDFOOTNOTE | REPLACEMODE);
+ EXPANDFIELDS | HIDEINVISIBLE | HIDEDELETIONS | EXPANDFOOTNOTE | REPLACEMODE);
OUString sViewText = aModelToViewHelper.getViewText();
CPPUNIT_ASSERT_EQUAL(sViewText,
OUString("AAAACCCCC " + OUString(CHAR_ZWSP) + " DDDDD"));
@@ -669,8 +669,26 @@ void SwDocTest::testSwScanner()
aDocStat.Reset();
pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len()); //word-counting the text should only count the non-deleted text, and this whole chunk should be ignored
- CPPUNIT_ASSERT_EQUAL(aDocStat.nWord, static_cast<sal_uLong>(0));
- CPPUNIT_ASSERT_EQUAL(aDocStat.nChar, static_cast<sal_uLong>(0));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uLong>(0), aDocStat.nWord);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uLong>(0), aDocStat.nChar);
+
+ // https://bugs.libreoffice.org/show_bug.cgi?id=68347 we do want to count
+ // redline *added* text though
+ m_pDoc->SetRedlineMode(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_DELETE|nsRedlineMode_t::REDLINE_SHOW_INSERT);
+ aPaM.DeleteMark();
+ aPaM.GetPoint()->nContent.Assign(aPaM.GetCntntNode(), 0);
+ m_pDoc->InsertString(aPaM, "redline-new-text ");
+ aDocStat.Reset();
+ pTxtNode = aPaM.GetNode()->GetTxtNode();
+ pTxtNode->SetWordCountDirty(true);
+ pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len());
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uLong>(2), aDocStat.nWord);
+ //redline-new-text Lorem ipsum
+ //+++++++++++++++++ ------
+ //select start of original text and part of deleted text
+ aDocStat.Reset();
+ pTxtNode->CountWords(aDocStat, 17, 25);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uLong>(5), aDocStat.nChar);
}
//See https://bugs.libreoffice.org/show_bug.cgi?id=38983
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 40e3a58..214bbe5 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -2107,9 +2107,12 @@ void SwScriptInfo::selectRedLineDeleted(const SwTxtNode& rNode, MultiSelection &
{
const SwRangeRedline* pRed = rIDRA.GetRedlineTbl()[ nAct ];
- if ( pRed->Start()->nNode > rNode.GetIndex() )
+ if (pRed->Start()->nNode > rNode.GetIndex())
break;
+ if (pRed->GetType() != nsRedlineType_t::REDLINE_DELETE)
+ continue;
+
sal_Int32 nRedlStart;
sal_Int32 nRedlnEnd;
pRed->CalcStartEnd( rNode.GetIndex(), nRedlStart, nRedlnEnd );
diff --git a/sw/source/core/txtnode/modeltoviewhelper.cxx b/sw/source/core/txtnode/modeltoviewhelper.cxx
index bd1a3ae..875ea1e 100644
--- a/sw/source/core/txtnode/modeltoviewhelper.cxx
+++ b/sw/source/core/txtnode/modeltoviewhelper.cxx
@@ -94,7 +94,7 @@ ModelToViewHelper::ModelToViewHelper(const SwTxtNode &rNode, sal_uInt16 eMode)
if (eMode & HIDEINVISIBLE)
SwScriptInfo::selectHiddenTextProperty(rNode, aHiddenMulti);
- if (eMode & HIDEREDLINED)
+ if (eMode & HIDEDELETIONS)
SwScriptInfo::selectRedLineDeleted(rNode, aHiddenMulti);
std::vector<block> aBlocks;
@@ -203,43 +203,55 @@ ModelToViewHelper::ModelToViewHelper(const SwTxtNode &rNode, sal_uInt16 eMode)
}
}
+ //store the end of each range in the model and where that end of range
+ //maps to in the view
sal_Int32 nOffset = 0;
for (std::vector<block>::iterator i = aBlocks.begin(); i != aBlocks.end(); ++i)
{
+ const sal_Int32 nBlockLen = i->m_nLen;
+ if (!nBlockLen)
+ continue;
+ const sal_Int32 nBlockStart = i->m_nStart;
+ const sal_Int32 nBlockEnd = nBlockStart + nBlockLen;
+
if (!i->m_bVisible)
{
- const sal_Int32 nHiddenStart = i->m_nStart;
- const sal_Int32 nHiddenLen = i->m_nLen;
+ sal_Int32 const modelBlockPos(nBlockEnd);
+ sal_Int32 const viewBlockPos(nBlockStart + nOffset);
+ m_aMap.push_back(ConversionMapEntry(modelBlockPos, viewBlockPos, false));
- m_aRetText = m_aRetText.replaceAt( nOffset + nHiddenStart, nHiddenLen, OUString() );
- m_aMap.push_back( ConversionMapEntry( nHiddenStart, nOffset + nHiddenStart ) );
- nOffset -= nHiddenLen;
+ m_aRetText = m_aRetText.replaceAt(nOffset + nBlockStart, nBlockLen, OUString());
+ nOffset -= nBlockLen;
}
else
{
for (FieldResultSet::iterator j = i->m_aAttrs.begin(); j != i->m_aAttrs.end(); ++j)
{
- sal_Int32 const viewPos(nOffset + j->m_nFieldPos);
- m_aRetText = m_aRetText.replaceAt(viewPos, 1, j->m_sExpand);
- m_aMap.push_back( ConversionMapEntry(j->m_nFieldPos, viewPos) );
+ sal_Int32 const modelFieldPos(j->m_nFieldPos);
+ sal_Int32 const viewFieldPos(j->m_nFieldPos + nOffset);
+ m_aMap.push_back( ConversionMapEntry(modelFieldPos, viewFieldPos, true) );
+
+ m_aRetText = m_aRetText.replaceAt(viewFieldPos, 1, j->m_sExpand);
+ nOffset += j->m_sExpand.getLength() - 1;
+
switch (j->m_eType)
{
case FieldResult::FIELD:
- m_FieldPositions.push_back(viewPos);
+ m_FieldPositions.push_back(viewFieldPos);
break;
case FieldResult::FOOTNOTE:
- m_FootnotePositions.push_back(viewPos);
+ m_FootnotePositions.push_back(viewFieldPos);
break;
case FieldResult::NONE: /*ignore*/
break;
}
- nOffset += j->m_sExpand.getLength() - 1;
}
+
+ sal_Int32 const modelEndBlock(nBlockEnd);
+ sal_Int32 const viewFieldPos(nBlockEnd + nOffset);
+ m_aMap.push_back(ConversionMapEntry(modelEndBlock, viewFieldPos, true));
}
}
-
- if ( !m_aMap.empty() )
- m_aMap.push_back( ConversionMapEntry( rNodeText.getLength()+1, m_aRetText.getLength()+1 ) );
}
/** Converts a model position into a view position
@@ -248,15 +260,21 @@ sal_Int32 ModelToViewHelper::ConvertToViewPosition( sal_Int32 nModelPos ) const
{
// Search for entry after nPos:
ConversionMap::const_iterator aIter;
+
for ( aIter = m_aMap.begin(); aIter != m_aMap.end(); ++aIter )
{
- if ( (*aIter).first >= nModelPos )
+ if (aIter->m_nModelPos >= nModelPos)
{
- const sal_Int32 nPosModel = (*aIter).first;
- const sal_Int32 nPosExpand = (*aIter).second;
-
- const sal_Int32 nDistToNextModel = nPosModel - nModelPos;
- return nPosExpand - nDistToNextModel;
+ //if it's an invisible portion, map all contained positions
+ //to the anchor viewpos
+ if (!aIter->m_bVisible)
+ return aIter->m_nViewPos;
+
+ //if it's a visible portion, then the view position is the anchor
+ //viewpos - the offset of the input modelpos from the anchor
+ //modelpos
+ const sal_Int32 nOffsetFromEnd = aIter->m_nModelPos - nModelPos;
+ return aIter->m_nViewPos - nOffsetFromEnd;
}
}
@@ -274,10 +292,10 @@ ModelToViewHelper::ModelPosition ModelToViewHelper::ConvertToModelPosition( sal_
ConversionMap::const_iterator aIter;
for ( aIter = m_aMap.begin(); aIter != m_aMap.end(); ++aIter )
{
- if ( (*aIter).second > nViewPos )
+ if (aIter->m_nViewPos > nViewPos)
{
- const sal_Int32 nPosModel = (*aIter).first;
- const sal_Int32 nPosExpand = (*aIter).second;
+ const sal_Int32 nPosModel = aIter->m_nModelPos;
+ const sal_Int32 nPosExpand = aIter->m_nViewPos;
// If nViewPos is in front of first field, we are finished.
if ( aIter == m_aMap.begin() )
@@ -286,8 +304,8 @@ ModelToViewHelper::ModelPosition ModelToViewHelper::ConvertToModelPosition( sal_
--aIter;
// nPrevPosModel is the field position
- const sal_Int32 nPrevPosModel = (*aIter).first;
- const sal_Int32 nPrevPosExpand = (*aIter).second;
+ const sal_Int32 nPrevPosModel = aIter->m_nModelPos;
+ const sal_Int32 nPrevPosExpand = aIter->m_nViewPos;
const sal_Int32 nLengthModel = nPosModel - nPrevPosModel;
const sal_Int32 nLengthExpand = nPosExpand - nPrevPosExpand;
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index aa6f7d6..f9f19e2 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1986,7 +1986,7 @@ bool SwTxtNode::CountWords( SwDocStat& rStat,
}
// ConversionMap to expand fields, remove invisible and redline deleted text for scanner
- const ModelToViewHelper aConversionMap(*this, EXPANDFIELDS | EXPANDFOOTNOTE | HIDEINVISIBLE | HIDEREDLINED);
+ const ModelToViewHelper aConversionMap(*this, EXPANDFIELDS | EXPANDFOOTNOTE | HIDEINVISIBLE | HIDEDELETIONS);
OUString aExpandText = aConversionMap.getViewText();
if (aExpandText.isEmpty() && !bCountNumbering)
--
1.9.3

@ -0,0 +1,81 @@
From 9b3410961e52b4666a118158512e050462711fd0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Thu, 6 Nov 2014 09:56:49 +0000
Subject: [PATCH] Resolves: fdo#76581 copy-and-paste -> slideshow crash in
presenter console
crash started after...
commit 0218b0e2fa510d7acd7413dbedefd9ad50257f76
Date: Mon Jul 15 19:45:44 2013 +0300
fdo#65457 - Provide visual clues in presenter view.
Change-Id: I19d84800bd5924f2dcc9e5debcf18ef95577105c
---
sdext/source/presenter/PresenterController.cxx | 28 ++++++++++++++++++--------
1 file changed, 20 insertions(+), 8 deletions(-)
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx
index 43d60ac..6c64bd7 100644
--- a/sdext/source/presenter/PresenterController.cxx
+++ b/sdext/source/presenter/PresenterController.cxx
@@ -358,7 +358,7 @@ void PresenterController::UpdatePaneTitles (void)
sCurrentSlideName = sName;
}
}
- catch (beans::UnknownPropertyException&)
+ catch (const beans::UnknownPropertyException&)
{
}
}
@@ -585,10 +585,16 @@ bool PresenterController::HasTransition (Reference<drawing::XDrawPage>& rxPage)
if( rxPage.is() )
{
Reference<beans::XPropertySet> xSlidePropertySet (rxPage, UNO_QUERY);
- xSlidePropertySet->getPropertyValue("TransitionType") >>= aTransitionType;
- if( aTransitionType > 0 )
+ try
+ {
+ xSlidePropertySet->getPropertyValue("TransitionType") >>= aTransitionType;
+ if (aTransitionType > 0)
+ {
+ bTransition = true;
+ }
+ }
+ catch (const beans::UnknownPropertyException&)
{
- bTransition = true;
}
}
return bTransition;
@@ -597,8 +603,6 @@ bool PresenterController::HasTransition (Reference<drawing::XDrawPage>& rxPage)
bool PresenterController::HasCustomAnimation (Reference<drawing::XDrawPage>& rxPage)
{
bool bCustomAnimation = false;
- presentation::AnimationEffect aEffect = presentation::AnimationEffect_NONE;
- presentation::AnimationEffect aTextEffect = presentation::AnimationEffect_NONE;
if( rxPage.is() )
{
sal_uInt32 i, nCount = rxPage->getCount();
@@ -606,8 +610,16 @@ bool PresenterController::HasCustomAnimation (Reference<drawing::XDrawPage>& rxP
{
Reference<drawing::XShape> xShape(rxPage->getByIndex(i), UNO_QUERY);
Reference<beans::XPropertySet> xShapePropertySet(xShape, UNO_QUERY);
- xShapePropertySet->getPropertyValue("Effect") >>= aEffect;
- xShapePropertySet->getPropertyValue("TextEffect") >>= aTextEffect;
+ presentation::AnimationEffect aEffect = presentation::AnimationEffect_NONE;
+ presentation::AnimationEffect aTextEffect = presentation::AnimationEffect_NONE;
+ try
+ {
+ xShapePropertySet->getPropertyValue("Effect") >>= aEffect;
+ xShapePropertySet->getPropertyValue("TextEffect") >>= aTextEffect;
+ }
+ catch (const beans::UnknownPropertyException&)
+ {
+ }
if( aEffect != presentation::AnimationEffect_NONE ||
aTextEffect != presentation::AnimationEffect_NONE )
{
--
1.9.3

@ -0,0 +1,58 @@
From 6b379995697f8ac25f8f3871c9c91e8dc009afa8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Fri, 24 Oct 2014 15:10:15 +0100
Subject: [PATCH] Resolves: fdo#84729 buffer cache grows to over 9000 unused
entries
regression from
commit a5351434fbea1126961f5dbaa986e7c9e686c24e
Author: tsahi glik <tsahi.glik@cloudon.com>
Date: Thu Jan 16 12:51:44 2014 -0800
fix rendering issues in iOS with aqua
because now the cache just fills up because nothing will have
a depth of "0" and a new entry is created every time.
0 could be seen to mean "whatever is a good non-1bit depth" or auto or
something. (Do the uses of "8" really mean 8)
0 passed to new VirtualDevice under Linux/X ends up using the depth of the
outputdev, so here set nBits to that value to start with and the problem
goes away
Change-Id: I4390d6f7edef9dc7430cc77e3518dc751a5f479d
(cherry picked from commit e25a020d59b019893d2e04ac61e4ed25ef0a6e61)
Reviewed-on: https://gerrit.libreoffice.org/12087
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
---
drawinglayer/source/processor2d/vclhelperbufferdevice.cxx | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
index 2f98e71..d812d93 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
@@ -85,6 +85,9 @@ namespace
::osl::MutexGuard aGuard(m_aMutex);
VirtualDevice* pRetval = 0;
+ if (nBits == 0)
+ nBits = rOutDev.GetBitCount();
+
if(!maFreeBuffers.empty())
{
bool bOkay(false);
@@ -183,6 +186,8 @@ namespace
maUsedBuffers.erase(aUsedFound);
maFreeBuffers.push_back(&rDevice);
+ SAL_WARN_IF(maFreeBuffers.size() > 1000, "drawinglayer", "excessive cached buffers, "
+ << maFreeBuffers.size() << " entries!");
Start();
}
--
1.9.3

@ -0,0 +1,168 @@
From fb2ed3e17623476c1b772826f0ed4468350baf59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Mon, 20 Oct 2014 14:22:40 +0100
Subject: [PATCH] Resolves: fdo#84885 chart wizard dialog cut off
Change-Id: Ie24687cd1c54b1fed04745c83f507c17a5574175
(cherry picked from commit f9c242674094eba7ac19bd279f611dba0a8e5571)
Reviewed-on: https://gerrit.libreoffice.org/12052
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
---
chart2/uiconfig/ui/tp_DataSource.ui | 62 +++++++++++++++++++++----------------
1 file changed, 35 insertions(+), 27 deletions(-)
diff --git a/chart2/uiconfig/ui/tp_DataSource.ui b/chart2/uiconfig/ui/tp_DataSource.ui
index f7bed1d..69e7262 100644
--- a/chart2/uiconfig/ui/tp_DataSource.ui
+++ b/chart2/uiconfig/ui/tp_DataSource.ui
@@ -167,12 +167,13 @@
</packing>
</child>
<child>
- <object class="GtkBox" id="box3">
+ <object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="valign">start</property>
<property name="hexpand">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
+ <property name="vexpand">True</property>
+ <property name="row_spacing">6</property>
<child>
<object class="GtkLabel" id="FT_ROLE">
<property name="visible">True</property>
@@ -183,9 +184,10 @@
<property name="mnemonic_widget">LB_ROLE:border</property>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -193,16 +195,18 @@
<property name="width_request">440</property>
<property name="height_request">100</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
<property name="hexpand">True</property>
+ <property name="vexpand">True</property>
<child internal-child="selection">
- <object class="GtkTreeSelection" id="Tab List-selection1"/>
+ <object class="GtkTreeSelection" id="Tab List-selection"/>
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -215,9 +219,10 @@
<property name="mnemonic_widget">EDT_RANGE</property>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -229,7 +234,7 @@
<child>
<object class="GtkEntry" id="EDT_RANGE">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="invisible_char">•</property>
</object>
@@ -243,7 +248,7 @@
<object class="GtkButton" id="IMB_RANGE_MAIN">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">imageIMB_RANGE_MAIN</property>
</object>
@@ -255,9 +260,10 @@
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">3</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -296,9 +302,10 @@
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">4</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
@@ -310,7 +317,7 @@
<child>
<object class="GtkEntry" id="EDT_CATEGORIES">
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="invisible_char">•</property>
</object>
@@ -324,7 +331,7 @@
<object class="GtkButton" id="IMB_RANGE_CAT">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
+ <property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">imageIMB_RANGE_CAT</property>
</object>
@@ -336,9 +343,10 @@
</child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">5</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">5</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
</object>
--
1.9.3

@ -0,0 +1,240 @@
From cff2323e10161d3cbbdba088e8ec74aee3839c62 Mon Sep 17 00:00:00 2001
From: Michael Stahl <mstahl@redhat.com>
Date: Thu, 30 Oct 2014 15:12:33 +0100
Subject: [PATCH] fdo#79602: sw: add new compatibiltiy flag
PropLineSpacingShrinksFirstLine
This is enabled by default, to get the new formatting where the first
line of a paragraph is shrunk if a proportional line spacing < 100% is
applied; existing OOo documents get the previous (before LO 3.3)
formatting. Since the formatting in LO releases is broken anyway, it
does not matter much which way documents written by old LO get
formatted.
(cherry picked from commit 9605763e3dc8c85137787c77c31e8639553a35ed)
Conflicts:
sw/source/filter/ww8/ww8par.cxx
Change-Id: I0952f568a933c137bd03070759989cac3517d8b9
Reviewed-on: https://gerrit.libreoffice.org/12157
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
---
sw/inc/IDocumentSettingAccess.hxx | 3 ++-
sw/source/core/doc/DocumentSettingManager.cxx | 6 ++++++
sw/source/core/inc/DocumentSettingManager.hxx | 1 +
sw/source/core/text/itrform2.cxx | 3 ++-
sw/source/core/uibase/uno/SwXDocumentSettings.cxx | 21 ++++++++++++++++++++-
sw/source/filter/ww8/ww8par.cxx | 1 +
sw/source/filter/xml/xmlimp.cxx | 10 ++++++++++
writerfilter/source/filter/ImportFilter.cxx | 1 +
8 files changed, 43 insertions(+), 3 deletions(-)
diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx
index 4e94a1e..a67d469 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -79,6 +79,7 @@ namespace com { namespace sun { namespace star { namespace i18n { struct Forbidd
TAB_OVER_MARGIN,
// MS Word still wraps text around objects with less space than LO would.
SURROUND_TEXT_WRAP_SMALL,
+ PROP_LINE_SPACING_SHRINKS_FIRST_LINE,
// COMPATIBILITY FLAGS END
BROWSE_MODE,
@@ -93,7 +94,7 @@ namespace com { namespace sun { namespace star { namespace i18n { struct Forbidd
FLOATTABLE_NOMARGINS,
EMBED_FONTS,
EMBED_SYSTEM_FONTS,
- APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING
+ APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING,
};
public:
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx
index 68ff997..184b242 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -75,6 +75,7 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc)
mbBackgroundParaOverDrawings(false),
mbTabOverMargin(false),
mbSurroundTextWrapSmall(false),
+ mbPropLineSpacingShrinksFirstLine(true),
mApplyParagraphMarkFormatToNumbering(false),
mbLastBrowseMode( false )
@@ -149,6 +150,7 @@ bool sw::DocumentSettingManager::get(/*[in]*/ DocumentSettingId id) const
case BACKGROUND_PARA_OVER_DRAWINGS: return mbBackgroundParaOverDrawings;
case TAB_OVER_MARGIN: return mbTabOverMargin;
case SURROUND_TEXT_WRAP_SMALL: return mbSurroundTextWrapSmall;
+ case PROP_LINE_SPACING_SHRINKS_FIRST_LINE: return mbPropLineSpacingShrinksFirstLine;
case BROWSE_MODE: return mbLastBrowseMode; // Attention: normally the SwViewShell has to be asked!
case HTML_MODE: return mbHTMLMode;
@@ -311,6 +313,10 @@ void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ boo
mbSurroundTextWrapSmall = value;
break;
+ case PROP_LINE_SPACING_SHRINKS_FIRST_LINE:
+ mbPropLineSpacingShrinksFirstLine = value;
+ break;
+
// COMPATIBILITY FLAGS END
case BROWSE_MODE: //can be used temporary (load/save) when no SwViewShell is available
diff --git a/sw/source/core/inc/DocumentSettingManager.hxx b/sw/source/core/inc/DocumentSettingManager.hxx
index 2e8ab4b..3226278 100644
--- a/sw/source/core/inc/DocumentSettingManager.hxx
+++ b/sw/source/core/inc/DocumentSettingManager.hxx
@@ -85,6 +85,7 @@ class DocumentSettingManager :
bool mbBackgroundParaOverDrawings;
bool mbTabOverMargin;
bool mbSurroundTextWrapSmall;
+ bool mbPropLineSpacingShrinksFirstLine; // fdo#79602
bool mApplyParagraphMarkFormatToNumbering;
bool mbLastBrowseMode : 1;
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 4880013..9dfa8ad 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1743,7 +1743,8 @@ void SwTxtFormatter::CalcRealHeight( bool bNewLine )
case SVX_LINE_SPACE_AUTO:
// shrink first line of paragraph too on spacing < 100%
if (IsParaLine() &&
- pSpace->GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP)
+ pSpace->GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP
+ && GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::PROP_LINE_SPACING_SHRINKS_FIRST_LINE))
{
long nTmp = pSpace->GetPropLineSpace();
// Word will render < 50% too but it's just not readable
diff --git a/sw/source/core/uibase/uno/SwXDocumentSettings.cxx b/sw/source/core/uibase/uno/SwXDocumentSettings.cxx
index 6ab7e54..fb64d02 100644
--- a/sw/source/core/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/core/uibase/uno/SwXDocumentSettings.cxx
@@ -123,7 +123,8 @@ enum SwDocumentSettingsPropertyHandles
HANDLE_EMBED_SYSTEM_FONTS,
HANDLE_TAB_OVER_MARGIN,
HANDLE_SURROUND_TEXT_WRAP_SMALL,
- HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING
+ HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING,
+ HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE,
};
static MasterPropertySetInfo * lcl_createSettingsInfo()
@@ -195,6 +196,7 @@ static MasterPropertySetInfo * lcl_createSettingsInfo()
{ OUString("TabOverMargin"), HANDLE_TAB_OVER_MARGIN, cppu::UnoType<bool>::get(), 0, 0},
{ OUString("SurroundTextWrapSmall"), HANDLE_SURROUND_TEXT_WRAP_SMALL, cppu::UnoType<bool>::get(), 0, 0},
{ OUString("ApplyParagraphMarkFormatToNumbering"), HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, cppu::UnoType<bool>::get(), 0, 0},
+ { OUString("PropLineSpacingShrinksFirstLine"), HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE, cppu::UnoType<bool>::get(), 0, 0},
/*
* As OS said, we don't have a view when we need to set this, so I have to
* find another solution before adding them to this property set - MTG
@@ -802,6 +804,16 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
mpDoc->set(IDocumentSettingAccess::APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, bTmp);
}
break;
+ case HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE:
+ {
+ bool bTmp;
+ if (rValue >>= bTmp)
+ {
+ mpDoc->set(
+ IDocumentSettingAccess::PROP_LINE_SPACING_SHRINKS_FIRST_LINE, bTmp);
+ }
+ }
+ break;
default:
throw UnknownPropertyException();
}
@@ -1230,6 +1242,13 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
rValue.setValue( &bTmp, ::getBooleanCppuType() );
}
break;
+ case HANDLE_PROP_LINE_SPACING_SHRINKS_FIRST_LINE:
+ {
+ sal_Bool const bTmp(mpDoc->get(
+ IDocumentSettingAccess::PROP_LINE_SPACING_SHRINKS_FIRST_LINE));
+ rValue <<= bTmp;
+ }
+ break;
default:
throw UnknownPropertyException();
}
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 0bf4265..cb2a23f 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1927,6 +1927,7 @@ void SwWW8ImplReader::ImportDop()
rDoc.set(IDocumentSettingAccess::CLIPPED_PICTURES, true);
rDoc.set(IDocumentSettingAccess::TAB_OVER_MARGIN, true);
rDoc.set(IDocumentSettingAccess::SURROUND_TEXT_WRAP_SMALL, true);
+ rDoc.set(IDocumentSettingAccess::PROP_LINE_SPACING_SHRINKS_FIRST_LINE, true);
// COMPATIBILITY FLAGS END
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 3af249c..b04cfbd 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1055,6 +1055,9 @@ void SwXMLImport::SetViewSettings(const Sequence < PropertyValue > & aViewProps)
GetTextImport()->SetShowChanges( bShowRedlineChanges );
}
+// Note: this will be called only if there are OOo elements in settings.xml.
+// So if a setting is missing there we can assume that it was written
+// by an OOo/LO version that is older than the introduction of the setting!
void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aConfigProps)
{
// this method will modify the document directly -> lock SolarMutex
@@ -1104,6 +1107,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
aSet.insert("ClippedPictures");
aSet.insert("BackgroundParaOverDrawings");
aSet.insert("TabOverMargin");
+ aSet.insert("PropLineSpacingShrinksFirstLine");
sal_Int32 nCount = aConfigProps.getLength();
const PropertyValue* pValues = aConfigProps.getConstArray();
@@ -1138,6 +1142,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
bool bClippedPictures = false;
bool bBackgroundParaOverDrawings = false;
bool bTabOverMargin = false;
+ bool bPropLineSpacingShrinksFirstLine = false;
const PropertyValue* currentDatabaseDataSource = NULL;
const PropertyValue* currentDatabaseCommand = NULL;
@@ -1225,6 +1230,8 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
bBackgroundParaOverDrawings = true;
else if ( pValues->Name == "TabOverMargin" )
bTabOverMargin = true;
+ else if ( pValues->Name == "PropLineSpacingShrinksFirstLine" )
+ bPropLineSpacingShrinksFirstLine = true;
}
catch( Exception& )
{
@@ -1400,6 +1407,9 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
if ( !bTabOverMargin )
xProps->setPropertyValue("TabOverMargin", makeAny( false ) );
+ if (!bPropLineSpacingShrinksFirstLine)
+ xProps->setPropertyValue("PropLineSpacingShrinksFirstLine", makeAny(false));
+
SwDoc *pDoc = getDoc();
SfxPrinter *pPrinter = pDoc->getPrinter( false );
if( pPrinter )
diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx
index 277f2da..51a6d55 100644
--- a/writerfilter/source/filter/ImportFilter.cxx
+++ b/writerfilter/source/filter/ImportFilter.cxx
@@ -225,6 +225,7 @@ void WriterFilter::setTargetDocument( const uno::Reference< lang::XComponent >&
xSettings->setPropertyValue( "ClippedPictures", uno::makeAny( sal_True ) );
xSettings->setPropertyValue( "BackgroundParaOverDrawings", uno::makeAny( sal_True ) );
xSettings->setPropertyValue( "TabOverMargin", uno::makeAny( sal_True ) );
+ xSettings->setPropertyValue("PropLineSpacingShrinksFirstLine", uno::makeAny(sal_True));
}
void WriterFilter::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc )
--
1.9.3

@ -0,0 +1,81 @@
From 7ca9c060155b79a037861a972843a70b8a518c4f Mon Sep 17 00:00:00 2001
From: Michael Stahl <mstahl@redhat.com>
Date: Wed, 29 Oct 2014 23:50:21 +0100
Subject: [PATCH] fdo#79602: sw: fix text formatting of proportional line space
< 100%
SwTxtFormatter::CalcRealHeight(): Apply the special treatment of < 100%
line space shrinking the Height() of the line only to the first line
in a paragraph; the subsequent ones are shrunk again (to the square of
the desired proportion) 30 lines later.
Also set the Ascent of the line, as the wrong base-line causes the lower
part of the line to be clipped.
(regression from 42532d42bfcdb12df86376cda009e8e315a82153)
(cherry picked from commit 4e223fab04279c3583689e69fa1342966e81de36)
Conflicts:
sw/source/core/text/itrform2.cxx
Change-Id: I0424396263293deaa318c80eedc2237cdb01b22b
Reviewed-on: https://gerrit.libreoffice.org/12156
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
---
sw/source/core/text/itrform2.cxx | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 2738b9b..4880013 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1741,24 +1741,30 @@ void SwTxtFormatter::CalcRealHeight( bool bNewLine )
switch( pSpace->GetLineSpaceRule() )
{
case SVX_LINE_SPACE_AUTO:
- if (pSpace->GetInterLineSpaceRule()==SVX_INTER_LINE_SPACE_PROP) {
+ // shrink first line of paragraph too on spacing < 100%
+ if (IsParaLine() &&
+ pSpace->GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP)
+ {
long nTmp = pSpace->GetPropLineSpace();
+ // Word will render < 50% too but it's just not readable
+ if( nTmp < 50 )
+ nTmp = nTmp ? 50 : 100;
if (nTmp<100) { // code adaped from fixed line height
nTmp *= nLineHeight;
nTmp /= 100;
if( !nTmp )
++nTmp;
nLineHeight = (KSHORT)nTmp;
- /*
- //@TODO figure out how WW maps ascent and descent
- //in case of prop line spacing <100%
KSHORT nAsc = ( 4 * nLineHeight ) / 5; // 80%
+#if 0
+ // could do clipping here (like Word does)
+ // but at 0.5 its unreadable either way...
if( nAsc < pCurr->GetAscent() ||
nLineHeight - nAsc < pCurr->Height() -
pCurr->GetAscent() )
pCurr->SetClipping( true );
+#endif
pCurr->SetAscent( nAsc );
- */
pCurr->Height( nLineHeight );
pInf->GetParaPortion()->SetFixLineHeight();
}
@@ -1784,6 +1790,8 @@ void SwTxtFormatter::CalcRealHeight( bool bNewLine )
break;
default: OSL_FAIL( ": unknown LineSpaceRule" );
}
+ // Note: for the _first_ line the line spacing of the previous
+ // paragraph is applied in SwFlowFrm::CalcUpperSpace()
if( !IsParaLine() )
switch( pSpace->GetInterLineSpaceRule() )
{
--
1.9.3

@ -0,0 +1,52 @@
From fa08c98c485e0de34082f3d66c5e1b6609268be1 Mon Sep 17 00:00:00 2001
From: Kohei Yoshida <kohei.yoshida@collabora.com>
Date: Mon, 27 Oct 2014 08:52:38 -0700
Subject: [PATCH] fdo#85215: Ensure that formula broadcasting works after sort.
When the reference update on sort is turned off.
Change-Id: I547dd1525a638dd447fe331e22583af4a7947308
(cherry picked from commit 1eb82c78a223d9a0b2bb5c3f5c129c1ee8bdf303)
Reviewed-on: https://gerrit.libreoffice.org/12113
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
---
sc/source/core/data/table3.cxx | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 05285d8..f7589dd 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -803,6 +803,15 @@ void ScTable::SortReorderByRow(
ScSortInfoArray::RowsType* pRows = pArray->GetDataRows();
assert(pRows); // In sort-by-row mode we must have data rows already populated.
+ if (!pArray->IsUpdateRefs())
+ {
+ // When the update ref mode is disabled, we need to detach all formula
+ // cells in the sorted range before reordering, and re-start them
+ // afterward.
+ sc::EndListeningContext aCxt(*pDocument);
+ DetachFormulaCells(aCxt, nCol1, nRow1, nCol2, nRow2);
+ }
+
// Split formula groups at the sort range boundaries (if applicable).
std::vector<SCROW> aRowBounds;
aRowBounds.reserve(2);
@@ -1081,6 +1090,12 @@ void ScTable::SortReorderByRow(
// Re-group columns in the sorted range too.
for (SCCOL i = nCol1; i <= nCol2; ++i)
aCol[i].RegroupFormulaCells();
+
+ if (!pArray->IsUpdateRefs())
+ {
+ sc::StartListeningContext aCxt(*pDocument);
+ AttachFormulaCells(aCxt, nCol1, nRow1, nCol2, nRow2);
+ }
}
short ScTable::CompareCell(
--
1.9.3

@ -0,0 +1,36 @@
From 0bab8aee77cfc2ffdbc6d3ef6a869284bc12dff4 Mon Sep 17 00:00:00 2001
From: Muthu Subramanian <muthu.subramanian.karunanidhi@ericsson.com>
Date: Thu, 23 Oct 2014 20:30:26 +0530
Subject: [PATCH] fdo#85247: copy and paste of a slide results in a blue slide
in presentation mode.
Seems like "Default" is handled specially or probably
the copy-buffer is broken
This now checks for slide 'type' as well, before cosidering it a duplicate
Change-Id: If8c472bcefb54cee72e7411f92a76b4e2db2b6ce
---
sd/source/core/drawdoc3.cxx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index e379ed0..d3e92f9 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -106,9 +106,11 @@ void InsertBookmarkAsPage_FindDuplicateLayouts::operator()( SdDrawDocument& rDoc
OUString aTest(aFullTest);
- if (aTest == aLayout)
+ if (aTest == aLayout && pBMMPage->GetPageKind() == pTestPage->GetPageKind())
{
- if( bRenameDuplicates && pTestPage->getHash() != pBMMPage->getHash() )
+ // Ignore Layouts with "Default" these seem to be special - in the sense that there are lot of assumption all over Impress
+ // about this
+ if( bRenameDuplicates && aTest != OUString( SdResId( STR_LAYOUT_DEFAULT_NAME ) ) && pTestPage->getHash() != pBMMPage->getHash() )
{
pBookmarkDoc->RenameLayoutTemplate( pBMMPage->GetLayoutName(), OUString(pBMMPage->GetName())+=OUString("_") );
aLayout = pBMMPage->GetName();
--
1.9.3

@ -0,0 +1,110 @@
From bc38612d349b9efd877dec23f3e68a3f7b945cec Mon Sep 17 00:00:00 2001
From: Kohei Yoshida <kohei.yoshida@collabora.com>
Date: Mon, 27 Oct 2014 07:32:32 -0700
Subject: [PATCH] fdo#85282: Correct adjustment of range reference on delete &
shift.
Change-Id: I6e01c160f77599dfa4a2e55b60e23d256184c822
(cherry picked from commit c3c16d5b74fb5707691283538a969a03c2f918b0)
Reviewed-on: https://gerrit.libreoffice.org/12111
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
---
sc/source/core/tool/token.cxx | 67 +++++++++++++++++++++++++++++++++++++++----
1 file changed, 61 insertions(+), 6 deletions(-)
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 84c8ccc..b0a495a 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2546,6 +2546,9 @@ void setRefDeleted( ScComplexRefData& rRef, const sc::RefUpdateContext& rCxt )
bool shrinkRange( const sc::RefUpdateContext& rCxt, ScRange& rRefRange, const ScRange& rDeletedRange )
{
+ if (!rDeletedRange.Intersects(rRefRange))
+ return false;
+
if (rCxt.mnColDelta < 0)
{
// Shifting left.
@@ -2553,9 +2556,35 @@ bool shrinkRange( const sc::RefUpdateContext& rCxt, ScRange& rRefRange, const Sc
// Deleted range is only partially overlapping in vertical direction. Bail out.
return false;
- // Move the last column position to the left.
- SCCOL nDelta = rDeletedRange.aStart.Col() - rDeletedRange.aEnd.Col() - 1;
- rRefRange.aEnd.IncCol(nDelta);
+ if (rDeletedRange.aStart.Col() <= rRefRange.aStart.Col())
+ {
+ if (rRefRange.aEnd.Col() <= rDeletedRange.aEnd.Col())
+ {
+ // Reference is entirely deleted.
+ rRefRange.SetInvalid();
+ }
+ else
+ {
+ // The reference range is truncated on the left.
+ SCCOL nOffset = rDeletedRange.aStart.Col() - rRefRange.aStart.Col();
+ SCCOL nDelta = rRefRange.aStart.Col() - rDeletedRange.aEnd.Col() - 1;
+ rRefRange.aStart.IncCol(nOffset);
+ rRefRange.aEnd.IncCol(nDelta+nOffset);
+ }
+ }
+ else if (rDeletedRange.aEnd.Col() < rRefRange.aEnd.Col())
+ {
+ // Reference is deleted in the middle. Move the last column
+ // position to the left.
+ SCCOL nDelta = rDeletedRange.aStart.Col() - rDeletedRange.aEnd.Col() - 1;
+ rRefRange.aEnd.IncCol(nDelta);
+ }
+ else
+ {
+ // The reference range is truncated on the right.
+ SCCOL nDelta = rDeletedRange.aStart.Col() - rRefRange.aEnd.Col() - 1;
+ rRefRange.aEnd.IncCol(nDelta);
+ }
return true;
}
else if (rCxt.mnRowDelta < 0)
@@ -2566,9 +2595,35 @@ bool shrinkRange( const sc::RefUpdateContext& rCxt, ScRange& rRefRange, const Sc
// Deleted range is only partially overlapping in horizontal direction. Bail out.
return false;
- // Move the last row position up.
- SCROW nDelta = rDeletedRange.aStart.Row() - rDeletedRange.aEnd.Row() - 1;
- rRefRange.aEnd.IncRow(nDelta);
+ if (rDeletedRange.aStart.Row() <= rRefRange.aStart.Row())
+ {
+ if (rRefRange.aEnd.Row() <= rDeletedRange.aEnd.Row())
+ {
+ // Reference is entirely deleted.
+ rRefRange.SetInvalid();
+ }
+ else
+ {
+ // The reference range is truncated on the top.
+ SCCOL nOffset = rDeletedRange.aStart.Row() - rRefRange.aStart.Row();
+ SCCOL nDelta = rRefRange.aStart.Row() - rDeletedRange.aEnd.Row() - 1;
+ rRefRange.aStart.IncRow(nOffset);
+ rRefRange.aEnd.IncRow(nDelta+nOffset);
+ }
+ }
+ else if (rDeletedRange.aEnd.Row() < rRefRange.aEnd.Row())
+ {
+ // Reference is deleted in the middle. Move the last row
+ // position upward.
+ SCCOL nDelta = rDeletedRange.aStart.Row() - rDeletedRange.aEnd.Row() - 1;
+ rRefRange.aEnd.IncRow(nDelta);
+ }
+ else
+ {
+ // The reference range is truncated on the bottom.
+ SCCOL nDelta = rDeletedRange.aStart.Row() - rRefRange.aEnd.Row() - 1;
+ rRefRange.aEnd.IncRow(nDelta);
+ }
return true;
}
--
1.9.3

@ -46,7 +46,7 @@ Summary: Free Software Productivity Suite
Name: libreoffice
Epoch: 1
Version: %{libo_version}.2
Release: 2%{?libo_prerelease}%{?dist}
Release: 3%{?libo_prerelease}%{?dist}
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0 and CC0
Group: Applications/Productivity
URL: http://www.libreoffice.org/
@ -332,6 +332,16 @@ Patch34: 0001-libgcrypt-and-gnutls-are-only-used-by-our-internal-e.patch
Patch35: 0001-allow-to-build-with-system-opencollada.patch
Patch36: 0001-Resolves-rhbz-1146169-a11y-frames-label-dies-before-.patch
Patch37: 0001-Resolves-fdo-37559-revert-adding-extra-dummy-polygon.patch
Patch38: 0001-Resolves-fdo-76581-copy-and-paste-slideshow-crash-in.patch
Patch39: 0001-Resolves-fdo-68347-fix-word-count-with-recorded-chan.patch
Patch40: 0001-fdo-85215-Ensure-that-formula-broadcasting-works-aft.patch
Patch41: 0001-fdo-85282-Correct-adjustment-of-range-reference-on-d.patch
Patch42: 0001-fdo-79602-sw-fix-text-formatting-of-proportional-lin.patch
Patch43: 0001-fdo-79602-sw-add-new-compatibiltiy-flag-PropLineSpac.patch
Patch44: 0001-Resolves-fdo-84729-buffer-cache-grows-to-over-9000-u.patch
Patch45: 0001-Resolves-fdo-84885-chart-wizard-dialog-cut-off.patch
Patch46: 0001-Resolves-fdo-62682-crash-on-second-export-of-svg.patch
Patch47: 0001-fdo-85247-copy-and-paste-of-a-slide-results-in-a-blu.patch
%define instdir %{_libdir}
%define baseinstdir %{instdir}/libreoffice
@ -2298,6 +2308,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
%endif
%changelog
* Thu Nov 06 2014 Caolán McNamara <caolanm@redhat.com> - 1:4.3.3.2-3-UNBUILT
- Resolves: fdo#76581 copy-and-paste -> slideshow crash in presenter console
* Wed Nov 05 2014 Caolán McNamara <caolanm@redhat.com> - 1:4.3.3.2-2
- Resolves: fdo#37559 revert adding extra dummy polygons

Loading…
Cancel
Save