[Libreoffice-commits] core.git: 18 commits - officecfg/registry oox/source sc/inc sc/Library_sc.mk sc/sdi sc/source sc/uiconfig sc/UIConfig_scalc.mk sd/qa sd/source
Tomaž Vajngerl
tomaz.vajngerl at collabora.com
Sun Nov 8 10:43:12 PST 2015
officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu | 8
oox/source/core/fragmenthandler2.cxx | 20
oox/source/core/xmlfilterbase.cxx | 6
oox/source/ppt/slidetransition.cxx | 16
oox/source/ppt/slidetransitioncontext.cxx | 9
oox/source/token/namespaces-strict.txt | 4
oox/source/token/namespaces.hxx.tail | 1
oox/source/token/namespaces.txt | 4
oox/source/token/tokens.txt | 19
sc/Library_sc.mk | 1
sc/UIConfig_scalc.mk | 1
sc/inc/sc.hrc | 11
sc/sdi/cellsh.sdi | 1
sc/sdi/scalc.sdi | 24
sc/source/ui/StatisticsDialogs/RegressionDialog.cxx | 232 +++++
sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc | 25
sc/source/ui/StatisticsDialogs/StatisticsDialogs.src | 40
sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx | 25
sc/source/ui/app/scdll.cxx | 1
sc/source/ui/inc/RegressionDialog.hxx | 39
sc/source/ui/inc/TableFillingAndNavigationTools.hxx | 6
sc/source/ui/inc/reffact.hxx | 7
sc/source/ui/view/cellsh1.cxx | 9
sc/source/ui/view/tabvwsh.cxx | 1
sc/source/ui/view/tabvwshc.cxx | 7
sc/uiconfig/scalc/menubar/menubar.xml | 1
sc/uiconfig/scalc/ui/regressiondialog.ui | 404 ++++++++++
sd/qa/unit/data/AllTransitions.odp |binary
sd/qa/unit/export-tests.cxx | 77 +
sd/source/filter/eppt/pptexanimations.cxx | 2
sd/source/filter/eppt/pptx-epptbase.cxx | 41 -
sd/source/filter/eppt/pptx-epptooxml.cxx | 292 ++++---
sd/source/filter/ppt/pptanimations.hxx | 6
33 files changed, 1181 insertions(+), 159 deletions(-)
New commits:
commit 1d75c2e5ed1df1b9e3ae733d9c8a2106701b67ae
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sun Nov 8 19:30:34 2015 +0100
oox: check for namespace in MCE is flawed, use a namespace list
In "AlternateContent" nodes we have to check if we support the
namespace which is provided in "Requires" attribute of "Choice".
Currently we tried to resolve the namespace with a call to the
xml filter, however this doesn't work as the filter is already
gone.
In writerfilter we also have to handle a similar situation but
there we just compare it to a list of predefined namespace alias
("wps" and "wpg").
This commit adds a list of supported namespace aliases to
fragmenthandler2 instead of the namespace checking to support
the "p14" namespace alias correctly.
Change-Id: I25c430b97336c9e140bb5641a76a60895734b91f
diff --git a/oox/source/core/fragmenthandler2.cxx b/oox/source/core/fragmenthandler2.cxx
index 5f7cb7f..0186d78 100644
--- a/oox/source/core/fragmenthandler2.cxx
+++ b/oox/source/core/fragmenthandler2.cxx
@@ -60,15 +60,21 @@ bool FragmentHandler2::prepareMceContext( sal_Int32 nElement, const AttributeLis
case MCE_TOKEN( Choice ):
{
- OUString aRequires = rAttribs.getString( ( XML_Requires ), "none" );
- if (!getFilter().hasNamespaceURL(aRequires))
- // Check to see if we have this namespace defined first,
- // because calling getNamespaceURL() would throw if the
- // namespace doesn't exist.
+ if (aMceState.empty() || aMceState.back() != MCE_STARTED)
return false;
- aRequires = getFilter().getNamespaceURL( aRequires );
- if( getFilter().getNamespaceId( aRequires ) > 0 && !aMceState.empty() && aMceState.back() == MCE_STARTED )
+ OUString aRequires = rAttribs.getString( (XML_Requires ), OUString("none") );
+
+ // At this point we can't access namespaces as the correct xml filter
+ // is long gone. For now let's decide depending on a list of supported
+ // namespaces like we do in writerfilter
+
+ static std::vector<OUString> aSupportedNS =
+ {
+ "p14",
+ };
+
+ if (std::find(aSupportedNS.begin(), aSupportedNS.end(), aRequires) != aSupportedNS.end())
aMceState.back() = MCE_FOUND_CHOICE;
else
return false;
commit ebe469f83eebc89dd6b30811327912e3c13fa2c8
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sun Nov 8 19:27:31 2015 +0100
add p14 namespace to xmlfilterbase
Change-Id: I34d253e9f5bdfff14f1940544ae5bbb019bf506b
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index d3c1f64..d59b2b4 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -119,7 +119,8 @@ struct NamespaceIds: public rtl::StaticWithInit<
"http://schemas.openxmlformats.org/spreadsheetml/2006/main/v2",
"http://schemas.microsoft.com/office/drawing/2008/diagram",
"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main",
- "http://schemas.libreoffice.org/"
+ "http://schemas.libreoffice.org/",
+ "http://schemas.microsoft.com/office/powerpoint/2010/main"
};
static const sal_Int32 namespaceIds[] = {
@@ -147,7 +148,8 @@ struct NamespaceIds: public rtl::StaticWithInit<
NMSP_mceTest,
NMSP_dsp,
NMSP_xls14Lst,
- NMSP_loext
+ NMSP_loext,
+ NMSP_p14,
};
Sequence< beans::Pair< OUString, sal_Int32 > > aRet(SAL_N_ELEMENTS(namespaceIds));
commit be8a5d4495e787e1628bf053be5e3e56e0ea9565
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sun Nov 8 18:50:08 2015 +0100
tdf#74667 Regression dialog: linear, logarithmic, power
Add a new statistics dialog for calculating regression. First
supported regression models are linear, logarithmic and power.
Change-Id: I6fa18136455d4bc4d69edbaa7d19ee6b5b6e5703
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
index c18bd3c..fb15369 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
@@ -744,6 +744,14 @@
<value>1</value>
</prop>
</node>
+ <node oor:name=".uno:RegressionDialog" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">~Regression...</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
<node oor:name=".uno:TTestDialog" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">~t-test...</value>
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 4923a714..8304a9a 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -508,6 +508,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator \
sc/source/ui/StatisticsDialogs/MovingAverageDialog \
sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog \
+ sc/source/ui/StatisticsDialogs/RegressionDialog \
sc/source/ui/StatisticsDialogs/SamplingDialog \
sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog \
sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog \
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 5e4be53..051e2bf 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -138,6 +138,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/protectsheetdlg \
sc/uiconfig/scalc/ui/queryrunstreamscriptdialog \
sc/uiconfig/scalc/ui/randomnumbergenerator \
+ sc/uiconfig/scalc/ui/regressiondialog \
sc/uiconfig/scalc/ui/retypepassdialog \
sc/uiconfig/scalc/ui/retypepassworddialog \
sc/uiconfig/scalc/ui/rightfooterdialog \
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index c332cd2..f49b3fd 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -269,11 +269,12 @@
#define SID_COVARIANCE_DIALOG (SC_MESSAGE_START + 75)
#define SID_EXPONENTIAL_SMOOTHING_DIALOG (SC_MESSAGE_START + 76)
#define SID_MOVING_AVERAGE_DIALOG (SC_MESSAGE_START + 77)
-#define SID_TTEST_DIALOG (SC_MESSAGE_START + 78)
-#define SID_FTEST_DIALOG (SC_MESSAGE_START + 79)
-#define SID_ZTEST_DIALOG (SC_MESSAGE_START + 80)
-#define SID_CHI_SQUARE_TEST_DIALOG (SC_MESSAGE_START + 81)
-#define SID_SEARCH_RESULTS_DIALOG (SC_MESSAGE_START + 82)
+#define SID_REGRESSION_DIALOG (SC_MESSAGE_START + 78)
+#define SID_TTEST_DIALOG (SC_MESSAGE_START + 79)
+#define SID_FTEST_DIALOG (SC_MESSAGE_START + 80)
+#define SID_ZTEST_DIALOG (SC_MESSAGE_START + 81)
+#define SID_CHI_SQUARE_TEST_DIALOG (SC_MESSAGE_START + 82)
+#define SID_SEARCH_RESULTS_DIALOG (SC_MESSAGE_START + 83)
// functions
diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi
index f043ebd..346baa6 100644
--- a/sc/sdi/cellsh.sdi
+++ b/sc/sdi/cellsh.sdi
@@ -162,6 +162,7 @@ interface CellSelection
SID_CORRELATION_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
SID_COVARIANCE_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
SID_EXPONENTIAL_SMOOTHING_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
+ SID_REGRESSION_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
SID_MOVING_AVERAGE_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
SID_TTEST_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
SID_FTEST_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ]
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index a33801b..dd91da2 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -3159,6 +3159,30 @@ SfxVoidItem MovingAverageDialog SID_MOVING_AVERAGE_DIALOG
GroupId = GID_OPTIONS;
]
+SfxVoidItem RegressionDialog SID_REGRESSION_DIALOG
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_OPTIONS;
+]
+
SfxVoidItem TTestDialog SID_TTEST_DIALOG
()
[
diff --git a/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx b/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx
new file mode 100644
index 0000000..b6a5b6d
--- /dev/null
+++ b/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx
@@ -0,0 +1,232 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include <sfx2/dispatch.hxx>
+#include <svl/zforlist.hxx>
+#include <svl/undo.hxx>
+
+#include "formulacell.hxx"
+#include "rangelst.hxx"
+#include "scitems.hxx"
+#include "docsh.hxx"
+#include "document.hxx"
+#include "uiitems.hxx"
+#include "reffact.hxx"
+#include "strload.hxx"
+#include "docfunc.hxx"
+#include "StatisticsDialogs.hrc"
+#include "TableFillingAndNavigationTools.hxx"
+
+#include "RegressionDialog.hxx"
+
+namespace
+{
+ sal_Int16 constRegressionModel[] =
+ {
+ STR_LABEL_LINEAR,
+ STR_LABEL_LOGARITHMIC,
+ STR_LABEL_POWER
+ };
+
+ OUString constTemplateRSQUARED[] =
+ {
+ "=RSQ(%VARIABLE2_RANGE% ; %VARIABLE1_RANGE%)",
+ "=RSQ(%VARIABLE2_RANGE% ; LN(%VARIABLE1_RANGE%))",
+ "=RSQ(LN(%VARIABLE2_RANGE%) ; LN(%VARIABLE1_RANGE%))"
+ };
+
+ OUString constTemplatesSTDERR[] =
+ {
+ "=STEYX(%VARIABLE2_RANGE% ; %VARIABLE1_RANGE%)",
+ "=STEYX(%VARIABLE2_RANGE% ; LN(%VARIABLE1_RANGE%))",
+ "=STEYX(LN(%VARIABLE2_RANGE%) ; LN(%VARIABLE1_RANGE%))"
+ };
+
+ OUString constTemplatesSLOPE[] =
+ {
+ "=SLOPE(%VARIABLE2_RANGE% ; %VARIABLE1_RANGE%)",
+ "=SLOPE(%VARIABLE2_RANGE% ; LN(%VARIABLE1_RANGE%))",
+ "=EXP(INTERCEPT(LN(%VARIABLE2_RANGE%) ; LN(%VARIABLE1_RANGE%)))"
+ };
+
+ OUString constTemplatesINTERCEPT[] =
+ {
+ "=INTERCEPT(%VARIABLE2_RANGE% ; %VARIABLE1_RANGE%)",
+ "=INTERCEPT(%VARIABLE2_RANGE% ; LN(%VARIABLE1_RANGE%))",
+ "=SLOPE(LN(%VARIABLE2_RANGE%) ; LN(%VARIABLE1_RANGE%))"
+ };
+
+ OUString constRegressionFormula[] =
+ {
+ "=%A% * %ADDRESS% + %B%",
+ "=%A% * LN(%ADDRESS%) + %B%",
+ "=%A% * %ADDRESS% ^ %B%"
+ };
+
+} // end anonymous namespace
+
+ScRegressionDialog::ScRegressionDialog(
+ SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
+ vcl::Window* pParent, ScViewData* pViewData ) :
+ ScStatisticsTwoVariableDialog(
+ pSfxBindings, pChildWindow, pParent, pViewData,
+ "RegressionDialog", "modules/scalc/ui/regressiondialog.ui" )
+{
+ get(mpLinearCheckBox, "linear-check");
+ get(mpLogarithmicCheckBox, "logarithmic-check");
+ get(mpPowerCheckBox, "power-check");
+}
+
+ScRegressionDialog::~ScRegressionDialog()
+{}
+
+bool ScRegressionDialog::Close()
+{
+ return DoClose(ScRegressionDialogWrapper::GetChildWindowId());
+}
+
+sal_Int16 ScRegressionDialog::GetUndoNameId()
+{
+ return STR_REGRESSION_UNDO_NAME;
+}
+
+ScRange ScRegressionDialog::ApplyOutput(ScDocShell* pDocShell)
+{
+ AddressWalkerWriter aOutput(mOutputAddress, pDocShell, mDocument,
+ formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv));
+ FormulaTemplate aTemplate(mDocument);
+ aTemplate.autoReplaceUses3D(false);
+
+ std::unique_ptr<DataRangeIterator> pVariable1Iterator;
+ if (mGroupedBy == BY_COLUMN)
+ pVariable1Iterator.reset(new DataRangeByColumnIterator(mVariable1Range));
+ else
+ pVariable1Iterator.reset(new DataRangeByRowIterator(mVariable1Range));
+
+ std::unique_ptr<DataRangeIterator> pVariable2Iterator;
+ if (mGroupedBy == BY_COLUMN)
+ pVariable2Iterator.reset(new DataRangeByColumnIterator(mVariable2Range));
+ else
+ pVariable2Iterator.reset(new DataRangeByRowIterator(mVariable2Range));
+
+ aTemplate.autoReplaceRange("%VARIABLE1_RANGE%", pVariable1Iterator->get());
+ aTemplate.autoReplaceRange("%VARIABLE2_RANGE%", pVariable2Iterator->get());
+
+ aOutput.writeBoldString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_REGRESSION));
+ aOutput.newLine();
+ aOutput.newLine();
+ aOutput.push();
+
+ // REGRESSION MODEL
+ aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_LABEL_REGRESSION_MODEL));
+ aOutput.nextRow();
+
+ // RSQUARED
+ aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_LABEL_RSQUARED));
+ aOutput.nextRow();
+
+ // Standard Error
+ aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STRID_CALC_STD_ERROR));
+ aOutput.nextRow();
+
+ aOutput.nextRow();
+
+ // Slope
+ aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_LABEL_SLOPE));
+ aOutput.nextRow();
+
+ // Intercept
+ aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_LABEL_INTERCEPT));
+ aOutput.nextRow();
+
+ aOutput.nextRow();
+
+ size_t nVariable1Size = pVariable1Iterator->size();
+
+ OUString sFormula;
+ if (mGroupedBy == BY_COLUMN)
+ sFormula = "=INDEX(%VARIABLE1_RANGE%; %VAR1_CELL_INDEX%; 1)";
+ else
+ sFormula = "=INDEX(%VARIABLE1_RANGE%; 1; %VAR1_CELL_INDEX%)";
+
+ for (size_t i = 0; i < nVariable1Size; i++)
+ {
+ aTemplate.setTemplate(sFormula);
+ aTemplate.applyNumber("%VAR1_CELL_INDEX%", i + 1);
+ aOutput.writeFormula(aTemplate.getTemplate());
+ aOutput.nextRow();
+ }
+
+ aOutput.reset();
+
+ bool aEnabledRegressionTypes[3];
+
+ aEnabledRegressionTypes[0] = mpLinearCheckBox->IsChecked();
+ aEnabledRegressionTypes[1] = mpLogarithmicCheckBox->IsChecked();
+ aEnabledRegressionTypes[2] = mpPowerCheckBox->IsChecked();
+
+ sal_Int16 nColumn = 0;
+
+ for (size_t nRegressionIndex = 0; nRegressionIndex < SAL_N_ELEMENTS(aEnabledRegressionTypes); ++nRegressionIndex)
+ {
+ if (!aEnabledRegressionTypes[nRegressionIndex])
+ continue;
+
+ aOutput.nextColumn();
+ nColumn += 1;
+
+ // REGRESSION MODEL
+ aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, constRegressionModel[nRegressionIndex]));
+ aOutput.nextRow();
+
+ // RSQUARED
+ aTemplate.setTemplate(constTemplateRSQUARED[nRegressionIndex]);
+ aOutput.writeMatrixFormula(aTemplate.getTemplate());
+ aTemplate.autoReplaceAddress("%RSQUARED%", aOutput.current());
+ aOutput.nextRow();
+
+ // Standard Error
+ aTemplate.setTemplate(constTemplatesSTDERR[nRegressionIndex]);
+ aOutput.writeMatrixFormula(aTemplate.getTemplate());
+ aTemplate.autoReplaceAddress("%STD_ERROR%", aOutput.current());
+ aOutput.nextRow();
+
+ aOutput.nextRow();
+
+ // Slope
+ aTemplate.setTemplate(constTemplatesSLOPE[nRegressionIndex]);
+ aOutput.writeMatrixFormula(aTemplate.getTemplate());
+ aTemplate.autoReplaceAddress("%A%", aOutput.current());
+ aOutput.nextRow();
+
+ // Intercept
+ aTemplate.setTemplate(constTemplatesINTERCEPT[nRegressionIndex]);
+ aOutput.writeMatrixFormula(aTemplate.getTemplate());
+ aTemplate.autoReplaceAddress("%B%", aOutput.current());
+ aOutput.nextRow();
+
+ aOutput.nextRow();
+
+ for (size_t i = 0; i < nVariable1Size; i++)
+ {
+ aTemplate.setTemplate(constRegressionFormula[nRegressionIndex]);
+ aTemplate.applyAddress("%ADDRESS%", aOutput.current(-nColumn), false);
+ aOutput.writeFormula(aTemplate.getTemplate());
+
+ aOutput.nextRow();
+ }
+
+ aOutput.resetRow();
+ }
+
+ return ScRange(aOutput.mMinimumAddress, aOutput.mMaximumAddress);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc
index 662dc6d..f8cbcbb 100644
--- a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc
+++ b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc
@@ -55,13 +55,15 @@
#define STR_COVARIANCE_UNDO_NAME 63
#define STR_EXPONENTIAL_SMOOTHING_UNDO_NAME 64
#define STR_MOVING_AVERAGE_UNDO_NAME 65
-#define STR_TTEST 66
-#define STR_TTEST_UNDO_NAME 67
-#define STR_FTEST 68
-#define STR_FTEST_UNDO_NAME 69
-#define STR_ZTEST 70
-#define STR_ZTEST_UNDO_NAME 71
-#define STR_CHI_SQUARE_TEST 72
+#define STR_REGRESSION 66
+#define STR_REGRESSION_UNDO_NAME 67
+#define STR_TTEST 68
+#define STR_TTEST_UNDO_NAME 69
+#define STR_FTEST 70
+#define STR_FTEST_UNDO_NAME 71
+#define STR_ZTEST 72
+#define STR_ZTEST_UNDO_NAME 73
+#define STR_CHI_SQUARE_TEST 74
#define STR_COLUMN_LABEL_TEMPLATE 100
#define STR_ROW_LABEL_TEMPLATE 101
@@ -93,6 +95,15 @@
#define STR_CRITICAL_VALUE_LABEL 150
#define STR_TEST_STATISTIC_LABEL 151
+#define STR_LABEL_LINEAR 160
+#define STR_LABEL_LOGARITHMIC 161
+#define STR_LABEL_POWER 162
+
+#define STR_LABEL_REGRESSION_MODEL 170
+#define STR_LABEL_RSQUARED 171
+#define STR_LABEL_SLOPE 172
+#define STR_LABEL_INTERCEPT 173
+
#define STR_FTEST_P_RIGHT_TAIL 200
#define STR_FTEST_F_CRITICAL_RIGHT_TAIL 201
#define STR_FTEST_P_LEFT_TAIL 202
diff --git a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src
index 501e443..d807e4d 100644
--- a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src
+++ b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src
@@ -305,6 +305,14 @@ Resource RID_STATISTICS_DLGS
{
Text [ en-US ] = "Test of Independence (Chi-Square)";
};
+ String STR_REGRESSION_UNDO_NAME
+ {
+ Text [ en-US ] = "Regression";
+ };
+ String STR_REGRESSION
+ {
+ Text [ en-US ] = "Regression";
+ };
/* Common */
String STR_COLUMN_LABEL_TEMPLATE
@@ -356,6 +364,38 @@ Resource RID_STATISTICS_DLGS
Text [ en-US ] = "Test Statistic";
};
+ /* RegressionDialog */
+
+ String STR_LABEL_LINEAR
+ {
+ Text [ en-US ] = "Linear";
+ };
+ String STR_LABEL_LOGARITHMIC
+ {
+ Text [ en-US ] = "Logarithmic";
+ };
+ String STR_LABEL_POWER
+ {
+ Text [ en-US ] = "Power";
+ };
+
+ String STR_LABEL_REGRESSION_MODEL
+ {
+ Text [ en-US ] = "Regression Model";
+ };
+ String STR_LABEL_RSQUARED
+ {
+ Text [ en-US ] = "R^2";
+ };
+ String STR_LABEL_SLOPE
+ {
+ Text [ en-US ] = "Slope";
+ };
+ String STR_LABEL_INTERCEPT
+ {
+ Text [ en-US ] = "Intercept";
+ };
+
/*F Test */
String STR_FTEST_P_RIGHT_TAIL
{
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index c9761f5..56cfc45 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -243,6 +243,7 @@ void ScDLL::Init()
ScCovarianceDialogWrapper ::RegisterChildWindow(false, pMod);
ScExponentialSmoothingDialogWrapper ::RegisterChildWindow(false, pMod);
ScMovingAverageDialogWrapper ::RegisterChildWindow(false, pMod);
+ ScRegressionDialogWrapper ::RegisterChildWindow(false, pMod);
ScTTestDialogWrapper ::RegisterChildWindow(false, pMod);
ScFTestDialogWrapper ::RegisterChildWindow(false, pMod);
ScZTestDialogWrapper ::RegisterChildWindow(false, pMod);
diff --git a/sc/source/ui/inc/RegressionDialog.hxx b/sc/source/ui/inc/RegressionDialog.hxx
new file mode 100644
index 0000000..a4c7089
--- /dev/null
+++ b/sc/source/ui/inc/RegressionDialog.hxx
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#ifndef INCLUDED_SC_SOURCE_UI_INC_REGRESSIONDIALOG_HXX
+#define INCLUDED_SC_SOURCE_UI_INC_REGRESSIONDIALOG_HXX
+
+#include "StatisticsTwoVariableDialog.hxx"
+
+class ScRegressionDialog : public ScStatisticsTwoVariableDialog
+{
+ VclPtr<CheckBox> mpLinearCheckBox;
+ VclPtr<CheckBox> mpLogarithmicCheckBox;
+ VclPtr<CheckBox> mpPowerCheckBox;
+
+public:
+ ScRegressionDialog(
+ SfxBindings* pB, SfxChildWindow* pCW,
+ vcl::Window* pParent, ScViewData* pViewData );
+
+ virtual ~ScRegressionDialog();
+
+ virtual bool Close() override;
+
+protected:
+ virtual sal_Int16 GetUndoNameId() override;
+ virtual ScRange ApplyOutput(ScDocShell* pDocShell) override;
+};
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx
index 4c6e733..142decf 100644
--- a/sc/source/ui/inc/reffact.hxx
+++ b/sc/source/ui/inc/reffact.hxx
@@ -108,6 +108,13 @@ private:
ScMovingAverageDialogWrapper() = delete;
};
+class ScRegressionDialogWrapper :
+ public ChildWindowWrapper<SID_REGRESSION_DIALOG>
+{
+private:
+ ScRegressionDialogWrapper() = delete;
+};
+
class ScTTestDialogWrapper :
public ChildWindowWrapper<SID_TTEST_DIALOG>
{
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 4d5d912..27eb614 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -985,6 +985,15 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
pScMod->SetRefDialog( nId, pWnd == nullptr );
}
break;
+ case SID_REGRESSION_DIALOG:
+ {
+ sal_uInt16 nId = ScRegressionDialogWrapper::GetChildWindowId();
+ SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
+ SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId );
+
+ pScMod->SetRefDialog( nId, pWnd == nullptr );
+ }
+ break;
case SID_TTEST_DIALOG:
{
sal_uInt16 nId = ScTTestDialogWrapper::GetChildWindowId();
diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx
index a765612..f9c6f20 100644
--- a/sc/source/ui/view/tabvwsh.cxx
+++ b/sc/source/ui/view/tabvwsh.cxx
@@ -96,6 +96,7 @@ void ScTabViewShell::InitInterface_Impl()
GetStaticInterface()->RegisterChildWindow(ScCovarianceDialogWrapper::GetChildWindowId());
GetStaticInterface()->RegisterChildWindow(ScExponentialSmoothingDialogWrapper::GetChildWindowId());
GetStaticInterface()->RegisterChildWindow(ScMovingAverageDialogWrapper::GetChildWindowId());
+ GetStaticInterface()->RegisterChildWindow(ScRegressionDialogWrapper::GetChildWindowId());
GetStaticInterface()->RegisterChildWindow(ScTTestDialogWrapper::GetChildWindowId());
GetStaticInterface()->RegisterChildWindow(ScFTestDialogWrapper::GetChildWindowId());
GetStaticInterface()->RegisterChildWindow(ScZTestDialogWrapper::GetChildWindowId());
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index de6eddc..67a73b9 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -66,6 +66,7 @@
#include "CovarianceDialog.hxx"
#include "ExponentialSmoothingDialog.hxx"
#include "MovingAverageDialog.hxx"
+#include "RegressionDialog.hxx"
#include "TTestDialog.hxx"
#include "FTestDialog.hxx"
#include "ZTestDialog.hxx"
@@ -371,6 +372,12 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
}
break;
+ case SID_REGRESSION_DIALOG:
+ {
+ pResult = VclPtr<ScRegressionDialog>::Create( pB, pCW, pParent, &GetViewData() );
+ }
+ break;
+
case SID_TTEST_DIALOG:
{
pResult = VclPtr<ScTTestDialog>::Create( pB, pCW, pParent, &GetViewData() );
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index fe9260f..d1113e4 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -545,6 +545,7 @@
<menu:menuitem menu:id=".uno:CovarianceDialog"/>
<menu:menuitem menu:id=".uno:ExponentialSmoothingDialog"/>
<menu:menuitem menu:id=".uno:MovingAverageDialog"/>
+ <menu:menuitem menu:id=".uno:RegressionDialog"/>
<menu:menuitem menu:id=".uno:TTestDialog"/>
<menu:menuitem menu:id=".uno:FTestDialog"/>
<menu:menuitem menu:id=".uno:ZTestDialog"/>
diff --git a/sc/uiconfig/scalc/ui/regressiondialog.ui b/sc/uiconfig/scalc/ui/regressiondialog.ui
new file mode 100644
index 0000000..eee5af8
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/regressiondialog.ui
@@ -0,0 +1,404 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <requires lib="LibreOffice" version="1.0"/>
+ <object class="GtkDialog" id="RegressionDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Regression</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ <property name="secondary">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame-data">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="bottom_padding">6</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="variable1-range-label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Variable 1 range:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">variable1-range-edit</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="foruilo-RefEdit" id="variable1-range-edit">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="valign">center</property>
+ <property name="hexpand">True</property>
+ <property name="invisible_char">•</property>
+ <property name="width_chars">30</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="foruilo-RefButton" id="variable1-range-button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="variable2-range-label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Variable 2 range:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">variable2-range-edit</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="foruilo-RefEdit" id="variable2-range-edit">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="valign">center</property>
+ <property name="hexpand">True</property>
+ <property name="invisible_char">•</property>
+ <property name="width_chars">30</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="foruilo-RefButton" id="variable2-range-button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="output-range-label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Results to:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">variable2-range-edit</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="foruilo-RefEdit" id="output-range-edit">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="valign">center</property>
+ <property name="hexpand">True</property>
+ <property name="invisible_char">•</property>
+ <property name="width_chars">30</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="foruilo-RefButton" id="output-range-button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Data</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame-group">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="bottom_padding">6</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkRadioButton" id="groupedby-columns-radio">
+ <property name="label" translatable="yes">Columns</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="groupedby-rows-radio">
+ <property name="label" translatable="yes">Rows</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">groupedby-columns-radio</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Grouped by</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame-param">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="bottom_padding">6</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkCheckButton" id="linear-check">
+ <property name="label" translatable="yes">Linear Regression</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="logarithmic-check">
+ <property name="label" translatable="yes">Logarithmic Regression</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="power-check">
+ <property name="label" translatable="yes">Power Regression</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Output Regression Types</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">ok</action-widget>
+ </action-widgets>
+ </object>
+ <object class="GtkSizeGroup" id="sizegroup1">
+ <widgets>
+ <widget name="variable1-range-label"/>
+ <widget name="variable2-range-label"/>
+ <widget name="output-range-label"/>
+ <widget name="groupedby-columns-radio"/>
+ </widgets>
+ </object>
+</interface>
commit 1e81e82a3f49bf2482bd28948154724c2ee5124f
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sun Nov 8 18:43:08 2015 +0100
StatisticsDialogs: 3D addressing, add size to DataRangeIterator
Automatic filling of addesses always use 3D addresses, with this
commit 3D addressing can be turned of to simplify formulas when
this is possible.
Add size of the current range to DataRangeIterator.
Change-Id: I5c95cfe1617258221fa1a6adf1561e5eeee13c68
diff --git a/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx b/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx
index fe746d9..0bc4d93 100644
--- a/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx
+++ b/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx
@@ -18,7 +18,10 @@
#include "TableFillingAndNavigationTools.hxx"
-FormulaTemplate::FormulaTemplate(ScDocument* pDoc) : mpDoc(pDoc) {}
+FormulaTemplate::FormulaTemplate(ScDocument* pDoc)
+ : mpDoc(pDoc)
+ , mbUse3D(true)
+{}
void FormulaTemplate::setTemplate(const OUString& aTemplate)
{
@@ -35,24 +38,25 @@ const OUString& FormulaTemplate::getTemplate()
RangeReplacementMap::iterator itRange;
for (itRange = mRangeReplacementMap.begin(); itRange != mRangeReplacementMap.end(); ++itRange)
{
- applyRange(itRange->first, itRange->second);
+ applyRange(itRange->first, itRange->second, mbUse3D);
}
AddressReplacementMap::iterator itAddress;
for (itAddress = mAddressReplacementMap.begin(); itAddress != mAddressReplacementMap.end(); ++itAddress)
{
- applyAddress(itAddress->first, itAddress->second);
+ applyAddress(itAddress->first, itAddress->second, mbUse3D);
}
return mTemplate;
}
void FormulaTemplate::autoReplaceRange(const OUString& aVariable, const ScRange& rRange)
{
- mRangeReplacementMap.insert ( std::pair<OUString, ScRange>(aVariable, rRange) );
+ mRangeReplacementMap[aVariable] = rRange;
}
void FormulaTemplate::autoReplaceAddress(const OUString& aVariable, ScAddress aAddress)
{
- mAddressReplacementMap.insert ( std::pair<OUString, ScAddress>(aVariable, aAddress) );
+
+ mAddressReplacementMap[aVariable] = aAddress;
}
void FormulaTemplate::applyRange(const OUString& aVariable, const ScRange& aRange, bool b3D)
@@ -306,6 +310,11 @@ ScRange DataRangeByColumnIterator::get()
);
}
+size_t DataRangeByColumnIterator::size()
+{
+ return mInputRange.aEnd.Row() - mInputRange.aStart.Row() + 1;
+}
+
void DataRangeByColumnIterator::reset()
{
mCol = mInputRange.aStart.Col();
@@ -342,6 +351,11 @@ ScRange DataRangeByRowIterator::get()
);
}
+size_t DataRangeByRowIterator::size()
+{
+ return mInputRange.aEnd.Col() - mInputRange.aStart.Col() + 1;
+}
+
void DataRangeByRowIterator::reset()
{
mRow = mInputRange.aStart.Row();
@@ -352,4 +366,5 @@ DataCellIterator DataRangeByRowIterator::iterateCells()
return DataCellIterator(get(), true);
}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/TableFillingAndNavigationTools.hxx b/sc/source/ui/inc/TableFillingAndNavigationTools.hxx
index 0a34fef..d908eec 100644
--- a/sc/source/ui/inc/TableFillingAndNavigationTools.hxx
+++ b/sc/source/ui/inc/TableFillingAndNavigationTools.hxx
@@ -26,6 +26,7 @@ class FormulaTemplate
private:
OUString mTemplate;
ScDocument* mpDoc;
+ bool mbUse3D;
typedef std::map<OUString, ScRange> RangeReplacementMap;
typedef std::map<OUString, ScAddress> AddressReplacementMap;
@@ -42,6 +43,7 @@ public:
void autoReplaceRange(const OUString& aVariable, const ScRange& rRange);
void autoReplaceAddress(const OUString& aVariable, ScAddress aAddress);
+ void autoReplaceUses3D(bool bUse3D = true) { mbUse3D = bUse3D; }
void applyRange(const OUString& aVariable, const ScRange& aRange, bool b3D = true);
void applyRangeList(const OUString& aVariable, const ScRangeList& aRangeList, bool b3D = true);
@@ -121,8 +123,10 @@ public:
virtual bool hasNext() = 0;
virtual ScRange get() = 0;
+ virtual size_t size() = 0;
virtual void next() = 0;
virtual void reset() = 0;
+
sal_Int32 index();
virtual DataCellIterator iterateCells() = 0;
@@ -139,6 +143,7 @@ public:
virtual bool hasNext() override;
virtual void next() override;
virtual ScRange get() override;
+ virtual size_t size() override;
virtual void reset() override;
virtual DataCellIterator iterateCells() override;
};
@@ -154,6 +159,7 @@ public:
virtual bool hasNext() override;
virtual void next() override;
virtual ScRange get() override;
+ virtual size_t size() override;
virtual void reset() override;
virtual DataCellIterator iterateCells() override;
};
commit 9e428d1bb35a5cfa89d21fe8a47ea30b1a53fc4e
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sat Nov 7 12:57:44 2015 +0100
pptx: import outside/insde turning cube transition
Change-Id: I12f668aca158a8c868ecaeb37f6724852308a515
diff --git a/oox/source/ppt/slidetransition.cxx b/oox/source/ppt/slidetransition.cxx
index 4380bbd..2c130dd 100644
--- a/oox/source/ppt/slidetransition.cxx
+++ b/oox/source/ppt/slidetransition.cxx
@@ -398,6 +398,13 @@ namespace oox { namespace ppt {
mnTransitionType = TransitionType::ZOOM;
mnTransitionSubType = TransitionSubType::DEFAULT;
break;
+ case P14_TOKEN(prism):
+ mnTransitionType = TransitionType::MISCSHAPEWIPE;
+ if (param1)
+ mnTransitionSubType = TransitionSubType::CORNERSIN;
+ else
+ mnTransitionSubType = TransitionSubType::CORNERSOUT;
+ break;
default:
mnTransitionType = 0;
break;
diff --git a/oox/source/ppt/slidetransitioncontext.cxx b/oox/source/ppt/slidetransitioncontext.cxx
index c34c447..78d7825 100644
--- a/oox/source/ppt/slidetransitioncontext.cxx
+++ b/oox/source/ppt/slidetransitioncontext.cxx
@@ -142,6 +142,15 @@ SlideTransitionContext::~SlideTransitionContext() throw()
return new SoundActionContext ( *this, maSlideProperties );
case PPT_TOKEN( extLst ): // CT_OfficeArtExtensionList
return this;
+
+ case P14_TOKEN(prism):
+ if (!mbHasTransition)
+ {
+ mbHasTransition = true;
+ maTransition.setOoxTransitionType(aElementToken, sal_Int32(rAttribs.getBool(XML_isInverted, false)), 0);
+ }
+ return this;
+
default:
break;
}
commit 2ac998ff87da438770508fcfa034b56812f9013b
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Sat Nov 7 12:55:44 2015 +0100
oox: define p14 namespace in strict, define P14_TOKEN
Change-Id: I9c92b9a637f43fd425cd0741e480b72ee5cff919
diff --git a/oox/source/token/namespaces-strict.txt b/oox/source/token/namespaces-strict.txt
index 026fcfe..74efa82 100644
--- a/oox/source/token/namespaces-strict.txt
+++ b/oox/source/token/namespaces-strict.txt
@@ -70,11 +70,15 @@ dcTerms http://purl.org/dc/terms/
xm http://schemas.microsoft.com/office/excel/2006/main
mce http://schemas.openxmlformats.org/markup-compatibility/2006
mceTest http://schemas.openxmlformats.org/spreadsheetml/2006/main/v2
+
+# MSO 2010 extensions ---------------------------------------------------------
+
wps http://schemas.microsoft.com/office/word/2010/wordprocessingShape
wpg http://schemas.microsoft.com/office/word/2010/wordprocessingGroup
wp14 http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing
w14 http://schemas.microsoft.com/office/word/2010/wordml
a14 http://schemas.microsoft.com/office/drawingml/2010/main
+p14 http://schemas.microsoft.com/office/powerpoint/2010/main
# extlst namespaces
diff --git a/oox/source/token/namespaces.hxx.tail b/oox/source/token/namespaces.hxx.tail
index 24de645..792228c 100644
--- a/oox/source/token/namespaces.hxx.tail
+++ b/oox/source/token/namespaces.hxx.tail
@@ -40,6 +40,7 @@ inline sal_Int32 getNamespace( sal_Int32 nToken ) { return nToken & NMSP_MASK; }
#define O_TOKEN( token ) OOX_TOKEN( vmlOffice, token )
#define PC_TOKEN( token ) OOX_TOKEN( packageContentTypes, token )
#define PPT_TOKEN( token ) OOX_TOKEN( ppt, token )
+#define P14_TOKEN( token ) OOX_TOKEN( p14, token )
#define PR_TOKEN( token ) OOX_TOKEN( packageRel, token )
#define R_TOKEN( token ) OOX_TOKEN( officeRel, token )
#define VML_TOKEN( token ) OOX_TOKEN( vml, token )
diff --git a/oox/source/token/namespaces.txt b/oox/source/token/namespaces.txt
index 5d3232e..b309dc6 100644
--- a/oox/source/token/namespaces.txt
+++ b/oox/source/token/namespaces.txt
@@ -71,7 +71,7 @@ xm http://schemas.microsoft.com/office/excel/2006/main
mce http://schemas.openxmlformats.org/markup-compatibility/2006
mceTest http://schemas.openxmlformats.org/spreadsheetml/2006/main/v2
-# MSO 2010 extensions -----------------------------------------------------------------------
+# MSO 2010 extensions ---------------------------------------------------------
wps http://schemas.microsoft.com/office/word/2010/wordprocessingShape
wpg http://schemas.microsoft.com/office/word/2010/wordprocessingGroup
commit 22d45179c368efb808306ca4159049ea6a8bef61
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Fri Nov 6 13:40:44 2015 +0100
pptx: export inside/outside turning cube transition as p14:prism
Add support for exporting p14 transitions with AlternativeContent
fallback support. Export "inside/outside turning cube" transition
as "prism" MSO transition with fallback to "fade" transition.
Change-Id: I031d90f6465741847e1bda8991d45e7fed9e68e5
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 2cbbbee..5071f3a 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -66,9 +66,12 @@
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
// presentation namespaces
-#define PNMSS FSNS( XML_xmlns, XML_a ), "http://schemas.openxmlformats.org/drawingml/2006/main", \
- FSNS( XML_xmlns, XML_p ), "http://schemas.openxmlformats.org/presentationml/2006/main", \
- FSNS( XML_xmlns, XML_r ), "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
+#define PNMSS FSNS(XML_xmlns, XML_a), "http://schemas.openxmlformats.org/drawingml/2006/main", \
+ FSNS(XML_xmlns, XML_p), "http://schemas.openxmlformats.org/presentationml/2006/main", \
+ FSNS(XML_xmlns, XML_r), "http://schemas.openxmlformats.org/officeDocument/2006/relationships", \
+ FSNS(XML_xmlns, XML_p14), "http://schemas.microsoft.com/office/powerpoint/2010/main", \
+ FSNS(XML_xmlns, XML_mc), "http://schemas.openxmlformats.org/markup-compatibility/2006"
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::animations;
@@ -518,11 +521,14 @@ void PowerPointExport::WriteTransition( FSHelperPtr pFS )
bool bOOXmlSpecificTransition = false;
sal_Int32 nTransition = 0;
+ sal_Int32 nTransition14 = 0;
+
const char* pDirection = NULL;
const char* pOrientation = NULL;
const char* pThruBlk = NULL;
const char* pSpokes = NULL;
char pSpokesTmp[2] = "0";
+ const char* pInverted = nullptr;
if (!nPPTTransitionType)
{
@@ -530,19 +536,34 @@ void PowerPointExport::WriteTransition( FSHelperPtr pFS )
{
case animations::TransitionType::BARWIPE:
{
- if (animations::TransitionSubType::FADEOVERCOLOR)
+ if (nTransitionSubtype == animations::TransitionSubType::FADEOVERCOLOR)
{
nTransition = XML_cut;
pThruBlk = "true";
bOOXmlSpecificTransition = true;
}
}
+ case animations::TransitionType::MISCSHAPEWIPE:
+ {
+ switch(nTransitionSubtype)
+ {
+ case animations::TransitionSubType::CORNERSIN:
+ pInverted = "true";
+ case animations::TransitionSubType::CORNERSOUT:
+ nTransition = XML_fade;
+ nTransition14 = XML_prism;
+ bOOXmlSpecificTransition = true;
+ break;
+ }
+ }
break;
}
}
- if (nPPTTransitionType || bOOXmlSpecificTransition)
- {
+ // check if we resolved what transition to export
+ if (!nPPTTransitionType && !bOOXmlSpecificTransition)
+ return;
+
AnimationSpeed animationSpeed = AnimationSpeed_MEDIUM;
const char* speed = NULL;
sal_Int32 advanceTiming = -1;
@@ -571,11 +592,30 @@ void PowerPointExport::WriteTransition( FSHelperPtr pFS )
if( changeType == 1 && GETA( Duration ) )
mAny >>= advanceTiming;
- pFS->startElementNS( XML_p, XML_transition,
- XML_spd, speed,
- XML_advTm, advanceTiming != -1 ? I32S( advanceTiming*1000 ) : NULL,
- FSEND );
+ if (nTransition14)
+ {
+ pFS->startElement(FSNS(XML_mc, XML_AlternateContent), FSEND);
+ pFS->startElement(FSNS(XML_mc, XML_Choice), XML_Requires, "p14", FSEND);
+
+ pFS->startElementNS(XML_p, XML_transition,
+ XML_spd, speed,
+ XML_advTm, advanceTiming != -1 ? I32S( advanceTiming*1000 ) : NULL,
+ FSEND );
+
+ pFS->singleElementNS(XML_p14, nTransition14,
+ XML_isInverted, pInverted,
+ FSEND );
+
+ pFS->endElement(FSNS(XML_p, XML_transition));
+
+ pFS->endElement(FSNS(XML_mc, XML_Choice));
+ pFS->startElement(FSNS(XML_mc, XML_Fallback), FSEND );
+ }
+ pFS->startElementNS(XML_p, XML_transition,
+ XML_spd, speed,
+ XML_advTm, advanceTiming != -1 ? I32S( advanceTiming*1000 ) : NULL,
+ FSEND );
if (!bOOXmlSpecificTransition)
{
@@ -669,15 +709,22 @@ void PowerPointExport::WriteTransition( FSHelperPtr pFS )
}
}
- if( nTransition )
+ if (nTransition)
+ {
pFS->singleElementNS( XML_p, nTransition,
XML_dir, pDirection,
XML_orient, pOrientation,
XML_spokes, pSpokes,
XML_thruBlk, pThruBlk,
FSEND );
+ }
- pFS->endElementNS( XML_p, XML_transition );
+ pFS->endElementNS(XML_p, XML_transition);
+
+ if (nTransition14)
+ {
+ pFS->endElement(FSNS(XML_mc, XML_Fallback));
+ pFS->endElement(FSNS(XML_mc, XML_AlternateContent));
}
}
commit ae3d0e9e21873c471c85bc73abdec343ec852d60
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Fri Nov 6 13:39:20 2015 +0100
pptx: inside/outside turning cube transition test
Change-Id: Ida476a8e5a761c7721949b259b95184a88cc4e41
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 7586d76..11e87de 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -1408,6 +1408,11 @@ void SdExportTest::testExportTransitionsPPTX()
CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 41, TransitionType::PUSHWIPE, TransitionSubType::COMBHORIZONTAL));
CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 42, TransitionType::PUSHWIPE, TransitionSubType::COMBVERTICAL));
+ // OUTSIDE TURNING CUBE
+ CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 57, TransitionType::MISCSHAPEWIPE, TransitionSubType::CORNERSOUT));
+ // INSIDE TURNING CUBE
+ CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 60, TransitionType::MISCSHAPEWIPE, TransitionSubType::CORNERSIN));
+
// NEWSFLASH
CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 71, TransitionType::ZOOM, TransitionSubType::ROTATEIN));
}
commit 9f985de7b3377f50eea3ea47f41a0174b335c0b8
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Fri Nov 6 09:48:28 2015 +0100
oox: p14 namespace (MSO 2010) + tokens for slide transitions
Change-Id: I72d1901ceb2e43e459efb197cb72bd701c7d8f63
diff --git a/oox/source/token/namespaces.txt b/oox/source/token/namespaces.txt
index 2c61d60..5d3232e 100644
--- a/oox/source/token/namespaces.txt
+++ b/oox/source/token/namespaces.txt
@@ -70,11 +70,15 @@ dcTerms http://purl.org/dc/terms/
xm http://schemas.microsoft.com/office/excel/2006/main
mce http://schemas.openxmlformats.org/markup-compatibility/2006
mceTest http://schemas.openxmlformats.org/spreadsheetml/2006/main/v2
+
+# MSO 2010 extensions -----------------------------------------------------------------------
+
wps http://schemas.microsoft.com/office/word/2010/wordprocessingShape
wpg http://schemas.microsoft.com/office/word/2010/wordprocessingGroup
wp14 http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing
w14 http://schemas.microsoft.com/office/word/2010/wordml
a14 http://schemas.microsoft.com/office/drawing/2010/main
+p14 http://schemas.microsoft.com/office/powerpoint/2010/main
# extlst namespaces
diff --git a/oox/source/token/tokens.txt b/oox/source/token/tokens.txt
index c5843fa..e44830d 100644
--- a/oox/source/token/tokens.txt
+++ b/oox/source/token/tokens.txt
@@ -1403,6 +1403,7 @@ control2
controls
convMailMergeEsc
convex
+conveyor
coolSlant
coordorigin
coordsize
@@ -1926,6 +1927,7 @@ documentType
dodecagon
dodgerBlue
donut
+doors
dos
dot
dotDash
@@ -2183,6 +2185,7 @@ fans
fast
fax
fc
+ferris
ffData
fgClr
fgColor
@@ -2264,6 +2267,7 @@ fitpath
fitshape
fixed
fixedVal
+flash
flat
flatBorders
flatTx
@@ -2320,6 +2324,7 @@ flowersRoses
flowersTeacup
flowersTiny
fltVal
+flythrough
fmla
fmt
fmtId
@@ -2459,6 +2464,7 @@ ghostCol
ghostRow
ghostWhite
gingerbreadMan
+glitter
glossaryDocument
glow
goal
@@ -2687,6 +2693,7 @@ hlinkMouseOver
hold
holeSize
holly
+honeycomb
homePlate
honeydew
horizontal
@@ -2867,6 +2874,7 @@ irohaFullWidth
irregularSeal1
irregularSeal2
is
+isInverted
isLgl
isNarration
isPhoto
@@ -3437,6 +3445,7 @@ months
moon
moons
morning
+morph
mosaic
moveFrom
moveFromRangeEnd
@@ -3788,6 +3797,7 @@ overrideClrMapping
overwriteClear
owners
p
+p14
pBdr
pLen
pPos
@@ -3821,6 +3831,7 @@ paleTurquoise
paleVioletRed
palmsBlack
palmsColor
+pan
pane
panose
panose1
@@ -4083,6 +4094,7 @@ printTwoOnOne
printer
printerSettings
priority
+prism
prnPr
prnWhat
product
@@ -4110,6 +4122,7 @@ prstDash
prstGeom
prstMaterial
prstShdw
+prstTrans
prstTxWarp
pt
ptCount
@@ -4290,6 +4303,7 @@ result
rev
revDir
revPos
+reveal
reverse
reverseDiagStripe
reviewed
@@ -4319,6 +4333,7 @@ rightMargin
rightToLeft
rightVertical
rings
+ripple
ris
rm
rnd
@@ -4688,6 +4703,7 @@ showsigndate
shp
shpTxLTRAlignCh
shpTxRTLAlignCh
+shred
shrinkToFit
si
sib
@@ -5647,6 +5663,7 @@ vocabulary
vol
volType
volTypes
+vortex
vstream
vt
w
@@ -5660,6 +5677,7 @@ wOff
wR
warmMatte
warning
+warp
watermarks
wavAudioFile
wave
@@ -5702,6 +5720,7 @@ weight
wgp
wheat
wheel
+wheelReverse
whenNotActive
white
whiteFlowers
commit 4115cb18362810d7b92c5a259fe3399c5e760970
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Fri Nov 6 01:50:01 2015 +0100
pptx: import/export of "cut through black" transition
"Cut through black" is not supported in ppt so we detectit only
in pptx specific export code. This needed some changes in the
pptx code for exporting transitions.
Change-Id: Ibc7361311017b3ffadd289db4e8ae233e1101ea8
diff --git a/oox/source/ppt/slidetransition.cxx b/oox/source/ppt/slidetransition.cxx
index e4950c4..4380bbd 100644
--- a/oox/source/ppt/slidetransition.cxx
+++ b/oox/source/ppt/slidetransition.cxx
@@ -288,11 +288,9 @@ namespace oox { namespace ppt {
mbTransitionDirectionNormal = false;
break;
case PPT_TOKEN( cut ):
- // The binfilter seems to ignore this transition.
- // Fade to black instead if thrBlk is true.
if( param1 )
{
- mnTransitionType = TransitionType::FADE;
+ mnTransitionType = TransitionType::BARWIPE;
mnTransitionSubType = TransitionSubType::FADEOVERCOLOR;
}
OSL_TRACE( "OOX: cut transition fallback." );
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 73901a0..7586d76 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -1401,6 +1401,9 @@ void SdExportTest::testExportTransitionsPPTX()
CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 03, TransitionType::BARWIPE, TransitionSubType::LEFTTORIGHT, false));
CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 04, TransitionType::BARWIPE, TransitionSubType::TOPTOBOTTOM, true));
+ // CUT THROUGH BLACK
+ CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 31, TransitionType::BARWIPE, TransitionSubType::FADEOVERCOLOR));
+
// COMB
CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 41, TransitionType::PUSHWIPE, TransitionSubType::COMBHORIZONTAL));
CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 42, TransitionType::PUSHWIPE, TransitionSubType::COMBVERTICAL));
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 7ffae97..2cbbbee 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -515,7 +515,34 @@ void PowerPointExport::WriteTransition( FSHelperPtr pFS )
if( !nPPTTransitionType && eFadeEffect != FadeEffect_NONE )
nPPTTransitionType = GetTransition( eFadeEffect, nDirection );
- if( nPPTTransitionType ) {
+ bool bOOXmlSpecificTransition = false;
+
+ sal_Int32 nTransition = 0;
+ const char* pDirection = NULL;
+ const char* pOrientation = NULL;
+ const char* pThruBlk = NULL;
+ const char* pSpokes = NULL;
+ char pSpokesTmp[2] = "0";
+
+ if (!nPPTTransitionType)
+ {
+ switch(nTransitionType)
+ {
+ case animations::TransitionType::BARWIPE:
+ {
+ if (animations::TransitionSubType::FADEOVERCOLOR)
+ {
+ nTransition = XML_cut;
+ pThruBlk = "true";
+ bOOXmlSpecificTransition = true;
+ }
+ }
+ break;
+ }
+ }
+
+ if (nPPTTransitionType || bOOXmlSpecificTransition)
+ {
AnimationSpeed animationSpeed = AnimationSpeed_MEDIUM;
const char* speed = NULL;
sal_Int32 advanceTiming = -1;
@@ -549,99 +576,97 @@ void PowerPointExport::WriteTransition( FSHelperPtr pFS )
XML_advTm, advanceTiming != -1 ? I32S( advanceTiming*1000 ) : NULL,
FSEND );
- sal_Int32 nTransition = 0;
- const char* pDirection = NULL;
- const char* pOrientation = NULL;
- const char* pThruBlk = NULL;
- const char* pSpokes = NULL;
- char pSpokesTmp[2] = "0";
- switch( nPPTTransitionType ) {
- case PPT_TRANSITION_TYPE_BLINDS:
- nTransition = XML_blinds;
- pDirection = ( nDirection == 0) ? "vert" : "horz";
- break;
- case PPT_TRANSITION_TYPE_CHECKER:
- nTransition = XML_checker;
- pDirection = ( nDirection == 1) ? "vert" : "horz";
- break;
- case PPT_TRANSITION_TYPE_CIRCLE:
- nTransition = XML_circle;
- break;
- case PPT_TRANSITION_TYPE_COMB:
- nTransition = XML_comb;
- pDirection = ( nDirection == 1) ? "vert" : "horz";
- break;
- case PPT_TRANSITION_TYPE_COVER:
- nTransition = XML_cover;
- pDirection = Get8Direction( nDirection );
- break;
- case PPT_TRANSITION_TYPE_DIAMOND:
- nTransition = XML_diamond;
- break;
- case PPT_TRANSITION_TYPE_DISSOLVE:
- nTransition = XML_dissolve;
- break;
- case PPT_TRANSITION_TYPE_FADE:
- nTransition = XML_fade;
- pThruBlk = "true";
- break;
- case PPT_TRANSITION_TYPE_SMOOTHFADE:
- nTransition = XML_fade;
- break;
- case PPT_TRANSITION_TYPE_NEWSFLASH:
- nTransition = XML_newsflash;
- break;
- case PPT_TRANSITION_TYPE_PLUS:
- nTransition = XML_plus;
- break;
- case PPT_TRANSITION_TYPE_PULL:
- nTransition = XML_pull;
- pDirection = Get8Direction( nDirection );
- break;
- case PPT_TRANSITION_TYPE_PUSH:
- nTransition = XML_push;
- pDirection = GetSideDirection( nDirection );
- break;
- case PPT_TRANSITION_TYPE_RANDOM:
- nTransition = XML_random;
- break;
- case PPT_TRANSITION_TYPE_RANDOM_BARS:
- nTransition = XML_randomBar;
- pDirection = ( nDirection == 1) ? "vert" : "horz";
- break;
- case PPT_TRANSITION_TYPE_SPLIT:
- nTransition = XML_split;
- pDirection = ( nDirection & 1) ? "in" : "out";
- pOrientation = ( nDirection < 2) ? "horz" : "vert";
- break;
- case PPT_TRANSITION_TYPE_STRIPS:
- nTransition = XML_strips;
- pDirection = GetCornerDirection( nDirection );
- break;
- case PPT_TRANSITION_TYPE_WEDGE:
- nTransition = XML_wedge;
- break;
- case PPT_TRANSITION_TYPE_WHEEL:
- nTransition = XML_wheel;
- if( nDirection != 4 && nDirection <= 9 ) {
- pSpokesTmp[0] = '0' + nDirection;
- pSpokes = pSpokesTmp;
+ if (!bOOXmlSpecificTransition)
+ {
+ switch(nPPTTransitionType)
+ {
+ case PPT_TRANSITION_TYPE_BLINDS:
+ nTransition = XML_blinds;
+ pDirection = (nDirection == 0) ? "vert" : "horz";
+ break;
+ case PPT_TRANSITION_TYPE_CHECKER:
+ nTransition = XML_checker;
+ pDirection = ( nDirection == 1) ? "vert" : "horz";
+ break;
+ case PPT_TRANSITION_TYPE_CIRCLE:
+ nTransition = XML_circle;
+ break;
+ case PPT_TRANSITION_TYPE_COMB:
+ nTransition = XML_comb;
+ pDirection = (nDirection == 1) ? "vert" : "horz";
+ break;
+ case PPT_TRANSITION_TYPE_COVER:
+ nTransition = XML_cover;
+ pDirection = Get8Direction( nDirection );
+ break;
+ case PPT_TRANSITION_TYPE_DIAMOND:
+ nTransition = XML_diamond;
+ break;
+ case PPT_TRANSITION_TYPE_DISSOLVE:
+ nTransition = XML_dissolve;
+ break;
+ case PPT_TRANSITION_TYPE_FADE:
+ nTransition = XML_fade;
+ pThruBlk = "true";
+ break;
+ case PPT_TRANSITION_TYPE_SMOOTHFADE:
+ nTransition = XML_fade;
+ break;
+ case PPT_TRANSITION_TYPE_NEWSFLASH:
+ nTransition = XML_newsflash;
+ break;
+ case PPT_TRANSITION_TYPE_PLUS:
+ nTransition = XML_plus;
+ break;
+ case PPT_TRANSITION_TYPE_PULL:
+ nTransition = XML_pull;
+ pDirection = Get8Direction(nDirection);
+ break;
+ case PPT_TRANSITION_TYPE_PUSH:
+ nTransition = XML_push;
+ pDirection = GetSideDirection(nDirection);
+ break;
+ case PPT_TRANSITION_TYPE_RANDOM:
+ nTransition = XML_random;
+ break;
+ case PPT_TRANSITION_TYPE_RANDOM_BARS:
+ nTransition = XML_randomBar;
+ pDirection = (nDirection == 1) ? "vert" : "horz";
+ break;
+ case PPT_TRANSITION_TYPE_SPLIT:
+ nTransition = XML_split;
+ pDirection = (nDirection & 1) ? "in" : "out";
+ pOrientation = (nDirection < 2) ? "horz" : "vert";
+ break;
+ case PPT_TRANSITION_TYPE_STRIPS:
+ nTransition = XML_strips;
+ pDirection = GetCornerDirection( nDirection );
+ break;
+ case PPT_TRANSITION_TYPE_WEDGE:
+ nTransition = XML_wedge;
+ break;
+ case PPT_TRANSITION_TYPE_WHEEL:
+ nTransition = XML_wheel;
+ if( nDirection != 4 && nDirection <= 9 ) {
+ pSpokesTmp[0] = '0' + nDirection;
+ pSpokes = pSpokesTmp;
+ }
+ break;
+ case PPT_TRANSITION_TYPE_WIPE:
+ nTransition = XML_wipe;
+ pDirection = GetSideDirection( nDirection );
+ break;
+ case PPT_TRANSITION_TYPE_ZOOM:
+ nTransition = XML_zoom;
+ pDirection = (nDirection == 1) ? "in" : "out";
+ break;
+ // coverity[dead_error_line] - following conditions exist to avoid compiler warning
+ case PPT_TRANSITION_TYPE_NONE:
+ default:
+ nTransition = 0;
+ break;
}
- break;
- case PPT_TRANSITION_TYPE_WIPE:
- nTransition = XML_wipe;
- pDirection = GetSideDirection( nDirection );
- break;
- case PPT_TRANSITION_TYPE_ZOOM:
- nTransition = XML_zoom;
- pDirection = ( nDirection == 1) ? "in" : "out";
- break;
- // coverity[dead_error_line] - following conditions exist to avoid compiler warning
- case PPT_TRANSITION_TYPE_NONE:
- default:
- nTransition = 0;
- break;
}
if( nTransition )
commit 6c4247979d32d7765c0fa892024f62bdae6dfd48
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Fri Nov 6 01:38:55 2015 +0100
pptx export: properly assert transitions
Change-Id: Ia793d51c7df6987763fc37c8d73a98ae94a4822a
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 5fdfeb6..73901a0 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -94,7 +94,8 @@ template<> struct assertion_traits<Color>
CPPUNIT_NS_END
-using namespace ::com::sun::star;
+using namespace css;
+using namespace css::animations;
class SdExportTest : public SdModelTestBase
{
@@ -1349,7 +1350,7 @@ void SdExportTest::testTdf80224()
bool checkTransitionOnPage(uno::Reference<drawing::XDrawPagesSupplier> xDoc, sal_Int32 nSlideNumber,
sal_Int16 nExpectedTransitionType, sal_Int16 nExpectedTransitionSubType,
- bool bExpectedDirection = false)
+ bool bExpectedDirection = true)
{
sal_Int32 nSlideIndex = nSlideNumber - 1;
@@ -1357,31 +1358,34 @@ bool checkTransitionOnPage(uno::Reference<drawing::XDrawPagesSupplier> xDoc, sal
uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(nSlideIndex), uno::UNO_QUERY_THROW);
uno::Reference<beans::XPropertySet> xPropSet(xPage, uno::UNO_QUERY);
- uno::Any aAny;
- aAny = xPropSet->getPropertyValue(OUString("TransitionType"));
sal_Int16 nTransitionType = 0;
- if ((aAny >>= nTransitionType) == false)
- return false;
+ xPropSet->getPropertyValue("TransitionType") >>= nTransitionType;
+
if (nExpectedTransitionType != nTransitionType)
+ {
+ std::cerr << "Transition type: " << nTransitionType << " " << nExpectedTransitionType << std::endl;
return false;
+ }
- aAny = xPropSet->getPropertyValue(OUString("TransitionSubtype"));
sal_Int16 nTransitionSubtype = 0;
- if ((aAny >>= nTransitionSubtype) == false)
- return false;
+ xPropSet->getPropertyValue("TransitionSubtype") >>= nTransitionSubtype;
if (nExpectedTransitionSubType != nTransitionSubtype)
+ {
+ std::cerr << "Transition Subtype: " << nTransitionSubtype << " " << nExpectedTransitionSubType << std::endl;
return false;
+ }
+
+ bool bDirection = false;
+ xPropSet->getPropertyValue("TransitionDirection") >>= bDirection;
- if (xPropSet->getPropertySetInfo()->hasPropertyByName(OUString("TransitionDirection")))
+ if (bExpectedDirection != bDirection)
{
- aAny = xPropSet->getPropertyValue(OUString("TransitionDirection"));
- bool bDirection = false;
- if ((aAny >>= bDirection) == false)
- return false;
- if (bExpectedDirection != bDirection)
- return false;
+ std::cerr << "Transition Direction: " << (bExpectedDirection ? "normal" : "reversed")
+ << " " << (bDirection ? "normal" : "reversed") << std::endl;
+ return false;
}
+
return true;
}
@@ -1392,14 +1396,17 @@ void SdExportTest::testExportTransitionsPPTX()
uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW);
// WIPE TRANSITIONS
- checkTransitionOnPage(xDoc, 01, css::animations::TransitionType::BARWIPE, css::animations::TransitionSubType::TOPTOBOTTOM, true);
- checkTransitionOnPage(xDoc, 02, css::animations::TransitionType::BARWIPE, css::animations::TransitionSubType::LEFTTORIGHT, false);
- checkTransitionOnPage(xDoc, 03, css::animations::TransitionType::BARWIPE, css::animations::TransitionSubType::LEFTTORIGHT, true);
- checkTransitionOnPage(xDoc, 04, css::animations::TransitionType::BARWIPE, css::animations::TransitionSubType::TOPTOBOTTOM, false);
-
- checkTransitionOnPage(xDoc, 71, css::animations::TransitionType::ZOOM, css::animations::TransitionSubType::ROTATEIN);
- checkTransitionOnPage(xDoc, 41, css::animations::TransitionType::PUSHWIPE, css::animations::TransitionSubType::COMBHORIZONTAL);
- checkTransitionOnPage(xDoc, 42, css::animations::TransitionType::PUSHWIPE, css::animations::TransitionSubType::COMBVERTICAL);
+ CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 01, TransitionType::BARWIPE, TransitionSubType::TOPTOBOTTOM, false));
+ CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 02, TransitionType::BARWIPE, TransitionSubType::LEFTTORIGHT, true));
+ CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 03, TransitionType::BARWIPE, TransitionSubType::LEFTTORIGHT, false));
+ CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 04, TransitionType::BARWIPE, TransitionSubType::TOPTOBOTTOM, true));
+
+ // COMB
+ CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 41, TransitionType::PUSHWIPE, TransitionSubType::COMBHORIZONTAL));
+ CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 42, TransitionType::PUSHWIPE, TransitionSubType::COMBVERTICAL));
+
+ // NEWSFLASH
+ CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 71, TransitionType::ZOOM, TransitionSubType::ROTATEIN));
}
CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
commit da82d5076ba9fa0cb802a6c84bed939c14b0cf57
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Thu Nov 5 23:47:38 2015 +0100
pptx: fix export of newsflash transition
Change-Id: I0e34e1b8860b9142d3171246d41bb528e710d10c
diff --git a/oox/source/ppt/slidetransition.cxx b/oox/source/ppt/slidetransition.cxx
index 754082d..e4950c4 100644
--- a/oox/source/ppt/slidetransition.cxx
+++ b/oox/source/ppt/slidetransition.cxx
@@ -381,9 +381,8 @@ namespace oox { namespace ppt {
mnTransitionSubType = TransitionSubType::DEFAULT;
break;
case PPT_TOKEN( newsflash ):
- // this is what the PPT binary filter does.... not sure I agree.
- mnTransitionType = TransitionType::FOURBOXWIPE;
- mnTransitionSubType = TransitionSubType::CORNERSOUT;
+ mnTransitionType = TransitionType::ZOOM;
+ mnTransitionSubType = TransitionSubType::ROTATEIN;
break;
case PPT_TOKEN( plus ):
mnTransitionType = TransitionType::FOURBOXWIPE;
commit b409cd73a9b68d498c7d3de81013d2cbd8331243
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Thu Nov 5 23:43:05 2015 +0100
pptx: import/export corner directions correctly
Change-Id: Id2e9234c200c9544af31c07e7c5a13c7ae69d9b3
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 2c42be6..7ffae97 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -471,16 +471,16 @@ const char* PowerPointExport::GetCornerDirection( sal_uInt8 nDirection )
switch( nDirection ) {
case 4:
- pDirection = "rd";
+ pDirection = "lu";
break;
case 5:
- pDirection = "ld";
+ pDirection = "ru";
break;
case 6:
- pDirection = "ru";
+ pDirection = "ld";
break;
case 7:
- pDirection = "lu";
+ pDirection = "rd";
break;
}
commit f2b6ba8ad193354d2b34812d8040b48ffde6646c
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Thu Nov 5 23:17:51 2015 +0100
pptx: add a testcase for wipe transitions import/export
Change-Id: Ic82b95fc676957f26ce5e09b2343ba71b775c1b0
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index c74ac8f..5fdfeb6 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -1348,7 +1348,8 @@ void SdExportTest::testTdf80224()
}
bool checkTransitionOnPage(uno::Reference<drawing::XDrawPagesSupplier> xDoc, sal_Int32 nSlideNumber,
- sal_Int16 nExpectedTransitionType, sal_Int16 nExpectedTransitionSubType)
+ sal_Int16 nExpectedTransitionType, sal_Int16 nExpectedTransitionSubType,
+ bool bExpectedDirection = false)
{
sal_Int32 nSlideIndex = nSlideNumber - 1;
@@ -1362,17 +1363,25 @@ bool checkTransitionOnPage(uno::Reference<drawing::XDrawPagesSupplier> xDoc, sal
sal_Int16 nTransitionType = 0;
if ((aAny >>= nTransitionType) == false)
return false;
+ if (nExpectedTransitionType != nTransitionType)
+ return false;
aAny = xPropSet->getPropertyValue(OUString("TransitionSubtype"));
sal_Int16 nTransitionSubtype = 0;
if ((aAny >>= nTransitionSubtype) == false)
return false;
-
- if (nExpectedTransitionType != nTransitionType)
- return false;
if (nExpectedTransitionSubType != nTransitionSubtype)
return false;
+ if (xPropSet->getPropertySetInfo()->hasPropertyByName(OUString("TransitionDirection")))
+ {
+ aAny = xPropSet->getPropertyValue(OUString("TransitionDirection"));
+ bool bDirection = false;
+ if ((aAny >>= bDirection) == false)
+ return false;
+ if (bExpectedDirection != bDirection)
+ return false;
+ }
return true;
}
@@ -1382,6 +1391,12 @@ void SdExportTest::testExportTransitionsPPTX()
xDocShRef = saveAndReload(xDocShRef, PPTX);
uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW);
+ // WIPE TRANSITIONS
+ checkTransitionOnPage(xDoc, 01, css::animations::TransitionType::BARWIPE, css::animations::TransitionSubType::TOPTOBOTTOM, true);
+ checkTransitionOnPage(xDoc, 02, css::animations::TransitionType::BARWIPE, css::animations::TransitionSubType::LEFTTORIGHT, false);
+ checkTransitionOnPage(xDoc, 03, css::animations::TransitionType::BARWIPE, css::animations::TransitionSubType::LEFTTORIGHT, true);
+ checkTransitionOnPage(xDoc, 04, css::animations::TransitionType::BARWIPE, css::animations::TransitionSubType::TOPTOBOTTOM, false);
+
checkTransitionOnPage(xDoc, 71, css::animations::TransitionType::ZOOM, css::animations::TransitionSubType::ROTATEIN);
checkTransitionOnPage(xDoc, 41, css::animations::TransitionType::PUSHWIPE, css::animations::TransitionSubType::COMBHORIZONTAL);
checkTransitionOnPage(xDoc, 42, css::animations::TransitionType::PUSHWIPE, css::animations::TransitionSubType::COMBVERTICAL);
commit 2cdd751e8e00f89c084d1f318bfd1488b0231c95
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Thu Nov 5 21:55:21 2015 +0100
Write as comment the names of slide transitions in MS-PPT specs
Change-Id: Ied3203c0a4ce04a9c93f35ae4ce4fa55e82cf70e
diff --git a/sd/source/filter/ppt/pptanimations.hxx b/sd/source/filter/ppt/pptanimations.hxx
index 4d5696e..56033c7 100644
--- a/sd/source/filter/ppt/pptanimations.hxx
+++ b/sd/source/filter/ppt/pptanimations.hxx
@@ -43,11 +43,11 @@ namespace ppt
#define PPT_TRANSITION_TYPE_COVER 4
#define PPT_TRANSITION_TYPE_DISSOLVE 5
#define PPT_TRANSITION_TYPE_FADE 6
-#define PPT_TRANSITION_TYPE_PULL 7
+#define PPT_TRANSITION_TYPE_PULL 7 // Uncover in MS-PPT Specs
#define PPT_TRANSITION_TYPE_RANDOM_BARS 8
#define PPT_TRANSITION_TYPE_STRIPS 9
#define PPT_TRANSITION_TYPE_WIPE 10
-#define PPT_TRANSITION_TYPE_ZOOM 11
+#define PPT_TRANSITION_TYPE_ZOOM 11 // Box In/Out in MS-PPT Specs
#define PPT_TRANSITION_TYPE_SPLIT 13
// effects, new in xp
@@ -57,7 +57,7 @@ namespace ppt
#define PPT_TRANSITION_TYPE_PUSH 20
#define PPT_TRANSITION_TYPE_COMB 21
#define PPT_TRANSITION_TYPE_NEWSFLASH 22
-#define PPT_TRANSITION_TYPE_SMOOTHFADE 23
+#define PPT_TRANSITION_TYPE_SMOOTHFADE 23 // Alpha Fade in MS-PPT Specs
#define PPT_TRANSITION_TYPE_WHEEL 26
#define PPT_TRANSITION_TYPE_CIRCLE 27
commit 8a2af3ca02c8f50ee1e016b99483ad5e1d03cec2
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Thu Nov 5 21:44:28 2015 +0100
pptx: export slide transition direction parameter correctly
The direction of wipe transition was not exported correctly, left
was right, right was left, up was down and down was up. :)
Change-Id: Ibc709476c03d6c96204fb5fe91d37823a185fa97
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index aacdf02..2c42be6 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -446,18 +446,19 @@ const char* PowerPointExport::GetSideDirection( sal_uInt8 nDirection )
{
const char* pDirection = NULL;
- switch( nDirection ) {
+ switch(nDirection)
+ {
case 0:
- pDirection = "r";
+ pDirection = "l";
break;
case 1:
- pDirection = "d";
+ pDirection = "u";
break;
case 2:
- pDirection = "l";
+ pDirection = "r";
break;
case 3:
- pDirection = "u";
+ pDirection = "d";
break;
}
@@ -640,6 +641,7 @@ void PowerPointExport::WriteTransition( FSHelperPtr pFS )
case PPT_TRANSITION_TYPE_NONE:
default:
nTransition = 0;
+ break;
}
if( nTransition )
commit e4685adea31e2494f2991b321c4ce58049c7bc9f
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Thu Nov 5 21:41:43 2015 +0100
get rid of c-style cast
Change-Id: I88173997c2db33b2e67bde77cd48c6753b12ae9e
diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx
index 4be6576..f4b16e8 100644
--- a/sd/source/filter/eppt/pptexanimations.cxx
+++ b/sd/source/filter/eppt/pptexanimations.cxx
@@ -151,7 +151,7 @@ sal_uInt32 AnimationExporter::TranslatePresetSubType( const sal_uInt32 nPresetCl
sal_uInt32 nPresetSubType = 0;
bool bTranslated = false;
- if ( ( nPresetClass == (sal_uInt32)EffectPresetClass::ENTRANCE ) || ( nPresetClass == (sal_uInt32)EffectPresetClass::EXIT ) )
+ if ( ( nPresetClass == sal_uInt32(EffectPresetClass::ENTRANCE) ) || ( nPresetClass == sal_uInt32(EffectPresetClass::EXIT) ) )
{
if ( nPresetId != 21 )
{
commit 7cacc3326e1409fc245bc7d8d9804966de28e549
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date: Thu Nov 5 21:40:09 2015 +0100
pptx: export/import newsflash and comb slide transitions + test
Change-Id: I8ec2e1bc6d6f46f741252085f68edc6c284124b6
diff --git a/sd/qa/unit/data/AllTransitions.odp b/sd/qa/unit/data/AllTransitions.odp
new file mode 100644
index 0000000..fa2eced
Binary files /dev/null and b/sd/qa/unit/data/AllTransitions.odp differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 2fcec93..c74ac8f 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -46,6 +46,8 @@
#include <com/sun/star/animations/XAnimationNodeSupplier.hpp>
#include <com/sun/star/animations/XAnimationNode.hpp>
#include <com/sun/star/animations/XAnimate.hpp>
+#include <com/sun/star/animations/TransitionType.hpp>
+#include <com/sun/star/animations/TransitionSubType.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/chart/XChartDocument.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
@@ -67,6 +69,7 @@
#include <com/sun/star/table/XTable.hpp>
#include <com/sun/star/table/XMergeableCell.hpp>
+
#include <svx/svdotable.hxx>
#include <config_features.h>
@@ -127,6 +130,7 @@ public:
void testBulletMarginAndIndentation();
void testParaMarginAndindentation();
void testTransparentBackground();
+ void testExportTransitionsPPTX();
void testFdo90607();
void testTdf91378();
@@ -168,6 +172,7 @@ public:
CPPUNIT_TEST(testBulletMarginAndIndentation);
CPPUNIT_TEST(testParaMarginAndindentation);
CPPUNIT_TEST(testTransparentBackground);
+ CPPUNIT_TEST(testExportTransitionsPPTX);
CPPUNIT_TEST(testTdf91378);
#if !defined WNT
@@ -1342,6 +1347,46 @@ void SdExportTest::testTdf80224()
xDocShRef->DoClose();
}
+bool checkTransitionOnPage(uno::Reference<drawing::XDrawPagesSupplier> xDoc, sal_Int32 nSlideNumber,
+ sal_Int16 nExpectedTransitionType, sal_Int16 nExpectedTransitionSubType)
+{
+ sal_Int32 nSlideIndex = nSlideNumber - 1;
+
+ CPPUNIT_ASSERT_MESSAGE("Slide/Page index out of range", nSlideIndex < xDoc->getDrawPages()->getCount());
+
+ uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(nSlideIndex), uno::UNO_QUERY_THROW);
+ uno::Reference<beans::XPropertySet> xPropSet(xPage, uno::UNO_QUERY);
+ uno::Any aAny;
+
+ aAny = xPropSet->getPropertyValue(OUString("TransitionType"));
+ sal_Int16 nTransitionType = 0;
+ if ((aAny >>= nTransitionType) == false)
+ return false;
+
+ aAny = xPropSet->getPropertyValue(OUString("TransitionSubtype"));
+ sal_Int16 nTransitionSubtype = 0;
+ if ((aAny >>= nTransitionSubtype) == false)
+ return false;
+
+ if (nExpectedTransitionType != nTransitionType)
+ return false;
+ if (nExpectedTransitionSubType != nTransitionSubtype)
+ return false;
+
+ return true;
+}
+
+void SdExportTest::testExportTransitionsPPTX()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/AllTransitions.odp"), ODP);
+ xDocShRef = saveAndReload(xDocShRef, PPTX);
+ uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW);
+
+ checkTransitionOnPage(xDoc, 71, css::animations::TransitionType::ZOOM, css::animations::TransitionSubType::ROTATEIN);
+ checkTransitionOnPage(xDoc, 41, css::animations::TransitionType::PUSHWIPE, css::animations::TransitionSubType::COMBHORIZONTAL);
+ checkTransitionOnPage(xDoc, 42, css::animations::TransitionType::PUSHWIPE, css::animations::TransitionSubType::COMBVERTICAL);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx b/sd/source/filter/eppt/pptx-epptbase.cxx
index fbcf25c..75931b2 100644
--- a/sd/source/filter/eppt/pptx-epptbase.cxx
+++ b/sd/source/filter/eppt/pptx-epptbase.cxx
@@ -771,22 +771,25 @@ sal_Int8 PPTWriterBase::GetTransition( sal_Int16 nTransitionType, sal_Int16 nTra
nPPTTransitionType = PPT_TRANSITION_TYPE_FADE;
}
break;
- case PPT_TRANSITION_TYPE_COMB :
- {
- nPPTTransitionType = PPT_TRANSITION_TYPE_COMB;
- if ( nTransitionSubtype == TransitionSubType::COMBVERTICAL )
- nDirection++;
- }
- break;
case TransitionType::PUSHWIPE :
{
- nPPTTransitionType = PPT_TRANSITION_TYPE_PUSH;
- switch( nTransitionSubtype )
+ if (nTransitionSubtype == TransitionSubType::COMBVERTICAL ||
+ nTransitionSubtype == TransitionSubType::COMBHORIZONTAL)
+ {
+ nPPTTransitionType = PPT_TRANSITION_TYPE_COMB;
+ }
+ else
+ {
+ nPPTTransitionType = PPT_TRANSITION_TYPE_PUSH;
+ }
+ switch (nTransitionSubtype)
{
- case TransitionSubType::FROMRIGHT: nDirection = 0; break;
- case TransitionSubType::FROMBOTTOM: nDirection = 1; break;
- case TransitionSubType::FROMLEFT: nDirection = 2; break;
- case TransitionSubType::FROMTOP: nDirection = 3; break;
+ case TransitionSubType::FROMRIGHT: nDirection = 0; break;
+ case TransitionSubType::FROMBOTTOM: nDirection = 1; break;
+ case TransitionSubType::FROMLEFT: nDirection = 2; break;
+ case TransitionSubType::FROMTOP: nDirection = 3; break;
+ case TransitionSubType::COMBHORIZONTAL: nDirection = 0; break;
+ case TransitionSubType::COMBVERTICAL: nDirection = 1; break;
}
}
break;
@@ -831,6 +834,18 @@ sal_Int8 PPTWriterBase::GetTransition( sal_Int16 nTransitionType, sal_Int16 nTra
}
}
break;
+ case TransitionType::ZOOM:
+ {
+ switch(nTransitionSubtype)
+ {
+ case TransitionSubType::ROTATEIN:
+ nPPTTransitionType = PPT_TRANSITION_TYPE_NEWSFLASH;
+ break;
+ default:
+ break;
+ }
+ }
+ break;
}
return nPPTTransitionType;
More information about the Libreoffice-commits
mailing list