[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - cui/uiconfig

2020-08-03 Thread Markus Mohrhard (via logerrit)
 cui/uiconfig/ui/movemenu.ui |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 23397ecc1ee69462fbe0639c5ea105e2c0ec9a45
Author: Markus Mohrhard 
AuthorDate: Sat Aug 1 23:01:52 2020 +0800
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Aug 4 03:47:49 2020 +0200

correctly mark the "New menu" dialog as modal

The dialog is called from a modal dialog which means a modeless dialog
does not make sense. Some of our internal dialog tracking code is confused
by that case which confused the UI tests.

Change-Id: I705877e8a751c55bfbd00ddeaf18ab86c95321c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99944
Tested-by: Markus Mohrhard 
Reviewed-by: Markus Mohrhard 
(cherry picked from commit 3258603e8850900e04cecffb1113b833c4c76fd9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99929
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/cui/uiconfig/ui/movemenu.ui b/cui/uiconfig/ui/movemenu.ui
index 7bb5be63309c..18a0712e67c1 100644
--- a/cui/uiconfig/ui/movemenu.ui
+++ b/cui/uiconfig/ui/movemenu.ui
@@ -25,6 +25,7 @@
 6
 New Menu
 dialog
+True
 
   
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: cui/uiconfig

2020-08-03 Thread Markus Mohrhard (via logerrit)
 cui/uiconfig/ui/movemenu.ui |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 3258603e8850900e04cecffb1113b833c4c76fd9
Author: Markus Mohrhard 
AuthorDate: Sat Aug 1 23:01:52 2020 +0800
Commit: Markus Mohrhard 
CommitDate: Mon Aug 3 21:31:26 2020 +0200

correctly mark the "New menu" dialog as modal

The dialog is called from a modal dialog which means a modeless dialog
does not make sense. Some of our internal dialog tracking code is confused
by that case which confused the UI tests.

Change-Id: I705877e8a751c55bfbd00ddeaf18ab86c95321c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99944
Tested-by: Markus Mohrhard 
Reviewed-by: Markus Mohrhard 

diff --git a/cui/uiconfig/ui/movemenu.ui b/cui/uiconfig/ui/movemenu.ui
index 7bb5be63309c..18a0712e67c1 100644
--- a/cui/uiconfig/ui/movemenu.ui
+++ b/cui/uiconfig/ui/movemenu.ui
@@ -25,6 +25,7 @@
 6
 New Menu
 dialog
+True
 
   
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: download.lst external/cppunit

2019-12-24 Thread Markus Mohrhard (via logerrit)
 download.lst|4 
 external/cppunit/0001-Unconditionally-use-C-11-noreturn.patch.1 |   57 
--
 external/cppunit/UnpackedTarball_cppunit.mk |6 -
 external/cppunit/gcc9.patch.0   |   11 -
 external/cppunit/windows.patch  |   12 +-
 5 files changed, 9 insertions(+), 81 deletions(-)

New commits:
commit ffe9ff2cf63112ac04a695740a5637f25c16abe8
Author: Markus Mohrhard 
AuthorDate: Fri Dec 20 01:28:54 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Tue Dec 24 20:45:53 2019 +0100

update cppunit to 1.15.1

Change-Id: Ic27a77addb409a8d63ea44136a8d2410ee40c4d2
Reviewed-on: https://gerrit.libreoffice.org/85539
Reviewed-by: Markus Mohrhard 
Tested-by: Markus Mohrhard 

diff --git a/download.lst b/download.lst
index fdd0b866c373..690f43cc419d 100644
--- a/download.lst
+++ b/download.lst
@@ -25,8 +25,8 @@ export LIBCMIS_SHA256SUM := 
d7b18d9602190e10d437f8a964a32e983afd57e2db316a07d874
 export LIBCMIS_TARBALL := libcmis-0.5.2.tar.xz
 export COINMP_SHA256SUM := 
86c798780b9e1f5921fe4efe651a93cb420623b45aa1fdff57af8c37f116113f
 export COINMP_TARBALL := CoinMP-1.7.6.tgz
-export CPPUNIT_SHA256SUM := 
3d569869d27b48860210c758c4f313082103a5e58219a7669b52bfd29d674780
-export CPPUNIT_TARBALL := cppunit-1.14.0.tar.gz
+export CPPUNIT_SHA256SUM := 
89c5c6665337f56fd2db36bc3805a5619709d51fb136e51937072f63fcc717a7
+export CPPUNIT_TARBALL := cppunit-1.15.1.tar.gz
 export CT2N_SHA256SUM := 
71b238efd2734be9800af07566daea8d6685aeed28db5eb5fa0e6453f4d85de3
 export CT2N_TARBALL := 
1f467e5bb703f12cbbb09d5cf67ecf4a-converttexttonumber-1-5-0.oxt
 export CURL_SHA256SUM := 
7766d263929404f693905b5e5222aa0f2bdf8c66ab4b8758f0c0820a42b966cd
diff --git a/external/cppunit/0001-Unconditionally-use-C-11-noreturn.patch.1 
b/external/cppunit/0001-Unconditionally-use-C-11-noreturn.patch.1
deleted file mode 100644
index 70ede229a3e6..
--- a/external/cppunit/0001-Unconditionally-use-C-11-noreturn.patch.1
+++ /dev/null
@@ -1,57 +0,0 @@
-From c955b1041b9e3ebe7ee8a620340b78bddc820682 Mon Sep 17 00:00:00 2001
-From: Stephan Bergmann 
-Date: Fri, 1 Feb 2019 13:37:59 +0100
-Subject: [PATCH] Unconditionally use C++11 [[noreturn]]
-
-This helps avoid issues like  "Avoid
--Werror,-Wimplicit-fallthrough with clang-cl ...where CPPUNIT_FAIL is marked as
-noreturn only for __GNUC__".
-
-Change-Id: Idb33af7375f103f2dd7a7b4c3dbf20ce731b17ad

- include/cppunit/Asserter.h | 12 +++-
- 1 file changed, 3 insertions(+), 9 deletions(-)
-
-diff --git a/include/cppunit/Asserter.h b/include/cppunit/Asserter.h
-index 3321b87..dd39ead 100644
 a/include/cppunit/Asserter.h
-+++ b/include/cppunit/Asserter.h
-@@ -43,23 +43,17 @@ class Message;
-  * \endcode
-  */
- 
--#if defined __GNUC__
--#   define NORETURN __attribute__((noreturn))
--#else
--#   define NORETURN
--#endif
--
- struct Asserter
- {
-   /*! \brief Throws a Exception with the specified message and location.
-*/
--  NORETURN static void CPPUNIT_API fail( const Message , 
-+  [[noreturn]] static void CPPUNIT_API fail( const Message , 
- const SourceLine  = SourceLine() );
- 
-   /*! \brief Throws a Exception with the specified message and location.
-* \deprecated Use fail( Message, SourceLine ) instead.
-*/
--  NORETURN static void CPPUNIT_API fail( std::string message, 
-+  [[noreturn]] static void CPPUNIT_API fail( std::string message, 
- const SourceLine  = SourceLine() );
- 
-   /*! \brief Throws a Exception with the specified message and location.
-@@ -165,7 +159,7 @@ struct Asserter
-*  what are the differences between the expected 
and actual value.
-* \param shortDescription Short description for the failure message.
-*/
--  NORETURN static void CPPUNIT_API failNotEqual( std::string expected, 
-+  [[noreturn]] static void CPPUNIT_API failNotEqual( std::string expected, 
- std::string actual, 
- const SourceLine ,
- const AdditionalMessage 
 = AdditionalMessage(),
--- 
-2.20.1
-
diff --git a/external/cppunit/UnpackedTarball_cppunit.mk 
b/external/cppunit/UnpackedTarball_cppunit.mk
index 649ba8fc4063..24f75b43415f 100644
--- a/external/cppunit/UnpackedTarball_cppunit.mk
+++ b/external/cppunit/UnpackedTarball_cppunit.mk
@@ -13,18 +13,12 @@ $(eval $(call 
gb_UnpackedTarball_set_tarball,cppunit,$(CPPUNIT_TARBALL),,cppunit
 
 $(eval $(call gb_UnpackedTarball_update_autoconf_configs,cppunit))
 
-# gcc9.patch.0 addressed upstream with  
"Avoid GCC 9
-#  -Wdeprecated-copy":
-# 0001-Unconditionally-use-C-11-noreturn.patch.1 upstream at 

[Libreoffice-commits] core.git: sc/uiconfig

2019-12-20 Thread Markus Mohrhard (via logerrit)
 sc/uiconfig/scalc/menubar/menubar.xml |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 24939a5b43b9fe889c3aace027c668666ff61987
Author: Markus Mohrhard 
AuthorDate: Fri Dec 20 02:56:20 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Fri Dec 20 19:38:53 2019 +0100

the data provider feature is not ready for production

Change-Id: Idca4b9dbde4fed2524c186851cb44d95953181ec
Reviewed-on: https://gerrit.libreoffice.org/85541
Reviewed-by: Markus Mohrhard 
Tested-by: Markus Mohrhard 

diff --git a/sc/uiconfig/scalc/menubar/menubar.xml 
b/sc/uiconfig/scalc/menubar/menubar.xml
index d1d8069b50e2..d029db790622 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -642,8 +642,6 @@
   
   
   
-  
-  
   
   
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/chart-style-experiment-markus' - chart2/source

2019-08-27 Thread Markus Mohrhard (via logerrit)
 chart2/source/inc/OPropertySet.hxx   |2 ++
 chart2/source/tools/OPropertySet.cxx |   20 
 2 files changed, 18 insertions(+), 4 deletions(-)

New commits:
commit 7c5dd833e1f62a1cae9ce4ae804146032bd5e841
Author: Markus Mohrhard 
AuthorDate: Wed Aug 28 00:35:03 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Wed Aug 28 00:35:03 2019 +0800

the default value now needs to come from the style if the style is available

Change-Id: I54b3563aabcde71e7bcddacc8a7a5b1a9eb70ccd

diff --git a/chart2/source/inc/OPropertySet.hxx 
b/chart2/source/inc/OPropertySet.hxx
index 12a55c677661..50e40b9fa082 100644
--- a/chart2/source/inc/OPropertySet.hxx
+++ b/chart2/source/inc/OPropertySet.hxx
@@ -69,6 +69,8 @@ protected:
  */
 virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const = 0;
 
+css::uno::Any GetDefault(sal_Int32 nHandle) const;
+
 /** The InfoHelper table contains all property names and types of
 this object.
 
diff --git a/chart2/source/tools/OPropertySet.cxx 
b/chart2/source/tools/OPropertySet.cxx
index fe4c69700fad..33ed2bcb0a53 100644
--- a/chart2/source/tools/OPropertySet.cxx
+++ b/chart2/source/tools/OPropertySet.cxx
@@ -105,6 +105,18 @@ Sequence< sal_Int8 > SAL_CALL
 return css::uno::Sequence();
 }
 
+Any OPropertySet::GetDefault(sal_Int32 nHandle) const
+{
+Reference xStyle = m_pImplProperties->GetStyle();
+if (xStyle.is())
+{
+css::uno::Reference 
xStylePropSet(xStyle, css::uno::UNO_QUERY);
+return xStylePropSet->getFastPropertyValue(nHandle);
+}
+
+return GetDefaultValue(nHandle);
+}
+
 //  XPropertyState 
 beans::PropertyState SAL_CALL
 OPropertySet::getPropertyState( const OUString& PropertyName )
@@ -143,7 +155,7 @@ Any SAL_CALL
 {
 cppu::IPropertyArrayHelper & rPH = getInfoHelper();
 
-return GetDefaultValue( rPH.getHandleByName( aPropertyName ) );
+return GetDefault( rPH.getHandleByName( aPropertyName ) );
 }
 
 //  XMultiPropertyStates 
@@ -184,7 +196,7 @@ Sequence< Any > SAL_CALL
 
 for( ; nI < nElements; ++nI )
 {
-pResultArray[ nI ] = GetDefaultValue(
+pResultArray[ nI ] = GetDefault(
 rPH.getHandleByName( aPropertyNames[ nI ] ));
 }
 
@@ -242,7 +254,7 @@ void SAL_CALL OPropertySet::setFastPropertyValue_NoBroadcast
 Any aDefault;
 try
 {
-aDefault = GetDefaultValue( nHandle );
+aDefault = GetDefault( nHandle );
 }
 catch( const beans::UnknownPropertyException& )
 {
@@ -322,7 +334,7 @@ void SAL_CALL OPropertySet::getFastPropertyValue
 // => take the default value
 try
 {
-rValue = GetDefaultValue( nHandle );
+rValue = GetDefault( nHandle );
 }
 catch( const beans::UnknownPropertyException& )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: 28 commits - include/vcl sc/source sd/source sfx2/source sw/source uitest/ui_logger_dsl vcl/source

2019-08-19 Thread Markus Mohrhard (via logerrit)
 include/vcl/uitest/logger.hxx  |   44 +
 sc/source/core/data/document.cxx   |   18 
 sc/source/ui/view/viewdata.cxx |   20 
 sc/source/ui/view/viewfun2.cxx |   26 
 sc/source/ui/view/viewfun3.cxx |   34 
 sc/source/ui/view/viewfunc.cxx |   28 
 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx |   29 
 sd/source/ui/slidesorter/model/SlideSorterModel.cxx|   22 
 sfx2/source/control/unoctitm.cxx   |4 
 sw/source/core/edit/edtab.cxx  |   20 
 sw/source/uibase/dochdl/swdtflvr.cxx   |   24 
 sw/source/uibase/wrtsh/wrtsh1.cxx  |   17 
 uitest/ui_logger_dsl/General_commands.tx   |   29 
 uitest/ui_logger_dsl/Special_commands.tx   |  209 ++
 uitest/ui_logger_dsl/UI_Object_commands.tx |   65 +
 uitest/ui_logger_dsl/dialog_commands.tx|   24 
 uitest/ui_logger_dsl/dsl_core.py   |  581 +
 uitest/ui_logger_dsl/example.ul|   34 
 uitest/ui_logger_dsl/starter_commands.tx   |   13 
 uitest/ui_logger_dsl/type_options.tx   |9 
 uitest/ui_logger_dsl/ui_logger_dsl_grammar.tx  |   29 
 uitest/ui_logger_dsl/uno_commands.tx   |   17 
 vcl/source/uitest/logger.cxx   |  359 +-
 vcl/source/uitest/uiobject.cxx |  132 +++
 vcl/source/window/dialog.cxx   |6 
 25 files changed, 1711 insertions(+), 82 deletions(-)

New commits:
commit 739c370522df4d48898b924e3c29957054f71a78
Author: Markus Mohrhard 
AuthorDate: Mon Aug 19 01:30:26 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Mon Aug 19 22:56:40 2019 +0800

uitest: pass OUString by const reference and formatting fixes

Change-Id: I55eca745a84998c74e2d925ed53af20382d98289

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index fd996eb3d4cb..841cb3574213 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -109,21 +109,6 @@ using ::std::set;
 
 namespace {
 
-void collectUIInformation(const std::map& 
aParameters,const OUString action)
-{
-EventDescription aDescription;
-aDescription.aID = "grid_window";
-aDescription.aAction = action;
-aDescription.aParameters = aParameters;
-aDescription.aParent = "MainWindow";
-aDescription.aKeyWord = "ScGridWinUIObject";
-
-UITestLogger::getInstance().logEvent(aDescription);
-}
-}
-
-namespace {
-
 std::pair getMarkedTableRange(const 
std::vector& rTables, const ScMarkData& rMark)
 {
 SCTAB nTabStart = MAXTAB;
@@ -145,6 +130,18 @@ std::pair getMarkedTableRange(const 
std::vector&
 return std::pair(nTabStart,nTabEnd);
 }
 
+void collectUIInformation(const std::map& aParameters, 
const OUString& rAction)
+{
+EventDescription aDescription;
+aDescription.aID = "grid_window";
+aDescription.aAction = rAction;
+aDescription.aParameters = aParameters;
+aDescription.aParent = "MainWindow";
+aDescription.aKeyWord = "ScGridWinUIObject";
+
+UITestLogger::getInstance().logEvent(aDescription);
+}
+
 }
 
 struct ScDefaultAttr
@@ -913,7 +910,9 @@ bool ScDocument::RenameTab( SCTAB nTab, const OUString& 
rName, bool bExternalDoc
 }
 }
 }
-collectUIInformation({{"NewName",rName}},"Rename_Sheet");
+
+collectUIInformation({{"NewName", rName}}, "Rename_Sheet");
+
 return bValid;
 }
 
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 56865508373a..e15ca40404d6 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -91,11 +91,11 @@ void lcl_LOKRemoveWindow(ScTabViewShell* pTabViewShell, 
ScSplitPos eWhich)
 
 namespace {
 
-void collectUIInformation(const std::map& 
aParameters,const OUString action)
+void collectUIInformation(const std::map& aParameters, 
const OUString& rAction)
 {
 EventDescription aDescription;
 aDescription.aID = "grid_window";
-aDescription.aAction = action;
+aDescription.aAction = rAction;
 aDescription.aParameters = aParameters;
 aDescription.aParent = "MainWindow";
 aDescription.aKeyWord = "ScGridWinUIObject";
@@ -857,7 +857,8 @@ void ScViewData::InsertTab( SCTAB nTab )
 
 UpdateCurrentTab();
 mpMarkData->InsertTab( nTab );
-collectUIInformation({{}},"InsertTab");
+
+collectUIInformation({{}}, "InsertTab");
 }
 
 void ScViewData::InsertTabs( SCTAB nTab, SCTAB nNewSheets )
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 831e4c7dd8ee..ac926e722bb5 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -94,11 +94,11 @@ using ::editeng::SvxBorderLine;
 
 namespace {
 
-void collectUIInformation(const std::map& 

[Libreoffice-commits] core.git: Branch 'feature/gsoc-uitest-2019' - include/vcl vcl/source

2019-08-18 Thread Markus Mohrhard (via logerrit)
Rebased ref, commits from common ancestor:
commit 68973ed3d9d5e125fc7142e512c10d97dd41b865
Author: Markus Mohrhard 
AuthorDate: Sun Aug 18 23:34:32 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Mon Aug 19 00:35:10 2019 +0800

uitest: fixed for formatting and plugin stringconstant

Change-Id: Id657c19223f20d1175f9a774357e8b1f11344fdf

diff --git a/include/vcl/uitest/logger.hxx b/include/vcl/uitest/logger.hxx
index 6c8c5008541a..450285c5c247 100644
--- a/include/vcl/uitest/logger.hxx
+++ b/include/vcl/uitest/logger.hxx
@@ -15,10 +15,32 @@
 #include 
 #include 
 
-namespace com { namespace sun { namespace star {
-namespace beans { struct PropertyValue; }
-} } }
-namespace com { namespace sun { namespace star { namespace uno { template 
 class Sequence; } } } }
+namespace com
+{
+namespace sun
+{
+namespace star
+{
+namespace beans
+{
+struct PropertyValue;
+}
+}
+}
+}
+namespace com
+{
+namespace sun
+{
+namespace star
+{
+namespace uno
+{
+template  class Sequence;
+}
+}
+}
+}
 
 struct EventDescription;
 class Control;
@@ -27,7 +49,6 @@ class KeyEvent;
 class UITEST_DLLPUBLIC UITestLogger
 {
 private:
-
 SvFileStream maStream;
 
 bool mbValid;
@@ -35,29 +56,24 @@ private:
 OUString app_name;
 
 public:
-
 UITestLogger();
 
-void logCommand(const OUString& rAction, const 
css::uno::Sequence& rArgs);
+void logCommand(const OUString& rAction,
+const css::uno::Sequence& 
rArgs);
 
-void logAction(VclPtr const & xUIElement, VclEventId nEvent);
+void logAction(VclPtr const& xUIElement, VclEventId nEvent);
 
 void log(const OUString& rString);
 
-void logKeyInput(VclPtr const & xUIElement, const KeyEvent& 
rEvent);
+void logKeyInput(VclPtr const& xUIElement, const KeyEvent& 
rEvent);
 
 void logEvent(const EventDescription& rDescription);
 
 static UITestLogger& getInstance();
 
-void setAppName(OUString name){
-app_name=name;
-}
-
-OUString getAppName(){
-return app_name;
-}
+void setAppName(OUString name) { app_name = name; }
 
+OUString getAppName() { return app_name; }
 };
 
 #endif
diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx
index 0ecd673f9879..03c439fcbd7c 100644
--- a/vcl/source/uitest/logger.cxx
+++ b/vcl/source/uitest/logger.cxx
@@ -20,9 +20,9 @@
 #include 
 #include 
 
-namespace{
-
-bool isDialogWindow(vcl::Window const * pWindow)
+namespace
+{
+bool isDialogWindow(vcl::Window const* pWindow)
 {
 WindowType nType = pWindow->GetType();
 // DIALOG to MODALDIALOG
@@ -39,7 +39,7 @@ bool isDialogWindow(vcl::Window const * pWindow)
 return false;
 }
 
-bool isTopWindow(vcl::Window const * pWindow)
+bool isTopWindow(vcl::Window const* pWindow)
 {
 WindowType eType = pWindow->GetType();
 if (eType == WindowType::FLOATINGWINDOW)
@@ -60,17 +60,16 @@ vcl::Window* get_top_parent(vcl::Window* pWindow)
 
 return get_top_parent(pParent);
 }
-
-
 }
-UITestLogger::UITestLogger():
-maStream(),
-mbValid(false)
+UITestLogger::UITestLogger()
+: maStream()
+, mbValid(false)
 {
 static const char* pFile = std::getenv("LO_COLLECT_UIINFO");
 if (pFile)
 {
-OUString aDirPath("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" 
SAL_CONFIGFILE("bootstrap") ":UserInstallation}/uitest/");
+OUString aDirPath("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER
+  "/" SAL_CONFIGFILE("bootstrap") 
":UserInstallation}/uitest/");
 rtl::Bootstrap::expandMacros(aDirPath);
 osl::Directory::createPath(aDirPath);
 OUString aFilePath = aDirPath + OUString::fromUtf8(pFile);
@@ -80,7 +79,8 @@ UITestLogger::UITestLogger():
 }
 }
 
-void UITestLogger::logCommand(const OUString& rAction, const 
css::uno::Sequence< css::beans::PropertyValue >& rArgs)
+void UITestLogger::logCommand(const OUString& rAction,
+  const 
css::uno::Sequence& rArgs)
 {
 if (!mbValid)
 return;
@@ -126,10 +126,10 @@ void UITestLogger::logCommand(const OUString& rAction, 
const css::uno::Sequence<
 maStream.WriteLine(OUStringToOString(aCommand, RTL_TEXTENCODING_UTF8));
 }
 
-namespace {
-
+namespace
+{
 // most likely this should be recursive
-bool child_windows_have_focus(VclPtr const & xUIElement)
+bool child_windows_have_focus(VclPtr const& xUIElement)
 {
 sal_Int32 nCount = xUIElement->GetChildCount();
 for (sal_Int32 i = 0; i < nCount; ++i)
@@ -144,10 +144,9 @@ bool child_windows_have_focus(VclPtr const & 
xUIElement)
 }
 return false;
 }
-
 }
 
-void UITestLogger::logAction(VclPtr const & xUIElement, VclEventId 
nEvent)
+void UITestLogger::logAction(VclPtr const& xUIElement, VclEventId 
nEvent)
 {
 if (!mbValid)
 return;
@@ -177,14 +176,14 @@ void UITestLogger::log(const OUString& rString)
 maStream.WriteLine(OUStringToOString(rString, RTL_TEXTENCODING_UTF8));
 }
 
-void UITestLogger::logKeyInput(VclPtr const & xUIElement, const 
KeyEvent& 

[Libreoffice-commits] core.git: Branch 'feature/gsoc-uitest-2019' - include/vcl vcl/source

2019-08-18 Thread Markus Mohrhard (via logerrit)
Rebased ref, commits from common ancestor:
commit 94e98f8fae5283eecdb56dc84c56739fc9d7d75e
Author: Markus Mohrhard 
AuthorDate: Sun Aug 18 23:34:32 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Mon Aug 19 00:16:37 2019 +0800

uitest: fixed for formatting and plugin stringconstant

Change-Id: Id657c19223f20d1175f9a774357e8b1f11344fdf

diff --git a/include/vcl/uitest/logger.hxx b/include/vcl/uitest/logger.hxx
index 6c8c5008541a..450285c5c247 100644
--- a/include/vcl/uitest/logger.hxx
+++ b/include/vcl/uitest/logger.hxx
@@ -15,10 +15,32 @@
 #include 
 #include 
 
-namespace com { namespace sun { namespace star {
-namespace beans { struct PropertyValue; }
-} } }
-namespace com { namespace sun { namespace star { namespace uno { template 
 class Sequence; } } } }
+namespace com
+{
+namespace sun
+{
+namespace star
+{
+namespace beans
+{
+struct PropertyValue;
+}
+}
+}
+}
+namespace com
+{
+namespace sun
+{
+namespace star
+{
+namespace uno
+{
+template  class Sequence;
+}
+}
+}
+}
 
 struct EventDescription;
 class Control;
@@ -27,7 +49,6 @@ class KeyEvent;
 class UITEST_DLLPUBLIC UITestLogger
 {
 private:
-
 SvFileStream maStream;
 
 bool mbValid;
@@ -35,29 +56,24 @@ private:
 OUString app_name;
 
 public:
-
 UITestLogger();
 
-void logCommand(const OUString& rAction, const 
css::uno::Sequence& rArgs);
+void logCommand(const OUString& rAction,
+const css::uno::Sequence& 
rArgs);
 
-void logAction(VclPtr const & xUIElement, VclEventId nEvent);
+void logAction(VclPtr const& xUIElement, VclEventId nEvent);
 
 void log(const OUString& rString);
 
-void logKeyInput(VclPtr const & xUIElement, const KeyEvent& 
rEvent);
+void logKeyInput(VclPtr const& xUIElement, const KeyEvent& 
rEvent);
 
 void logEvent(const EventDescription& rDescription);
 
 static UITestLogger& getInstance();
 
-void setAppName(OUString name){
-app_name=name;
-}
-
-OUString getAppName(){
-return app_name;
-}
+void setAppName(OUString name) { app_name = name; }
 
+OUString getAppName() { return app_name; }
 };
 
 #endif
diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx
index 0ecd673f9879..03c439fcbd7c 100644
--- a/vcl/source/uitest/logger.cxx
+++ b/vcl/source/uitest/logger.cxx
@@ -20,9 +20,9 @@
 #include 
 #include 
 
-namespace{
-
-bool isDialogWindow(vcl::Window const * pWindow)
+namespace
+{
+bool isDialogWindow(vcl::Window const* pWindow)
 {
 WindowType nType = pWindow->GetType();
 // DIALOG to MODALDIALOG
@@ -39,7 +39,7 @@ bool isDialogWindow(vcl::Window const * pWindow)
 return false;
 }
 
-bool isTopWindow(vcl::Window const * pWindow)
+bool isTopWindow(vcl::Window const* pWindow)
 {
 WindowType eType = pWindow->GetType();
 if (eType == WindowType::FLOATINGWINDOW)
@@ -60,17 +60,16 @@ vcl::Window* get_top_parent(vcl::Window* pWindow)
 
 return get_top_parent(pParent);
 }
-
-
 }
-UITestLogger::UITestLogger():
-maStream(),
-mbValid(false)
+UITestLogger::UITestLogger()
+: maStream()
+, mbValid(false)
 {
 static const char* pFile = std::getenv("LO_COLLECT_UIINFO");
 if (pFile)
 {
-OUString aDirPath("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" 
SAL_CONFIGFILE("bootstrap") ":UserInstallation}/uitest/");
+OUString aDirPath("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER
+  "/" SAL_CONFIGFILE("bootstrap") 
":UserInstallation}/uitest/");
 rtl::Bootstrap::expandMacros(aDirPath);
 osl::Directory::createPath(aDirPath);
 OUString aFilePath = aDirPath + OUString::fromUtf8(pFile);
@@ -80,7 +79,8 @@ UITestLogger::UITestLogger():
 }
 }
 
-void UITestLogger::logCommand(const OUString& rAction, const 
css::uno::Sequence< css::beans::PropertyValue >& rArgs)
+void UITestLogger::logCommand(const OUString& rAction,
+  const 
css::uno::Sequence& rArgs)
 {
 if (!mbValid)
 return;
@@ -126,10 +126,10 @@ void UITestLogger::logCommand(const OUString& rAction, 
const css::uno::Sequence<
 maStream.WriteLine(OUStringToOString(aCommand, RTL_TEXTENCODING_UTF8));
 }
 
-namespace {
-
+namespace
+{
 // most likely this should be recursive
-bool child_windows_have_focus(VclPtr const & xUIElement)
+bool child_windows_have_focus(VclPtr const& xUIElement)
 {
 sal_Int32 nCount = xUIElement->GetChildCount();
 for (sal_Int32 i = 0; i < nCount; ++i)
@@ -144,10 +144,9 @@ bool child_windows_have_focus(VclPtr const & 
xUIElement)
 }
 return false;
 }
-
 }
 
-void UITestLogger::logAction(VclPtr const & xUIElement, VclEventId 
nEvent)
+void UITestLogger::logAction(VclPtr const& xUIElement, VclEventId 
nEvent)
 {
 if (!mbValid)
 return;
@@ -177,14 +176,14 @@ void UITestLogger::log(const OUString& rString)
 maStream.WriteLine(OUStringToOString(rString, RTL_TEXTENCODING_UTF8));
 }
 
-void UITestLogger::logKeyInput(VclPtr const & xUIElement, const 
KeyEvent& 

[Libreoffice-commits] core.git: Branch 'feature/gsoc-uitest-2019' - include/vcl vcl/source

2019-08-18 Thread Markus Mohrhard (via logerrit)
 include/vcl/uitest/logger.hxx |   48 +++--
 vcl/source/uitest/logger.cxx  |  344 +++---
 2 files changed, 227 insertions(+), 165 deletions(-)

New commits:
commit e30c3c783b5d610407e63fbfe991552289f732d5
Author: Markus Mohrhard 
AuthorDate: Sun Aug 18 23:34:32 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Sun Aug 18 23:36:09 2019 +0800

uitest: fixed for formatting and plugin stringconstant

Change-Id: Id657c19223f20d1175f9a774357e8b1f11344fdf

diff --git a/include/vcl/uitest/logger.hxx b/include/vcl/uitest/logger.hxx
index 6c8c5008541a..450285c5c247 100644
--- a/include/vcl/uitest/logger.hxx
+++ b/include/vcl/uitest/logger.hxx
@@ -15,10 +15,32 @@
 #include 
 #include 
 
-namespace com { namespace sun { namespace star {
-namespace beans { struct PropertyValue; }
-} } }
-namespace com { namespace sun { namespace star { namespace uno { template 
 class Sequence; } } } }
+namespace com
+{
+namespace sun
+{
+namespace star
+{
+namespace beans
+{
+struct PropertyValue;
+}
+}
+}
+}
+namespace com
+{
+namespace sun
+{
+namespace star
+{
+namespace uno
+{
+template  class Sequence;
+}
+}
+}
+}
 
 struct EventDescription;
 class Control;
@@ -27,7 +49,6 @@ class KeyEvent;
 class UITEST_DLLPUBLIC UITestLogger
 {
 private:
-
 SvFileStream maStream;
 
 bool mbValid;
@@ -35,29 +56,24 @@ private:
 OUString app_name;
 
 public:
-
 UITestLogger();
 
-void logCommand(const OUString& rAction, const 
css::uno::Sequence& rArgs);
+void logCommand(const OUString& rAction,
+const css::uno::Sequence& 
rArgs);
 
-void logAction(VclPtr const & xUIElement, VclEventId nEvent);
+void logAction(VclPtr const& xUIElement, VclEventId nEvent);
 
 void log(const OUString& rString);
 
-void logKeyInput(VclPtr const & xUIElement, const KeyEvent& 
rEvent);
+void logKeyInput(VclPtr const& xUIElement, const KeyEvent& 
rEvent);
 
 void logEvent(const EventDescription& rDescription);
 
 static UITestLogger& getInstance();
 
-void setAppName(OUString name){
-app_name=name;
-}
-
-OUString getAppName(){
-return app_name;
-}
+void setAppName(OUString name) { app_name = name; }
 
+OUString getAppName() { return app_name; }
 };
 
 #endif
diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx
index 0ecd673f9879..5ea440216980 100644
--- a/vcl/source/uitest/logger.cxx
+++ b/vcl/source/uitest/logger.cxx
@@ -20,9 +20,9 @@
 #include 
 #include 
 
-namespace{
-
-bool isDialogWindow(vcl::Window const * pWindow)
+namespace
+{
+bool isDialogWindow(vcl::Window const* pWindow)
 {
 WindowType nType = pWindow->GetType();
 // DIALOG to MODALDIALOG
@@ -39,7 +39,7 @@ bool isDialogWindow(vcl::Window const * pWindow)
 return false;
 }
 
-bool isTopWindow(vcl::Window const * pWindow)
+bool isTopWindow(vcl::Window const* pWindow)
 {
 WindowType eType = pWindow->GetType();
 if (eType == WindowType::FLOATINGWINDOW)
@@ -60,17 +60,16 @@ vcl::Window* get_top_parent(vcl::Window* pWindow)
 
 return get_top_parent(pParent);
 }
-
-
 }
-UITestLogger::UITestLogger():
-maStream(),
-mbValid(false)
+UITestLogger::UITestLogger()
+: maStream()
+, mbValid(false)
 {
 static const char* pFile = std::getenv("LO_COLLECT_UIINFO");
 if (pFile)
 {
-OUString aDirPath("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" 
SAL_CONFIGFILE("bootstrap") ":UserInstallation}/uitest/");
+OUString aDirPath("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER
+  "/" SAL_CONFIGFILE("bootstrap") 
":UserInstallation}/uitest/");
 rtl::Bootstrap::expandMacros(aDirPath);
 osl::Directory::createPath(aDirPath);
 OUString aFilePath = aDirPath + OUString::fromUtf8(pFile);
@@ -80,7 +79,8 @@ UITestLogger::UITestLogger():
 }
 }
 
-void UITestLogger::logCommand(const OUString& rAction, const 
css::uno::Sequence< css::beans::PropertyValue >& rArgs)
+void UITestLogger::logCommand(const OUString& rAction,
+  const 
css::uno::Sequence& rArgs)
 {
 if (!mbValid)
 return;
@@ -126,10 +126,10 @@ void UITestLogger::logCommand(const OUString& rAction, 
const css::uno::Sequence<
 maStream.WriteLine(OUStringToOString(aCommand, RTL_TEXTENCODING_UTF8));
 }
 
-namespace {
-
+namespace
+{
 // most likely this should be recursive
-bool child_windows_have_focus(VclPtr const & xUIElement)
+bool child_windows_have_focus(VclPtr const& xUIElement)
 {
 sal_Int32 nCount = xUIElement->GetChildCount();
 for (sal_Int32 i = 0; i < nCount; ++i)
@@ -144,10 +144,9 @@ bool child_windows_have_focus(VclPtr const & 
xUIElement)
 }
 return false;
 }
-
 }
 
-void UITestLogger::logAction(VclPtr const & xUIElement, VclEventId 
nEvent)
+void UITestLogger::logAction(VclPtr const& xUIElement, VclEventId 
nEvent)
 {
 if (!mbValid)
 return;
@@ -177,14 +176,14 @@ void UITestLogger::log(const OUString& rString)
 

[Libreoffice-commits] core.git: Branch 'feature/chart-style-experiment-markus' - 2 commits - chart2/source offapi/com

2019-08-16 Thread Markus Mohrhard (via logerrit)
 chart2/source/inc/ChartStyle.hxx   |   14 -
 chart2/source/model/main/ChartModel.cxx|2 
 chart2/source/tools/ChartStyle.cxx |   77 +
 offapi/com/sun/star/chart2/XChartStyle.idl |7 ++
 4 files changed, 99 insertions(+), 1 deletion(-)

New commits:
commit 77792f9c9c0b92182a0855fae9dcf9274efa0730
Author: Markus Mohrhard 
AuthorDate: Fri Aug 16 23:13:30 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Fri Aug 16 23:13:30 2019 +0800

format file

Change-Id: I42c0069b63ced24eee99d43a7319cc50fd629e30

diff --git a/chart2/source/inc/ChartStyle.hxx b/chart2/source/inc/ChartStyle.hxx
index fc1f06270f90..54cbc5fe243b 100644
--- a/chart2/source/inc/ChartStyle.hxx
+++ b/chart2/source/inc/ChartStyle.hxx
@@ -101,8 +101,8 @@ public:
 virtual void SAL_CALL
 applyStyleToTitle(const css::uno::Reference& xTitle) 
override;
 
-virtual void SAL_CALL
-applyStyleToBackground(const 
css::uno::Reference& xBackground) override;
+virtual void SAL_CALL applyStyleToBackground(
+const css::uno::Reference& xBackground) 
override;
 
 // XStyle
 virtual sal_Bool SAL_CALL isUserDefined() override;
@@ -124,7 +124,8 @@ private:
 
 void applyStyleToAxis(const css::uno::Reference& 
xAxis);
 
-void applyStyleToCoordinates(const 
css::uno::Reference& xCooSysCont);
+void applyStyleToCoordinates(
+const css::uno::Reference& 
xCooSysCont);
 };
 
 OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference 
getChartStyles();
commit 2e31f4ab53b77ebbb0932ced6cafe8e2c8af49a2
Author: Gagandeep Singh 
AuthorDate: Tue Aug 13 15:28:38 2019 +0530
Commit: Markus Mohrhard 
CommitDate: Fri Aug 16 19:40:46 2019 +0800

Add more methods to XChartStyle.idl for applying styles to title, axis,..

Change-Id: I6ce9b3da584671636830122ef9ac9f6b9f54d132

diff --git a/chart2/source/inc/ChartStyle.hxx b/chart2/source/inc/ChartStyle.hxx
index c82611ee163c..fc1f06270f90 100644
--- a/chart2/source/inc/ChartStyle.hxx
+++ b/chart2/source/inc/ChartStyle.hxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -95,7 +96,13 @@ public:
 SAL_CALL getStyleForObject(const sal_Int16 nChartObjectType) override;
 
 virtual void SAL_CALL
-applyStyleToDiagram(const css::uno::Reference& 
xDiagram);
+applyStyleToDiagram(const css::uno::Reference& 
xDiagram) override;
+
+virtual void SAL_CALL
+applyStyleToTitle(const css::uno::Reference& xTitle) 
override;
+
+virtual void SAL_CALL
+applyStyleToBackground(const 
css::uno::Reference& xBackground) override;
 
 // XStyle
 virtual sal_Bool SAL_CALL isUserDefined() override;
@@ -114,6 +121,10 @@ private:
 std::map> 
m_xChartStyle;
 
 void register_styles();
+
+void applyStyleToAxis(const css::uno::Reference& 
xAxis);
+
+void applyStyleToCoordinates(const 
css::uno::Reference& xCooSysCont);
 };
 
 OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference 
getChartStyles();
diff --git a/chart2/source/model/main/ChartModel.cxx 
b/chart2/source/model/main/ChartModel.cxx
index 7c500abd4a07..4cda0d5882fc 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -935,6 +935,8 @@ void SAL_CALL ChartModel::setTitleObject( const 
uno::Reference< chart2::XTitle >
 ModifyListenerHelper::addListener( m_xTitle, this );
 }
 setModified( true );
+
+m_xChartStyle->applyStyleToTitle( xTitle );
 }
 
 // _ XChartStyled _
diff --git a/chart2/source/tools/ChartStyle.cxx 
b/chart2/source/tools/ChartStyle.cxx
index cb172fa30be7..2847b3db7f7d 100644
--- a/chart2/source/tools/ChartStyle.cxx
+++ b/chart2/source/tools/ChartStyle.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -187,6 +188,56 @@ css::uno::Sequence SAL_CALL 
ChartStyle::getSupportedServiceNames()
 return { "com.sun.star.chart2.ChartStyle" };
 }
 
+void SAL_CALL ChartStyle::applyStyleToTitle(const 
css::uno::Reference& xTitle)
+{
+css::uno::Reference xTitleStyle(xTitle, 
css::uno::UNO_QUERY);
+if (xTitleStyle.is())
+{
+xTitleStyle->setStyle(css::uno::Reference(
+m_xChartStyle.find(css::chart2::ChartObjectType::TITLE)->second,
+css::uno::UNO_QUERY_THROW));
+}
+}
+
+void ChartStyle::applyStyleToAxis(const 
css::uno::Reference& xAxis)
+{
+css::uno::Reference xAxisStyle(xAxis, 
css::uno::UNO_QUERY);
+if (xAxisStyle.is())
+{
+xAxisStyle->setStyle(css::uno::Reference(
+m_xChartStyle.find(css::chart2::ChartObjectType::AXIS)->second,
+css::uno::UNO_QUERY_THROW));
+}
+
+css::uno::Reference xTitled(xAxis, 
css::uno::UNO_QUERY);
+if (xTitled.is())
+{
+css::uno::Reference xTitle = 
xTitled->getTitleObject();
+if (xTitle.is())
+applyStyleToTitle(xTitle);
+}
+}
+
+void ChartStyle::applyStyleToCoordinates(
+const 

[Libreoffice-commits] core.git: Branch 'feature/chart-style-experiment-markus' - 3 commits - chart2/Library_chartcontroller.mk chart2/source chart2/uiconfig chart2/UIConfig_chart2.mk officecfg/registr

2019-08-14 Thread Markus Mohrhard (via logerrit)
 Repository.mk|4 
 chart2/Library_chartcontroller.mk|1 
 chart2/UIConfig_chart2.mk|1 
 chart2/source/controller/sidebar/Chart2PanelFactory.cxx  |3 
 chart2/source/controller/sidebar/ChartStylesPanel.cxx|   69 ++
 chart2/source/controller/sidebar/ChartStylesPanel.hxx|   90 
 chart2/uiconfig/ui/sidebarstyle.ui   |  111 +++
 officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu |   41 +++-
 8 files changed, 313 insertions(+), 7 deletions(-)

New commits:
commit 8fb2808b35a60771ec72cc9ad01cfde17e2f102a
Author: Markus Mohrhard 
AuthorDate: Thu Aug 15 04:12:11 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Thu Aug 15 04:12:11 2019 +0800

don't force huge control size

Change-Id: I9b42a8b16a333b0833d8444cdc70f32455859028

diff --git a/chart2/source/controller/sidebar/ChartStylesPanel.cxx 
b/chart2/source/controller/sidebar/ChartStylesPanel.cxx
index 13cdd32c65e7..82976b5b1e44 100644
--- a/chart2/source/controller/sidebar/ChartStylesPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartStylesPanel.cxx
@@ -34,7 +34,6 @@ ChartStylesPanel::ChartStylesPanel(vcl::Window* pParent,
 get(aDefaultButton, "setdefault");
 get(aDeleteButton, "deletestyle");
 
-aStyleList->set_height_request(45 * aStyleList->GetTextHeight());
 Link aLink = LINK(this, ChartStylesPanel, SelHdl);
 Link aLink2 = LINK(this, ChartStylesPanel, 
SetSelectionClickHdl);
 
commit 3c1a4c172426e573a8f231c15c27ff5cc3d37302
Author: Markus Mohrhard 
AuthorDate: Thu Aug 15 04:10:47 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Thu Aug 15 04:10:47 2019 +0800

make sure the ChartStyles panel shows up in chart sidebar

Change-Id: I8c6cef96d12a97fb8246efc5186d02c5f26733eb

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index e9e206a470c7..05a7789b5db7 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -292,26 +292,6 @@
 
   
 
-  
-
-  Chart Styles
-
-
-  ChartStylesDeck
-
-
-  
private:graphicrepository/sfx2/res/symphony/sidebar-style-large.png
-
-
-  
-Chart, any, visible ;
-  
-
-
-  10
-
-  
-
 
 
 
@@ -1431,7 +1411,7 @@
   
private:resource/toolpanel/ChartPanelFactory/SeriesPanel
 
 
-  2
+  3
 
   
 
@@ -1454,7 +1434,7 @@
   
private:resource/toolpanel/ChartPanelFactory/TrendlinePanel
 
 
-  3
+  4
 
   
 
@@ -1480,7 +1460,7 @@
   
private:resource/toolpanel/ChartPanelFactory/ErrorBarPanel
 
 
-  4
+  5
 
   
 
@@ -1506,7 +1486,7 @@
   private:resource/toolpanel/ChartPanelFactory/AxisPanel
 
 
-  5
+  6
 
   
 
@@ -1533,7 +1513,7 @@
   private:resource/toolpanel/ChartPanelFactory/AreaPanel
 
 
-  6
+  7
 
   
 
@@ -1564,7 +1544,7 @@
   private:resource/toolpanel/ChartPanelFactory/LinePanel
 
 
-  7
+  8
 
   
 
@@ -1587,7 +1567,7 @@
   
private:resource/toolpanel/ChartPanelFactory/CharacterPanel
 
 
-  8
+  9
 
   
 
@@ -1602,7 +1582,7 @@
   ChartStylesPanel
 
 
-  ChartStylesDeck
+  ChartDeck
 
 
   
@@ -1613,7 +1593,7 @@
   
private:resource/toolpanel/ChartPanelFactory/ChartStylesPanel
 
 
-  1
+  2
 
   
 
commit 16f447d6232d34a5c665b81ef53c15250849044a
Author: Gagandeep Singh 
AuthorDate: Fri May 3 16:51:51 2019 +0530
Commit: Markus Mohrhard 
CommitDate: Thu Aug 15 03:29:06 2019 +0800

Chart Styles : Added a list box for chart Style in sidebar

Just a GUI update for help in testing chart styles

Change-Id: If7990af383e73996e42ce756c46a8d69d3ab95f3

diff --git a/Repository.mk b/Repository.mk
index d292bd461201..0f5606f12da3 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -835,6 +835,10 @@ $(eval $(call 
gb_Helper_register_packages_for_install,calc,\
sc_res_xml \
 ))
 
+$(eval $(call gb_Helper_register_packages_for_install,chart2,\
+   chart2_res_xml \
+))
+
 $(eval $(call gb_Helper_register_packages_for_install,libreofficekit,\
$(if $(filter LINUX %BSD SOLARIS, 
$(OS)),libreofficekit_selectionhandles) \
 ))
diff --git a/chart2/Library_chartcontroller.mk 
b/chart2/Library_chartcontroller.mk
index 02c8bcb75774..2009595e63cb 100644
--- 

[Libreoffice-commits] core.git: Branch 'feature/chart-style-experiment-markus' - chart2/source chart2/uiconfig

2019-08-11 Thread Markus Mohrhard (via logerrit)
 chart2/source/controller/sidebar/ChartElementsPanel.cxx |   17 +
 chart2/source/controller/sidebar/ChartElementsPanel.hxx |2 
 chart2/source/inc/ChartStyle.hxx|2 
 chart2/source/tools/ChartStyle.cxx  |5 +
 chart2/uiconfig/ui/sidebarelements.ui   |   47 ++--
 5 files changed, 66 insertions(+), 7 deletions(-)

New commits:
commit 1f72a43b2fa1ce5edf53bc23bd478b31d727dd69
Author: Markus Mohrhard 
AuthorDate: Mon Aug 12 04:14:30 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Mon Aug 12 04:14:30 2019 +0800

initial stab at adding ugly chart style selector

Change-Id: Ica266b608d5868be5abe04929c912673e7c4f011

diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx 
b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index ac48b0a7e9cb..b445fd6d 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -303,6 +304,8 @@ ChartElementsPanel::ChartElementsPanel(
 get(mpTextTitle, "text_title");
 get(mpTextSubTitle, "text_subtitle");
 
+get(mpLBStylesBox, "cb_styles");
+
 maTextTitle = mpTextTitle->GetText();
 maTextSubTitle = mpTextSubTitle->GetText();
 
@@ -339,6 +342,8 @@ void ChartElementsPanel::dispose()
 mpLBLegendPosition.clear();
 mpBoxLegend.clear();
 
+mpLBStylesBox.clear();
+
 mpLBAxis.clear();
 mpLBGrid.clear();
 
@@ -433,7 +438,6 @@ void ChartElementsPanel::updateData()
 mpCB2ndXAxis->Check(isAxisVisible(mxModel, AxisType::X_SECOND));
 mpCB2ndYAxis->Check(isAxisVisible(mxModel, AxisType::Y_SECOND));
 
-
 bool bSupportsMainAxis = ChartTypeHelper::isSupportingMainAxis(
 getChartType(mxModel), 0, 0);
 if (bSupportsMainAxis)
@@ -479,6 +483,17 @@ void ChartElementsPanel::updateData()
 }
 
 mpLBLegendPosition->SelectEntryPos(getLegendPos(mxModel));
+
+css::uno::Sequence aChartStyles = 
::chart::getChartStyles()->getElementNames();
+mpLBStylesBox->Clear();
+for (auto& rStyle : aChartStyles)
+{
+mpLBStylesBox->InsertEntry(rStyle);
+}
+
+ChartModel* pModel = getChartModel(mxModel);
+OUString aCurrentChartStyleName = 
css::uno::Reference(pModel->getChartStyle(), 
css::uno::UNO_QUERY_THROW)->getName();
+mpLBStylesBox->SelectEntry(aCurrentChartStyleName);
 }
 
 VclPtr ChartElementsPanel::Create (
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.hxx 
b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
index eca293645cc4..b5719621e88b 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
@@ -95,6 +95,8 @@ private:
 VclPtr mpLBLegendPosition;
 VclPtr mpBoxLegend;
 
+VclPtr mpLBStylesBox;
+
 vcl::EnumContext maContext;
 
 css::uno::Reference mxModel;
diff --git a/chart2/source/inc/ChartStyle.hxx b/chart2/source/inc/ChartStyle.hxx
index 30ecdfe0a6b4..c82611ee163c 100644
--- a/chart2/source/inc/ChartStyle.hxx
+++ b/chart2/source/inc/ChartStyle.hxx
@@ -116,7 +116,7 @@ private:
 void register_styles();
 };
 
-css::uno::Reference getChartStyles();
+OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference 
getChartStyles();
 
 } // namespace chart
 
diff --git a/chart2/source/tools/ChartStyle.cxx 
b/chart2/source/tools/ChartStyle.cxx
index b2ccf466fcfd..cb172fa30be7 100644
--- a/chart2/source/tools/ChartStyle.cxx
+++ b/chart2/source/tools/ChartStyle.cxx
@@ -252,6 +252,9 @@ void ChartStyles::addInitialStyles()
 {
 css::uno::Any aDefaultStyle;
 css::uno::Reference xChartStyle = new ChartStyle;
+css::uno::Reference xStyle(xChartStyle, 
css::uno::UNO_QUERY_THROW);
+xStyle->setName("Default");
+
 aDefaultStyle <<= xChartStyle;
 insertByName("Default", aDefaultStyle);
 }
@@ -301,7 +304,7 @@ css::uno::Any ChartStyles::getByName(const OUString& rName)
 
 css::uno::Sequence ChartStyles::getElementNames()
 {
-return css::uno::Sequence();
+return comphelper::mapKeysToSequence(maChartStyles);
 }
 
 sal_Bool ChartStyles::hasByName(const OUString& rName)
diff --git a/chart2/uiconfig/ui/sidebarelements.ui 
b/chart2/uiconfig/ui/sidebarelements.ui
index c4ec4cd49e2d..89ac8c9fd314 100644
--- a/chart2/uiconfig/ui/sidebarelements.ui
+++ b/chart2/uiconfig/ui/sidebarelements.ui
@@ -1,5 +1,5 @@
 
-
+
 
   
   
@@ -9,9 +9,9 @@
   
 True
 False
+6
 vertical
 6
-6
 
   
 True
@@ -99,14 +99,14 @@
 False
 
   
-Show Legend
 True
 True
 False
+Show Legend
+5
 True
 0
 

[Libreoffice-commits] core.git: Branch 'feature/chart-style-experiment-markus' - 2 commits - chart2/source

2019-08-11 Thread Markus Mohrhard (via logerrit)
 chart2/source/chartcore.component   |4 
 chart2/source/inc/ChartStyle.hxx|   22 -
 chart2/source/model/main/ChartModel.cxx |5 -
 chart2/source/tools/ChartStyle.cxx  |  129 ++--
 chart2/source/view/main/VTitle.cxx  |3 
 5 files changed, 148 insertions(+), 15 deletions(-)

New commits:
commit 4bf7014ba4b265fa0947bf4e6cc8bbee8f2ab94f
Author: Markus Mohrhard 
AuthorDate: Mon Aug 12 03:27:52 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Mon Aug 12 03:27:52 2019 +0800

tdf#126837: fix incorrect handling of visible flag for chart titles

Change-Id: Idb8dfa18e924324dcf27339fd18ff90616651d40

diff --git a/chart2/source/view/main/VTitle.cxx 
b/chart2/source/view/main/VTitle.cxx
index d0633263f8af..967edd72f55a 100644
--- a/chart2/source/view/main/VTitle.cxx
+++ b/chart2/source/view/main/VTitle.cxx
@@ -113,6 +113,9 @@ void VTitle::createShapes(
 m_nYPos = rPos.Y;
 
 uno::Reference< beans::XPropertySet > xTitleProperties( m_xTitle, 
uno::UNO_QUERY );
+sal_Bool bVisible = true;
+if ((xTitleProperties->getPropertyValue("Visible") >>= bVisible) && 
!bVisible)
+return;
 
 try
 {
commit 816332b04ded68f0729bef34dd8774cb8fdabaf1
Author: Markus Mohrhard 
AuthorDate: Mon Aug 12 02:32:09 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Mon Aug 12 03:06:14 2019 +0800

implement a ChartStyles object

Change-Id: Id7992faa801816be99c47f2bea754108b0296da5

diff --git a/chart2/source/chartcore.component 
b/chart2/source/chartcore.component
index 4bb0f689c788..f58ba98ba3ac 100644
--- a/chart2/source/chartcore.component
+++ b/chart2/source/chartcore.component
@@ -256,8 +256,4 @@
 constructor="com_sun_star_comp_chart2_ChartView_get_implementation">
 
   
-  
-
-  
 
diff --git a/chart2/source/inc/ChartStyle.hxx b/chart2/source/inc/ChartStyle.hxx
index c12441e1cd76..30ecdfe0a6b4 100644
--- a/chart2/source/inc/ChartStyle.hxx
+++ b/chart2/source/inc/ChartStyle.hxx
@@ -16,6 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
+
 #ifndef INCLUDED_CHART2_SOURCE_INC_CHARTSTYLE_HXX
 #define INCLUDED_CHART2_SOURCE_INC_CHARTSTYLE_HXX
 
@@ -25,13 +26,14 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "PropertyHelper.hxx"
 #include "OPropertySet.hxx"
 #include "MutexContainer.hxx"
 
-namespace chart2
+namespace chart
 {
 namespace impl
 {
@@ -77,7 +79,8 @@ private:
 css::uno::Reference mxPropSetInfo;
 };
 
-class ChartStyle : public cppu::WeakImplHelper
+class ChartStyle : public cppu::WeakImplHelper
 {
 public:
 explicit ChartStyle();
@@ -94,15 +97,28 @@ public:
 virtual void SAL_CALL
 applyStyleToDiagram(const css::uno::Reference& 
xDiagram);
 
+// XStyle
+virtual sal_Bool SAL_CALL isUserDefined() override;
+virtual sal_Bool SAL_CALL isInUse() override;
+virtual OUString SAL_CALL getParentStyle() override;
+virtual void setParentStyle(const OUString& rParentStyle) override;
+
+// XNamed
+virtual OUString SAL_CALL getName() override;
+virtual void SAL_CALL setName(const OUString& rName) override;
+
 private:
 sal_Int16 m_nNumObjects;
+OUString maName;
 
 std::map> 
m_xChartStyle;
 
 void register_styles();
 };
 
-} // namespace chart2
+css::uno::Reference getChartStyles();
+
+} // namespace chart
 
 // INCLUDED_CHART2_SOURCE_INC_CHARTSTYLE_HXX
 #endif
diff --git a/chart2/source/model/main/ChartModel.cxx 
b/chart2/source/model/main/ChartModel.cxx
index ba5a5d399445..7c500abd4a07 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -110,8 +111,8 @@ 
ChartModel::ChartModel(uno::Reference const & xContext)
 ModifyListenerHelper::addListener( m_xPageBackground, this );
 m_xChartTypeManager.set( 
xContext->getServiceManager()->createInstanceWithContext(
 "com.sun.star.chart2.ChartTypeManager", m_xContext ), 
uno::UNO_QUERY );
-m_xChartStyle.set( 
xContext->getServiceManager()->createInstanceWithContext(
-"com.sun.star.chart2.ChartStyle" , m_xContext ), 
uno::UNO_QUERY );
+
+::chart::getChartStyles()->getByName("Default") >>= m_xChartStyle;
 }
 osl_atomic_decrement(_refCount);
 }
diff --git a/chart2/source/tools/ChartStyle.cxx 
b/chart2/source/tools/ChartStyle.cxx
index 71e94867dc3a..b2ccf466fcfd 100644
--- a/chart2/source/tools/ChartStyle.cxx
+++ b/chart2/source/tools/ChartStyle.cxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -49,7 +50,7 @@ class XComponentContext;
 }
 }
 
-namespace chart2
+namespace chart
 {
 
ChartObjectStyle::ChartObjectStyle(css::uno::Reference
 xPropSetInfo,
::cppu::IPropertyArrayHelper& rArrayHelper,
@@ -208,19 +209,135 

[Libreoffice-commits] core.git: Branch 'feature/chart-style-experiment-markus' - offapi/com

2019-08-10 Thread Markus Mohrhard (via logerrit)
 offapi/com/sun/star/chart2/ChartObjectType.idl |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 55a7e6cc42d697f4a46ead4fb0d840407783b2cf
Author: Markus Mohrhard 
AuthorDate: Sun Aug 11 03:02:04 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Sun Aug 11 03:02:04 2019 +0800

add the ChartObjectType::FLOOR ID

Change-Id: I14c6f6e653c7e95a6503eae220140563977609eb

diff --git a/offapi/com/sun/star/chart2/ChartObjectType.idl 
b/offapi/com/sun/star/chart2/ChartObjectType.idl
index eb86b14eb4e0..7580e9d83b19 100644
--- a/offapi/com/sun/star/chart2/ChartObjectType.idl
+++ b/offapi/com/sun/star/chart2/ChartObjectType.idl
@@ -26,7 +26,8 @@ constants ChartObjectType
 const short STOCK = 9;
 const short TITLE = 10;
 const short WALL = 11;
-const short UNKNOWN = 12;
+const short FLOOR = 12;
+const short UNKNOWN = 13;
 };
 
 }; }; }; };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'feature/chart-style-experiment-markus' - chart2/source

2019-08-09 Thread Markus Mohrhard (via logerrit)
 chart2/source/model/main/ChartModel_Persistence.cxx |8 
 chart2/source/tools/ChartStyle.cxx  |   19 +++
 2 files changed, 19 insertions(+), 8 deletions(-)

New commits:
commit 78f6221057f13eec4a736d12b282a5904a68d883
Author: Markus Mohrhard 
AuthorDate: Sat Aug 10 03:18:09 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Sat Aug 10 03:18:09 2019 +0800

move chart wall default formatting to style

Change-Id: Ieddeb087df2c60ffa59c5ebba378f862350377bf

diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx 
b/chart2/source/model/main/ChartModel_Persistence.cxx
index db3b05ea195c..6ab5ebf9135b 100644
--- a/chart2/source/model/main/ChartModel_Persistence.cxx
+++ b/chart2/source/model/main/ChartModel_Persistence.cxx
@@ -434,14 +434,6 @@ void ChartModel::insertDefaultChart()
 //set some new 'defaults' for wall and floor
 if( xDiagram.is() )
 {
-Reference< beans::XPropertySet > xWall( 
xDiagram->getWall() );
-if( xWall.is() )
-{
-xWall->setPropertyValue( "LineStyle", uno::Any( 
drawing::LineStyle_SOLID ) );
-xWall->setPropertyValue( "FillStyle", uno::Any( 
drawing::FillStyle_NONE ) );
-xWall->setPropertyValue( "LineColor", uno::Any( 
static_cast< sal_Int32 >( 0xb3b3b3 ) ) ); // gray30
-xWall->setPropertyValue( "FillColor", uno::Any( 
static_cast< sal_Int32 >( 0xe6e6e6 ) ) ); // gray10
-}
 Reference< beans::XPropertySet > xFloor( 
xDiagram->getFloor() );
 if( xFloor.is() )
 {
diff --git a/chart2/source/tools/ChartStyle.cxx 
b/chart2/source/tools/ChartStyle.cxx
index b383f4316b03..71e94867dc3a 100644
--- a/chart2/source/tools/ChartStyle.cxx
+++ b/chart2/source/tools/ChartStyle.cxx
@@ -142,6 +142,16 @@ void ChartStyle::register_styles()
 *chart::wall::StaticWallInfo::get(), 
*chart::wall::StaticWallInfoHelper::get(),
 *chart::wall::StaticWallDefaults::get());
 
+css::uno::Reference xWallStyle
+= m_xChartStyle[css::chart2::ChartObjectType::WALL];
+
+xWallStyle->setPropertyValue("LineStyle", 
css::uno::Any(css::drawing::LineStyle_SOLID));
+xWallStyle->setPropertyValue("FillStyle", 
css::uno::Any(css::drawing::FillStyle_NONE));
+xWallStyle->setPropertyValue("LineColor",
+ 
css::uno::Any(static_cast(0xb3b3b3))); // gray30
+xWallStyle->setPropertyValue("FillColor",
+ 
css::uno::Any(static_cast(0xe6e6e6))); // gray10
+
 m_xChartStyle[css::chart2::ChartObjectType::GRID] = new ChartObjectStyle(
 *chart::grid::StaticGridInfo::get(), 
*chart::grid::StaticGridInfoHelper::get(),
 *chart::grid::StaticGridDefaults::get());
@@ -187,6 +197,15 @@ ChartStyle::applyStyleToDiagram(const 
css::uno::Reference
 m_xChartStyle.find(css::chart2::ChartObjectType::LEGEND)->second,
 css::uno::UNO_QUERY_THROW));
 }
+
+css::uno::Reference 
xWallStyle(xDiagram->getWall(),
+   
css::uno::UNO_QUERY);
+if (xWallStyle.is())
+{
+xWallStyle->setStyle(css::uno::Reference(
+m_xChartStyle.find(css::chart2::ChartObjectType::WALL)->second,
+css::uno::UNO_QUERY_THROW));
+}
 }
 
 //
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'feature/chart-style-experiment-markus' - 2 commits - chart2/source offapi/com

2019-08-09 Thread Markus Mohrhard (via logerrit)
 chart2/source/inc/ChartStyle.hxx|3 ++
 chart2/source/model/main/ChartModel.cxx |2 +
 chart2/source/model/main/ChartModel_Persistence.cxx |   11 
 chart2/source/tools/ChartStyle.cxx  |   25 
 offapi/com/sun/star/chart2/XChartStyle.idl  |3 ++
 5 files changed, 39 insertions(+), 5 deletions(-)

New commits:
commit b91405200821542b714c19eb65c5ec0532499913
Author: Markus Mohrhard 
AuthorDate: Sat Aug 10 01:17:50 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Sat Aug 10 01:19:49 2019 +0800

move default chart legend formatting to the style

Change-Id: If996e2d86ce07e91da77789732a1abf1ae1b3f99

diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx 
b/chart2/source/model/main/ChartModel_Persistence.cxx
index 87a0a742b7d9..db3b05ea195c 100644
--- a/chart2/source/model/main/ChartModel_Persistence.cxx
+++ b/chart2/source/model/main/ChartModel_Persistence.cxx
@@ -416,11 +416,6 @@ void ChartModel::insertDefaultChart()
 Reference< beans::XPropertySet > xLegendProperties( xLegend, 
uno::UNO_QUERY );
 if( xLegendProperties.is() )
 {
-xLegendProperties->setPropertyValue( "FillStyle", 
uno::Any( drawing::FillStyle_NONE ));
-xLegendProperties->setPropertyValue( "LineStyle", 
uno::Any( drawing::LineStyle_NONE ));
-xLegendProperties->setPropertyValue( "LineColor", 
uno::Any( static_cast< sal_Int32 >( 0xb3b3b3 ) ));  // gray30
-xLegendProperties->setPropertyValue( "FillColor", 
uno::Any( static_cast< sal_Int32 >( 0xe6e6e6 ) ) ); // gray10
-
 if( bIsRTL )
 xLegendProperties->setPropertyValue( "AnchorPosition", 
uno::Any( chart2::LegendPosition_LINE_START ));
 }
diff --git a/chart2/source/tools/ChartStyle.cxx 
b/chart2/source/tools/ChartStyle.cxx
index 8aac449dcf90..6c7c0bafe093 100644
--- a/chart2/source/tools/ChartStyle.cxx
+++ b/chart2/source/tools/ChartStyle.cxx
@@ -19,6 +19,8 @@
 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 
@@ -104,6 +106,15 @@ void ChartStyle::register_styles()
 m_xChartStyle[css::chart2::ChartObjectType::LEGEND] = new ChartObjectStyle(
 *chart::legend::StaticLegendInfo::get(), 
*chart::legend::StaticLegendInfoHelper::get(),
 *chart::legend::StaticLegendDefaults::get());
+
+css::uno::Reference xLegendStyle
+= m_xChartStyle[css::chart2::ChartObjectType::LEGEND];
+xLegendStyle->setPropertyValue("FillStyle", 
css::uno::Any(css::drawing::FillStyle_NONE));
+xLegendStyle->setPropertyValue("LineStyle", 
css::uno::Any(css::drawing::LineStyle_NONE));
+xLegendStyle->setPropertyValue("LineColor",
+   
css::uno::Any(static_cast(0xb3b3b3))); // gray30
+xLegendStyle->setPropertyValue("FillColor",
+   
css::uno::Any(static_cast(0xe6e6e6))); // gray10
 }
 
 // _ XServiceInfo _
commit 3ff4ac00a7bdee0e7cecaf5c35bc8056bc3f1d41
Author: Markus Mohrhard 
AuthorDate: Sat Aug 10 01:19:23 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Sat Aug 10 01:19:48 2019 +0800

add initial code to apply style to chart

Change-Id: I33207f95236f4102f8ae5620465494b3384f

diff --git a/chart2/source/inc/ChartStyle.hxx b/chart2/source/inc/ChartStyle.hxx
index 2c1fb3d9e7f8..c12441e1cd76 100644
--- a/chart2/source/inc/ChartStyle.hxx
+++ b/chart2/source/inc/ChartStyle.hxx
@@ -91,6 +91,9 @@ public:
 virtual css::uno::Reference
 SAL_CALL getStyleForObject(const sal_Int16 nChartObjectType) override;
 
+virtual void SAL_CALL
+applyStyleToDiagram(const css::uno::Reference& 
xDiagram);
+
 private:
 sal_Int16 m_nNumObjects;
 
diff --git a/chart2/source/model/main/ChartModel.cxx 
b/chart2/source/model/main/ChartModel.cxx
index 262070310591..ba5a5d399445 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -687,6 +687,8 @@ void SAL_CALL ChartModel::setFirstDiagram( const 
uno::Reference< chart2::XDiagra
 ModifyListenerHelper::removeListener( xOldDiagram, xListener );
 ModifyListenerHelper::addListener( xDiagram, xListener );
 setModified( true );
+
+m_xChartStyle->applyStyleToDiagram(xDiagram);
 }
 
 Reference< chart2::data::XDataSource > ChartModel::impl_createDefaultData()
diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx 
b/chart2/source/model/main/ChartModel_Persistence.cxx
index 642aceb626ae..87a0a742b7d9 100644
--- a/chart2/source/model/main/ChartModel_Persistence.cxx
+++ b/chart2/source/model/main/ChartModel_Persistence.cxx
@@ -732,6 +732,12 @@ void SAL_CALL ChartModel::modified( const 
lang::EventObject& rEvenObject)
 }
 unlockControllers();
 }
+uno::Reference xDiagram(rEvenObject.Source, 
uno::UNO_QUERY);
+if (xDiagram.is())
+{
+if 

[Libreoffice-commits] core.git: Branch 'feature/chart-style-experiment-markus' - 2 commits - chart2/source

2019-08-06 Thread Markus Mohrhard (via logerrit)
 chart2/source/inc/ChartStyle.hxx|   43 +++
 chart2/source/inc/Legend.hxx|  134 
 chart2/source/model/main/Legend.cxx |  116 +--
 chart2/source/model/main/Legend.hxx |  107 
 chart2/source/tools/ChartStyle.cxx  |  111 +
 5 files changed, 277 insertions(+), 234 deletions(-)

New commits:
commit d63f1346a6c5767d995c787fe2bb36b023a64788
Author: Markus Mohrhard 
AuthorDate: Wed Aug 7 05:10:41 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Wed Aug 7 05:10:41 2019 +0800

store the first style in ChartStyle

Change-Id: Ib72b2c9aeb3ba2c09e8be6edbbd713cb2512b3e7

diff --git a/chart2/source/inc/ChartStyle.hxx b/chart2/source/inc/ChartStyle.hxx
index f01fa6769524..2c1fb3d9e7f8 100644
--- a/chart2/source/inc/ChartStyle.hxx
+++ b/chart2/source/inc/ChartStyle.hxx
@@ -33,13 +33,24 @@
 
 namespace chart2
 {
+namespace impl
+{
+typedef ::cppu::WeakImplHelper ChartObjectStyle_Base;
+}
 
-class ChartObjectStyle : public chart::MutexContainer, public 
property::OPropertySet, public css::style::XStyle
+class ChartObjectStyle : public chart::MutexContainer,
+ public impl::ChartObjectStyle_Base,
+ public property::OPropertySet
 {
 public:
-ChartObjectStyle(::cppu::IPropertyArrayHelper& rArrayHelper, const 
chart::tPropertyValueMap& rPropertyMap);
+ChartObjectStyle(css::uno::Reference 
xPropertySetInfo,
+ ::cppu::IPropertyArrayHelper& rArrayHelper,
+ const chart::tPropertyValueMap& rPropertyMap);
 virtual ~ChartObjectStyle();
 
+/// merge XInterface implementations
+DECLARE_XINTERFACE()
+
 virtual sal_Bool SAL_CALL isUserDefined() override;
 virtual sal_Bool SAL_CALL isInUse() override;
 
@@ -47,32 +58,34 @@ public:
 virtual void SAL_CALL setParentStyle(const OUString&) override;
 
 //  OPropertySet 
-virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const override;
+virtual css::uno::Any GetDefaultValue(sal_Int32 nHandle) const override;
 
 //  OPropertySet 
-virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() override;
+virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
 
 //  XPropertySet 
-virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
-getPropertySetInfo() override;
+virtual css::uno::Reference
+SAL_CALL getPropertySetInfo() override;
 
-private:
+virtual OUString SAL_CALL getName();
 
+virtual void SAL_CALL setName(const OUString&);
+
+private:
 ::cppu::IPropertyArrayHelper& mrArrayHelper;
 const chart::tPropertyValueMap& mrPropertyMap;
+css::uno::Reference mxPropSetInfo;
 };
 
-class ChartStyle : public cppu::WeakImplHelper<
-  css::chart2::XChartStyle
-, css::lang::XServiceInfo >
+class ChartStyle : public cppu::WeakImplHelper
 {
 public:
 explicit ChartStyle();
 virtual ~ChartStyle();
 /// XServiceInfo declarations
 virtual OUString SAL_CALL getImplementationName() override;
-virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) 
override;
-virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() 
override;
+virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) 
override;
+virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() 
override;
 
 // _ XChartStyle _
 virtual css::uno::Reference
@@ -82,6 +95,8 @@ private:
 sal_Int16 m_nNumObjects;
 
 std::map> 
m_xChartStyle;
+
+void register_styles();
 };
 
 } // namespace chart2
diff --git a/chart2/source/inc/Legend.hxx b/chart2/source/inc/Legend.hxx
new file mode 100644
index ..b3685eb5862a
--- /dev/null
+++ b/chart2/source/inc/Legend.hxx
@@ -0,0 +1,134 @@
+/* -*- 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef INCLUDED_CHART2_SOURCE_MODEL_MAIN_LEGEND_HXX
+#define INCLUDED_CHART2_SOURCE_MODEL_MAIN_LEGEND_HXX
+
+#include 

[Libreoffice-commits] core.git: Changes to 'feature/chart-style-experiment-markus'

2019-08-05 Thread Markus Mohrhard (via logerrit)
New branch 'feature/chart-style-experiment-markus' available with the following 
commits:
commit c33185cbdfd948f3295f9192a7f8c3ab37a7dae1
Author: Markus Mohrhard 
Date:   Tue Aug 6 03:08:14 2019 +0800

try a different idea how to quickly get some chart styles implemented

Change-Id: I3856c97f8b58d9631b577700dd5aabe7f4f5798b

commit 9fdb2d44efac86ad475dc0d53ceaa3582da696e0
Author: Gagandeep Singh 
Date:   Mon Jul 29 12:07:31 2019 +0530

ChartStyle service prototype and integration into ChartModel

Change-Id: I6462886fba99f16df36a847121adc31ac1924424

commit 61a49a1f413e05af3f5e9114703d3d97163c268e
Author: Markus Mohrhard 
Date:   Tue Aug 6 01:59:16 2019 +0800

Revert "[WIP] Core Structures for Chart Styles Implementation"

This reverts commit 2fd7ed670df9bd4390d26b6a8c6b64c6a4242e50.

Change-Id: I6fc8474f251a7507ea31db623a4bd3908e198b82

commit 9df5887e017bbb2b1e97b156e3daf0c80a82bffe
Author: Gagandeep Singh 
Date:   Tue Jul 9 13:35:35 2019 +0530

ChartStyle class for XChartStyle interface

Change-Id: I8b2cf62e9791f70739d6973aab96c344cb3c3ffb
Reviewed-on: https://gerrit.libreoffice.org/75308
Reviewed-by: Markus Mohrhard 
Tested-by: Markus Mohrhard 

commit 0d2083cf893db3690708de2511a11e435dfdbca1
Author: Gagandeep Singh 
Date:   Fri Jul 5 16:31:44 2019 +0530

Populating the ChartObjectType.idl

Change-Id: I253f720d7afc749b1d35946a929f2a762ec03a54
Reviewed-on: https://gerrit.libreoffice.org/75107
Reviewed-by: Markus Mohrhard 
Tested-by: Markus Mohrhard 

commit 3cf4e20a3b6b5c346e4b55fef2350f2ea4e14fd4
Author: Markus Mohrhard 
Date:   Thu Jul 4 00:26:34 2019 +0800

add interfaces for chart style

Change-Id: Ib8e118a5c866187507d438f1decbc49ffafd0dd4

commit 2fd7ed670df9bd4390d26b6a8c6b64c6a4242e50
Author: Gagandeep Singh 
Date:   Fri Jun 21 16:58:06 2019 +0530

[WIP] Core Structures for Chart Styles Implementation

Change-Id: I2e96606184b895d572eabdfbac1539a2881e3541

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'feature/gsoc19-chart-style' - offapi/com offapi/UnoApi_offapi.mk

2019-07-03 Thread Markus Mohrhard (via logerrit)
 offapi/UnoApi_offapi.mk|2 +
 offapi/com/sun/star/chart2/ChartObjectType.idl |   24 +
 offapi/com/sun/star/chart2/XChartStyle.idl |   28 +
 3 files changed, 54 insertions(+)

New commits:
commit fa2aa8d749c153e660ed5e8c976802921ab59eea
Author: Markus Mohrhard 
AuthorDate: Thu Jul 4 00:26:34 2019 +0800
Commit: Markus Mohrhard 
CommitDate: Thu Jul 4 00:26:34 2019 +0800

add interfaces for chart style

Change-Id: Ib8e118a5c866187507d438f1decbc49ffafd0dd4

diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 0f4137996e41..9d158bc16c55 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -1997,6 +1997,7 @@ $(eval $(call 
gb_UnoApi_add_idlfiles,offapi,com/sun/star/chart,\
 $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/chart2,\
AxisOrientation \
AxisType \
+   ChartObjectType \
CoordinateSystemTypeID \
CurveStyle \
DataPointGeometry3D \
@@ -2021,6 +2022,7 @@ $(eval $(call 
gb_UnoApi_add_idlfiles,offapi,com/sun/star/chart2,\
XChartDocument \
XChartShape \
XChartShapeContainer \
+   XChartStyle \
XChartStyles \
XChartType \
XChartTypeContainer \
diff --git a/offapi/com/sun/star/chart2/ChartObjectType.idl 
b/offapi/com/sun/star/chart2/ChartObjectType.idl
new file mode 100644
index ..c84c99b661ef
--- /dev/null
+++ b/offapi/com/sun/star/chart2/ChartObjectType.idl
@@ -0,0 +1,24 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * 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 com_sun_star_chart2_ChartObjectType_idl__
+#define com_sun_star_chart2_ChartObjectType_idl__
+
+module com { module sun { module star { module chart2 {
+
+constants ChartObjectType
+{
+const short TITLE = 0;
+};
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/offapi/com/sun/star/chart2/XChartStyle.idl 
b/offapi/com/sun/star/chart2/XChartStyle.idl
new file mode 100644
index ..a072d6f2c833
--- /dev/null
+++ b/offapi/com/sun/star/chart2/XChartStyle.idl
@@ -0,0 +1,28 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * 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 com_sun_star_chart2_XChartStyle
+#define com_sun_star_chart2_XChartStyle
+
+#include 
+#include 
+#include 
+
+module com { module sun { module star { module chart2 {
+
+interface XChartStyle : ::com::sun::star::uno::XInterface
+{
+com::sun::star::beans::XPropertySet getStyleForObject([in] short 
chartObjectType);
+};
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sc/source

2019-05-10 Thread Markus Mohrhard (via logerrit)
 sc/source/filter/excel/xecontent.cxx |   27 ---
 1 file changed, 24 insertions(+), 3 deletions(-)

New commits:
commit 569c2229dd890aad07035d81b1ce3b1b3d7bc244
Author: Markus Mohrhard 
AuthorDate: Sun Jul 15 00:18:58 2018 +0200
Commit: Andras Timar 
CommitDate: Fri May 10 08:25:43 2019 +0200

related tdf#117816, only export cond format formula to xlsx when required

Change-Id: I7523d17e9945dfbdf0c346fff8eddd40593f946a
Reviewed-on: https://gerrit.libreoffice.org/57444
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 
(cherry picked from commit 16048ebc230880148346f02403820b7646b2649c)
Reviewed-on: https://gerrit.libreoffice.org/72007
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sc/source/filter/excel/xecontent.cxx 
b/sc/source/filter/excel/xecontent.cxx
index 9c90d2d1c1bb..557ef69f3d93 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -939,6 +939,27 @@ bool IsTextRule(ScConditionMode eMode)
 return false;
 }
 
+bool RequiresFormula(ScConditionMode eMode)
+{
+if (IsTopBottomRule(eMode))
+return false;
+else if (IsTextRule(eMode))
+return false;
+
+switch (eMode)
+{
+case ScConditionMode::NoError:
+case ScConditionMode::Error:
+case ScConditionMode::Duplicate:
+case ScConditionMode::NotDuplicate:
+return false;
+default:
+break;
+}
+
+return true;
+}
+
 bool RequiresFixedFormula(ScConditionMode eMode)
 {
 switch(eMode)
@@ -965,9 +986,9 @@ OString GetFixedFormula(ScConditionMode eMode, const 
ScAddress& rAddress, const
 switch (eMode)
 {
 case ScConditionMode::Error:
-return "";
+return OString("ISERROR(" + aPos + ")") ;
 case ScConditionMode::NoError:
-return "";
+return OString("NOT(ISERROR(" + aPos + "))") ;
 case ScConditionMode::BeginsWith:
 return OString("LEFT(" + aPos + ",LEN(\"" + rText + "\"))=\"" + 
rText + "\"");
 case ScConditionMode::EndsWith:
@@ -1036,7 +1057,7 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
 rWorksheet->writeEscaped(aFormula.getStr());
 rWorksheet->endElement( XML_formula );
 }
-else if(!IsTextRule(eOperation) && !IsTopBottomRule(eOperation))
+else if(RequiresFormula(eOperation))
 {
 rWorksheet->startElement( XML_formula, FSEND );
 std::unique_ptr 
pTokenArray(mrFormatEntry.CreateFlatCopiedTokenArray(0));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sc/qa

2019-05-10 Thread Markus Mohrhard (via logerrit)
 sc/qa/unit/data/ods/conditionalformat_containstext.ods |binary
 sc/qa/unit/subsequent_export-test.cxx  |   13 +
 2 files changed, 13 insertions(+)

New commits:
commit 02a57aa51d71680ed64ce6519d77e28db06b03b3
Author: Markus Mohrhard 
AuthorDate: Sat Jul 14 15:29:41 2018 +0200
Commit: Andras Timar 
CommitDate: Fri May 10 08:25:01 2019 +0200

add test for tdf#117816

Reviewed-on: https://gerrit.libreoffice.org/57433
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 
(cherry picked from commit 7e8dbbb02f25278d5afc51ae4a397831f5b21239)

Change-Id: I470b4137a3b4e23acf0f4e949a7a834fed8069db
Reviewed-on: https://gerrit.libreoffice.org/72005
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sc/qa/unit/data/ods/conditionalformat_containstext.ods 
b/sc/qa/unit/data/ods/conditionalformat_containstext.ods
new file mode 100644
index ..fa3e21e29f5a
Binary files /dev/null and 
b/sc/qa/unit/data/ods/conditionalformat_containstext.ods differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index c095e9fb3847..831c98750454 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -110,6 +110,7 @@ public:
 void testDataBarExportODS();
 void testDataBarExportXLSX();
 void testConditionalFormatRangeListXLSX();
+void testConditionalFormatContainsTextXLSX();
 void testConditionalFormatPriorityCheckXLSX();
 void testMiscRowHeightExport();
 void testNamedRangeBugfdo62729();
@@ -237,6 +238,7 @@ public:
 CPPUNIT_TEST(testDataBarExportODS);
 CPPUNIT_TEST(testDataBarExportXLSX);
 CPPUNIT_TEST(testConditionalFormatRangeListXLSX);
+CPPUNIT_TEST(testConditionalFormatContainsTextXLSX);
 CPPUNIT_TEST(testConditionalFormatPriorityCheckXLSX);
 CPPUNIT_TEST(testMiscRowHeightExport);
 CPPUNIT_TEST(testNamedRangeBugfdo62729);
@@ -3922,6 +3924,17 @@ void ScExportTest::testConditionalFormatRangeListXLSX()
 assertXPath(pDoc, "//x:conditionalFormatting", "sqref", "F4 F10");
 }
 
+void ScExportTest::testConditionalFormatContainsTextXLSX()
+{
+ScDocShellRef xDocSh = loadDoc("conditionalformat_containstext.", 
FORMAT_ODS);
+CPPUNIT_ASSERT(xDocSh.is());
+
+xmlDocPtr pDoc = XPathHelper::parseExport(*xDocSh, m_xSFactory, 
"xl/worksheets/sheet1.xml", FORMAT_XLSX);
+CPPUNIT_ASSERT(pDoc);
+
+assertXPathContent(pDoc, "//x:conditionalFormatting/x:cfRule/x:formula", 
"NOT(ISERROR(SEARCH(\"test\",A1)))");
+}
+
 void ScExportTest::testConditionalFormatPriorityCheckXLSX()
 {
 ScDocShellRef xDocSh = loadDoc("conditional_fmt_checkpriority.", 
FORMAT_XLSX);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sc/source

2019-05-10 Thread Markus Mohrhard (via logerrit)
 sc/source/filter/excel/xecontent.cxx |   64 ---
 1 file changed, 53 insertions(+), 11 deletions(-)

New commits:
commit 0420bf0da699493c91164cdd8b9f8fe488f0fb67
Author: Markus Mohrhard 
AuthorDate: Sat Jul 14 23:56:44 2018 +0200
Commit: Andras Timar 
CommitDate: Fri May 10 08:25:23 2019 +0200

related tdf#117816, add more work arounds for MS Excel bugs

Another set of cases where MS Excel needs the formula.

Change-Id: I58344a540ad69ff9b8c56aa817730079bd011acd
Reviewed-on: https://gerrit.libreoffice.org/57443
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 
(cherry picked from commit 6df45ae3a85b21d984605a6656282e5feaf8dea9)
Reviewed-on: https://gerrit.libreoffice.org/72006
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sc/source/filter/excel/xecontent.cxx 
b/sc/source/filter/excel/xecontent.cxx
index eda436ad1b84..9c90d2d1c1bb 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -939,6 +939,50 @@ bool IsTextRule(ScConditionMode eMode)
 return false;
 }
 
+bool RequiresFixedFormula(ScConditionMode eMode)
+{
+switch(eMode)
+{
+case ScConditionMode::NoError:
+case ScConditionMode::Error:
+case ScConditionMode::BeginsWith:
+case ScConditionMode::EndsWith:
+case ScConditionMode::ContainsText:
+case ScConditionMode::NotContainsText:
+return true;
+default:
+break;
+}
+
+return false;
+}
+
+OString GetFixedFormula(ScConditionMode eMode, const ScAddress& rAddress, 
const OString& rText)
+{
+OStringBuffer aBuffer;
+OStringBuffer aPosBuffer = XclXmlUtils::ToOString(aBuffer, rAddress);
+OString aPos = aPosBuffer.makeStringAndClear();
+switch (eMode)
+{
+case ScConditionMode::Error:
+return "";
+case ScConditionMode::NoError:
+return "";
+case ScConditionMode::BeginsWith:
+return OString("LEFT(" + aPos + ",LEN(\"" + rText + "\"))=\"" + 
rText + "\"");
+case ScConditionMode::EndsWith:
+return OString("RIGHT(" + aPos +",LEN(\"" + rText + "\"))=\"" + 
rText + "\"");
+case ScConditionMode::ContainsText:
+return OString("NOT(ISERROR(SEARCH(\"" + rText + "\"," + aPos + 
")))");
+case ScConditionMode::NotContainsText:
+return OString("ISERROR(SEARCH(\"" +  rText + "\"," + aPos + "))");
+default:
+break;
+}
+
+return OString("");
+}
+
 }
 
 void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
@@ -984,7 +1028,15 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
 XML_text, aText.getStr(),
 XML_dxfId, OString::number( GetDxfs().GetDxfId( 
mrFormatEntry.GetStyle() ) ).getStr(),
 FSEND );
-if(!IsTextRule(eOperation) && !IsTopBottomRule(eOperation))
+
+if (RequiresFixedFormula(eOperation))
+{
+rWorksheet->startElement( XML_formula, FSEND );
+OString aFormula = GetFixedFormula(eOperation, 
mrFormatEntry.GetValidSrcPos(), aText);
+rWorksheet->writeEscaped(aFormula.getStr());
+rWorksheet->endElement( XML_formula );
+}
+else if(!IsTextRule(eOperation) && !IsTopBottomRule(eOperation))
 {
 rWorksheet->startElement( XML_formula, FSEND );
 std::unique_ptr 
pTokenArray(mrFormatEntry.CreateFlatCopiedTokenArray(0));
@@ -1000,16 +1052,6 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
 rWorksheet->endElement( XML_formula );
 }
 }
-else if (IsTextRule(eOperation))
-{
-OStringBuffer aBufferOld;
-OStringBuffer aBuffer = XclXmlUtils::ToOString(aBufferOld, 
mrFormatEntry.GetValidSrcPos());
-OString aTextTopCell = aBuffer.makeStringAndClear();
-OString aFormula = "NOT(ISERROR(SEARCH(\"" + aText + "\"," + 
aTextTopCell + ")))";
-rWorksheet->startElement( XML_formula, FSEND );
-rWorksheet->writeEscaped(aFormula.getStr());
-rWorksheet->endElement( XML_formula );
-}
 // OOXTODO: XML_extLst
 rWorksheet->endElement( XML_cfRule );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sc/source

2019-05-10 Thread Markus Mohrhard (via logerrit)
 sc/source/filter/excel/xecontent.cxx |   10 ++
 1 file changed, 10 insertions(+)

New commits:
commit 5328e04744bbf570e70b13917a2142c0aca159ae
Author: Markus Mohrhard 
AuthorDate: Sat Jul 14 15:16:46 2018 +0200
Commit: Andras Timar 
CommitDate: Fri May 10 08:24:39 2019 +0200

tdf#117816, work around MS Excel bug with containsText cond format

Excel seems to require the formula that is equal to the containsText
condition.

According to cfRule (18.3.1.10) "Only rules with a type attribute
 value of expression support formula syntax." which contradicts the
MS EXCEL behavior.

Change-Id: Ifa3f9fee58194f70a64b37c62922513435d43bb8
Reviewed-on: https://gerrit.libreoffice.org/57432
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 
(cherry picked from commit e77596be879c25f5766b73a2f67cf0ddf7775ccc)
Reviewed-on: https://gerrit.libreoffice.org/72004
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sc/source/filter/excel/xecontent.cxx 
b/sc/source/filter/excel/xecontent.cxx
index d99607a1e0c2..eda436ad1b84 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -1000,6 +1000,16 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
 rWorksheet->endElement( XML_formula );
 }
 }
+else if (IsTextRule(eOperation))
+{
+OStringBuffer aBufferOld;
+OStringBuffer aBuffer = XclXmlUtils::ToOString(aBufferOld, 
mrFormatEntry.GetValidSrcPos());
+OString aTextTopCell = aBuffer.makeStringAndClear();
+OString aFormula = "NOT(ISERROR(SEARCH(\"" + aText + "\"," + 
aTextTopCell + ")))";
+rWorksheet->startElement( XML_formula, FSEND );
+rWorksheet->writeEscaped(aFormula.getStr());
+rWorksheet->endElement( XML_formula );
+}
 // OOXTODO: XML_extLst
 rWorksheet->endElement( XML_cfRule );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits