[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.1' - 3 commits - configmgr/source cppcanvas/source sc/source
Matúš Kukan
matus.kukan at collabora.com
Sun Dec 8 12:33:15 PST 2013
configmgr/source/access.cxx | 9 +++++----
cppcanvas/source/inc/implrenderer.hxx | 2 +-
cppcanvas/source/mtfrenderer/emfplus.cxx | 23 ++++++++++++++++++++---
sc/source/ui/docshell/docfunc.cxx | 18 ++++++++++++++++++
4 files changed, 44 insertions(+), 8 deletions(-)
New commits:
commit c0eb9567267d67e6cbe1d8205330a2d0bc7a1edb
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Fri Dec 6 14:40:50 2013 +0100
EMF+: Fill line cap object if EmfPlusCustomLineCapDataFillPath is set.
Change-Id: I7b53a8f18e1fb24b1ae0322bdf0980e431a0725f
(cherry picked from commit 131f3230d98f24faf57d9404e333cb1fb183345b)
Reviewed-on: https://gerrit.libreoffice.org/6960
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx
index d602945..a6f86e0 100644
--- a/cppcanvas/source/inc/implrenderer.hxx
+++ b/cppcanvas/source/inc/implrenderer.hxx
@@ -284,7 +284,7 @@ static float GetSwapFloat( SvStream& rSt )
/// Render LineCap, like the start or end arrow of a polygon.
/// @return how much we should shorten the original polygon.
double EMFPPlusDrawLineCap(const ::basegfx::B2DPolygon& rPolygon, double fPolyLength,
- const ::basegfx::B2DPolyPolygon& rLineCap, bool bStart,
+ const ::basegfx::B2DPolyPolygon& rLineCap, bool isFilled, bool bStart,
const com::sun::star::rendering::StrokeAttributes& rAttributes,
const ActionFactoryParameters& rParms, OutDevState& rState);
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index a8fca09..434ecd0 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -626,6 +626,7 @@ namespace cppcanvas
sal_uInt32 strokeStartCap, strokeEndCap, strokeJoin;
float miterLimit;
basegfx::B2DPolyPolygon polygon;
+ bool mbIsFilled;
public:
EMFPCustomLineCap() : EMFPObject()
@@ -652,7 +653,7 @@ namespace cppcanvas
aAttributes.MiterLimit = miterLimit;
}
- void ReadPath(SvStream& s, ImplRenderer& rR, bool bClosed)
+ void ReadPath(SvStream& s, ImplRenderer& rR, bool bFill)
{
sal_Int32 pathLength;
s >> pathLength;
@@ -669,7 +670,7 @@ namespace cppcanvas
path.Read(s, pathFlags, rR);
polygon = path.GetPolygon(rR, false);
- polygon.setClosed(bClosed);
+ mbIsFilled = bFill;
// transformation to convert the path to what LibreOffice
// expects
@@ -1321,7 +1322,7 @@ namespace cppcanvas
}
double ImplRenderer::EMFPPlusDrawLineCap(const ::basegfx::B2DPolygon& rPolygon, double fPolyLength,
- const ::basegfx::B2DPolyPolygon& rLineCap, bool bStart, const rendering::StrokeAttributes& rAttributes,
+ const ::basegfx::B2DPolyPolygon& rLineCap, bool bIsFilled, bool bStart, const rendering::StrokeAttributes& rAttributes,
const ActionFactoryParameters& rParms, OutDevState& rState)
{
if (!rLineCap.count())
@@ -1350,6 +1351,20 @@ namespace cppcanvas
rParms.mrCurrActionIndex += pAction->getActionCount()-1;
}
+ if (bIsFilled)
+ {
+ bool bWasFillColorSet = rState.isFillColorSet;
+ rState.isFillColorSet = true;
+ rState.fillColor = rState.lineColor;
+ ActionSharedPtr pAction2(internal::PolyPolyActionFactory::createPolyPolyAction(aArrow, rParms.mrCanvas, rState));
+ if (pAction2)
+ {
+ maActions.push_back(MtfAction(pAction2, rParms.mrCurrActionIndex));
+ rParms.mrCurrActionIndex += pAction2->getActionCount()-1;
+ }
+ rState.isFillColorSet = bWasFillColorSet;
+ }
+
return rAttributes.StrokeWidth;
}
@@ -1404,6 +1419,7 @@ namespace cppcanvas
pen->customStartCap->SetAttributes(aAttributes);
fStart = EMFPPlusDrawLineCap(aPolygon, fPolyLength, pen->customStartCap->polygon,
+ pen->customStartCap->mbIsFilled,
true, aAttributes, rParms, rState);
}
@@ -1414,6 +1430,7 @@ namespace cppcanvas
pen->customEndCap->SetAttributes(aAttributes);
fEnd = EMFPPlusDrawLineCap(aPolygon, fPolyLength, pen->customEndCap->polygon,
+ pen->customEndCap->mbIsFilled,
false, aAttributes, rParms, rState);
}
commit 19bdb1d4138f9b35894e0bab3d1cb3f99b4c696b
Author: Eike Rathke <erack at redhat.com>
Date: Fri Dec 6 22:58:25 2013 +0100
resolved fdo#66564 calculate formula cell once if AutoCalc disabled
Was lost with 2ce72093cdc68e60fb06ddd4358e0bc7fc8c63a9 and previous
restructuring.
(cherry picked from commit 2212051e792cb5f51f4191afe83c85fc3730a087)
Backported.
Change-Id: Ie4c8bdb287b56448406c873840c26ec4759de375
Reviewed-on: https://gerrit.libreoffice.org/6964
Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>
Tested-by: Kohei Yoshida <libreoffice at kohei.us>
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 61786e2..b922508 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -948,6 +948,24 @@ bool ScDocFunc::SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, boo
pDoc->SetFormulaCell(rPos, xCell.release());
+ // For performance reasons API calls may disable calculation while
+ // operating and recalculate once when done. If through user interaction
+ // and AutoCalc is disabled, calculate the formula (without its
+ // dependencies) once so the result matches the current document's content.
+ if (bInteraction && !pDoc->GetAutoCalc() && pCell)
+ {
+ // ScDocument/ScTable::SetFormulaCell() may have deleted pCell if
+ // position address was invalid, so check here again. This is
+ // backported code, new code handles that smarter..
+ if (rPos.Tab() < pDoc->GetTableCount() && ValidColRow( rPos.Col(), rPos.Row()))
+ {
+ // calculate just the cell once and set Dirty again
+ pCell->Interpret();
+ pCell->SetDirtyVar();
+ pDoc->PutInFormulaTree( pCell);
+ }
+ }
+
if (bUndo)
{
svl::IUndoManager* pUndoMgr = rDocShell.GetUndoManager();
commit 6407e1a18304b8cf9a003824777b290b78eb0210
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Dec 6 16:52:27 2013 +0100
Do not create paths starting "//" when root is just "/"
(cherry picked from commit bd8b3be0c7535e74ca8b63969be5c2bece0d3a3b)
Conflicts:
configmgr/source/access.cxx
Change-Id: If0b413a4fdd93465074548c7ea5451288c1d12aa
Reviewed-on: https://gerrit.libreoffice.org/6961
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Eike Rathke <erack at redhat.com>
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 94a14ce..5a3fd7d 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -565,14 +565,15 @@ OUString Access::getHierarchicalName() throw (css::uno::RuntimeException) {
checkLocalizedPropertyAccess();
// For backwards compatibility, return an absolute path representation where
// available:
- OUStringBuffer path;
+ OUString rootPath;
rtl::Reference< RootAccess > root(getRootAccess());
if (root.is()) {
- path.append(root->getAbsolutePathRepresentation());
+ rootPath = root->getAbsolutePathRepresentation();
}
OUString rel(getRelativePathRepresentation());
- if (path.getLength() != 0 && !rel.isEmpty()) {
- path.append(sal_Unicode('/'));
+ OUStringBuffer path(rootPath);
+ if (!rootPath.isEmpty() && rootPath != "/" && !rel.isEmpty()) {
+ path.append('/');
}
path.append(rel);
return path.makeStringAndClear();
More information about the Libreoffice-commits
mailing list