[Libreoffice-commits] core.git: sw/qa sw/source

2016-09-07 Thread Jakub Trzebiatowski
 sw/qa/extras/odfexport/data/table_styles_5.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx   |   24 
 sw/source/core/unocore/unostyle.cxx|3 ++-
 3 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit 6ccb82ddf302acbd56bd4ea67fce107883e5391c
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Wed Sep 7 20:42:11 2016 +0200

tdf#101712 Writer Table Style; odf export; remove parent export for cell 
style

Do not export the parent-style-name attribute for a cell style.
The parent-style-name attribute should refer to a style of table-cell
family. Not a table-template element.

Reviewed on:
https://gerrit.libreoffice.org/28729

Change-Id: I350ec7cef0ac544ce4e5dec54015412a4070b1d8

diff --git a/sw/qa/extras/odfexport/data/table_styles_5.odt 
b/sw/qa/extras/odfexport/data/table_styles_5.odt
new file mode 100644
index 000..c909583
Binary files /dev/null and b/sw/qa/extras/odfexport/data/table_styles_5.odt 
differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index cca1ed0..f53ec92 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -1139,6 +1139,30 @@ DECLARE_ODFIMPORT_TEST(testTableStyles4, 
"table_styles_4.odt")
 CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff00), 
getProperty(xCell1Style, "BackColor"));
 }
 
+DECLARE_ODFEXPORT_TEST(testTableStyles5, "table_styles_5.odt")
+{
+// Test if cell styles doesn't have a style:parent-style-name attribute.
+if (xmlDocPtr pXmlDoc = parseExport("styles.xml"))
+{
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style.1']", "parent-style-name");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style.2']", "parent-style-name");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style.3']", "parent-style-name");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style.4']", "parent-style-name");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style.5']", "parent-style-name");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style.6']", "parent-style-name");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style.7']", "parent-style-name");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style.8']", "parent-style-name");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style.9']", "parent-style-name");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style.10']", "parent-style-name");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style.11']", "parent-style-name");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style.12']", "parent-style-name");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style.13']", "parent-style-name");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style.14']", "parent-style-name");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style.15']", "parent-style-name");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style.16']", "parent-style-name");
+}
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index 41948a2..95f1647 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -4860,7 +4860,8 @@ sal_Bool SAL_CALL SwXTextCellStyle::isInUse() throw 
(css::uno::RuntimeException,
 
 OUString SAL_CALL SwXTextCellStyle::getParentStyle() throw 
(css::uno::RuntimeException, std::exception)
 {
-return m_sParentStyle;
+// Do not return name o

[Libreoffice-commits] core.git: sw/inc sw/qa sw/source

2016-08-16 Thread Jakub Trzebiatowski
 sw/inc/doc.hxx |2 ++
 sw/inc/swundo.hxx  |3 ++-
 sw/qa/extras/uiwriter/uiwriter.cxx |   26 +-
 sw/source/core/doc/tblafmt.cxx |8 
 sw/source/core/docnode/ndtbl.cxx   |   29 +
 sw/source/core/inc/UndoTable.hxx   |   14 ++
 sw/source/core/undo/undo.hrc   |3 ++-
 sw/source/core/undo/undo.src   |4 
 sw/source/core/undo/untbl.cxx  |   26 ++
 sw/source/uibase/app/docst.cxx |   19 +++
 10 files changed, 127 insertions(+), 7 deletions(-)

New commits:
commit 592a8657fa6bdc6ed72281d792c19ff0bff31387
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Thu Aug 11 20:22:39 2016 +0200

GSoC Writer Table Styles; Update by example

+ Added possibility to update style by example.
+ Fixed SwTableAutoFormat::GetBoxFormat

Change-Id: I80d9334ceda0ef7e0984fb54731850034b44cd44
Reviewed-on: https://gerrit.libreoffice.org/28063
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>
Tested-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index cbc3145..f28bd22 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -1263,6 +1263,8 @@ public:
 SwTableAutoFormat* MakeTableStyle(const OUString& rName, bool bBroadcast = 
false);
 // Delete table style named rName. If pAffectedTables is not null, it 
contains pointers to affected tables. Tracked by undo.
 std::unique_ptr DelTableStyle(const OUString& rName, 
bool bBroadcast = false, std::vector<SwTable*>* pAffectedTables = nullptr);
+// Change (replace) a table style named rName. Tracked by undo.
+void ChgTableStyle(const OUString& rName, const SwTableAutoFormat& 
rNewFormat);
 
 const SwCellStyleTable& GetCellStyles() const  { return 
*mpCellStyles.get(); }
   SwCellStyleTable& GetCellStyles(){ return 
*mpCellStyles.get(); }
diff --git a/sw/inc/swundo.hxx b/sw/inc/swundo.hxx
index 9a90d4a..e33ee7b 100644
--- a/sw/inc/swundo.hxx
+++ b/sw/inc/swundo.hxx
@@ -152,7 +152,8 @@ enum SwUndoId
 UNDO_FLYFRMFMT_DESCRIPTION, // 113
 UNDO_TBLSTYLE_CREATE,   // 114
 UNDO_TBLSTYLE_DELETE,   // 115
-UNDO_STD_END= UNDO_TBLSTYLE_DELETE,
+UNDO_TBLSTYLE_UPDATE,   // 116
+UNDO_STD_END= UNDO_TBLSTYLE_UPDATE,
 
 // UI undo ID's...
 UNDO_UI_REPLACE =  UNDO_STD_END + 1,
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index 813f548..a835533 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -3796,8 +3796,32 @@ void SwUiWriterTest::testTableStyleUndo()
 // check if attributes are preserved
 CPPUNIT_ASSERT(pStyle);
 CPPUNIT_ASSERT(pStyle->GetBoxFormat(0).GetBackground() == aBackground);
-rUndoManager.Undo();
+rUndoManager.Redo();
 CPPUNIT_ASSERT_EQUAL(sal_Int32(pDoc->GetTableStyles().size()), 
nStyleCount);
+
+// undo delete so we can replace the style
+rUndoManager.Undo();
+CPPUNIT_ASSERT_EQUAL(sal_Int32(pDoc->GetTableStyles().size()), nStyleCount 
+1 );
+pStyle = pDoc->GetTableStyles().FindAutoFormat("Test Style");
+CPPUNIT_ASSERT(pStyle);
+CPPUNIT_ASSERT(pStyle->GetBoxFormat(0).GetBackground() == aBackground);
+
+SwTableAutoFormat aNewStyle("Test Style2");
+SvxBrushItem aBackground2(Color(0x00FF00), RES_BACKGROUND);
+aNewStyle.GetBoxFormat(0).SetBackground(aBackground2);
+
+pDoc->ChgTableStyle("Test Style", aNewStyle);
+pStyle = pDoc->GetTableStyles().FindAutoFormat("Test Style");
+CPPUNIT_ASSERT(pStyle);
+CPPUNIT_ASSERT(pStyle->GetBoxFormat(0).GetBackground() == aBackground2);
+rUndoManager.Undo();
+pStyle = pDoc->GetTableStyles().FindAutoFormat("Test Style");
+CPPUNIT_ASSERT(pStyle);
+CPPUNIT_ASSERT(pStyle->GetBoxFormat(0).GetBackground() == aBackground);
+rUndoManager.Redo();
+pStyle = pDoc->GetTableStyles().FindAutoFormat("Test Style");
+CPPUNIT_ASSERT(pStyle);
+CPPUNIT_ASSERT(pStyle->GetBoxFormat(0).GetBackground() == aBackground2);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 3d46102..45937fd 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -702,15 +702,15 @@ SwBoxAutoFormat& SwTableAutoFormat::GetBoxFormat( 
sal_uInt8 nPos )
 {
 SAL_WARN_IF(!(nPos < 16), "sw.core", "GetBoxFormat wrong area");
 
-SwBoxAutoFormat* pFormat = aBoxAutoFormat[ nPos ];
-if( !pFormat )
+SwBoxAutoFormat** pFormat = [ nPos ];
+if( !*pFormat )
 {
 // If default doesn't exist yet:
 if( !pDfltBoxAutoFormat )
 pDfltBoxAutoFo

[Libreoffice-commits] core.git: sw/inc sw/qa sw/source

2016-08-10 Thread Jakub Trzebiatowski
 sw/inc/doc.hxx |4 ++
 sw/inc/docstyle.hxx|3 +
 sw/inc/swundo.hxx  |4 +-
 sw/inc/tblafmt.hxx |2 +
 sw/qa/extras/uiwriter/uiwriter.cxx |   35 
 sw/source/core/doc/tblafmt.cxx |   16 +
 sw/source/core/docnode/ndtbl.cxx   |   58 ++
 sw/source/core/inc/UndoTable.hxx   |   30 +
 sw/source/core/undo/undo.hrc   |4 +-
 sw/source/core/undo/undo.src   |8 
 sw/source/core/undo/untbl.cxx  |   63 +
 sw/source/uibase/app/docst.cxx |   23 -
 sw/source/uibase/app/docstyle.cxx  |   49 ++--
 13 files changed, 277 insertions(+), 22 deletions(-)

New commits:
commit 0943ee2decb8d5a1a2a5bf3b1c233934a89e9c97
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Tue Aug 2 14:57:17 2016 +0200

GSoC Writer Table Styles; Create by example; fix undo

- Create style by example, tracked by undo;
- Fixed delete style, now is tracked by undo

Change-Id: Ic39b549b0b970b1b15001d527a82fb26e4a630aa
Reviewed-on: https://gerrit.libreoffice.org/27990
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 755c598..cbc3145 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -1259,6 +1259,10 @@ public:
 /// Return the available table styles.
 SwTableAutoFormatTable& GetTableStyles() { return *mpTableStyles.get(); }
 const SwTableAutoFormatTable& GetTableStyles() const { return 
*mpTableStyles.get(); }
+// Create a new table style. Tracked by Undo.
+SwTableAutoFormat* MakeTableStyle(const OUString& rName, bool bBroadcast = 
false);
+// Delete table style named rName. If pAffectedTables is not null, it 
contains pointers to affected tables. Tracked by undo.
+std::unique_ptr DelTableStyle(const OUString& rName, 
bool bBroadcast = false, std::vector<SwTable*>* pAffectedTables = nullptr);
 
 const SwCellStyleTable& GetCellStyles() const  { return 
*mpCellStyles.get(); }
   SwCellStyleTable& GetCellStyles(){ return 
*mpCellStyles.get(); }
diff --git a/sw/inc/docstyle.hxx b/sw/inc/docstyle.hxx
index bb43d7d..0e1e959 100644
--- a/sw/inc/docstyle.hxx
+++ b/sw/inc/docstyle.hxx
@@ -50,7 +50,7 @@ class SW_DLLPUBLIC SwDocStyleSheet : public SfxStyleSheetBase
 SwFrameFormat*   pFrameFormat;
 const SwPageDesc*   pDesc;
 const SwNumRule*pNumRule;
-const SwTableAutoFormat* pTableFormat;
+SwTableAutoFormat*  pTableFormat;
 const SwBoxAutoFormat*   pBoxFormat;
 SwDoc&  rDoc;
 SfxItemSet  aCoreSet;
@@ -135,6 +135,7 @@ public:
 const SwPageDesc*   GetPageDesc();
 const SwNumRule*GetNumRule();
 voidSetNumRule(const SwNumRule& rRule);
+SwTableAutoFormat*  GetTableFormat();
 
 virtual boolIsUsed() const override;
 };
diff --git a/sw/inc/swundo.hxx b/sw/inc/swundo.hxx
index 2617031..9a90d4a 100644
--- a/sw/inc/swundo.hxx
+++ b/sw/inc/swundo.hxx
@@ -150,7 +150,9 @@ enum SwUndoId
 // --> #i73249#
 UNDO_FLYFRMFMT_TITLE,   // 112
 UNDO_FLYFRMFMT_DESCRIPTION, // 113
-UNDO_STD_END= UNDO_FLYFRMFMT_DESCRIPTION,
+UNDO_TBLSTYLE_CREATE,   // 114
+UNDO_TBLSTYLE_DELETE,   // 115
+UNDO_STD_END= UNDO_TBLSTYLE_DELETE,
 
 // UI undo ID's...
 UNDO_UI_REPLACE =  UNDO_STD_END + 1,
diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index 92bd534..c403cb0 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -358,6 +358,8 @@ public:
 void EraseAutoFormat(size_t i);
 void EraseAutoFormat(const OUString& rName);
 std::unique_ptr ReleaseAutoFormat(size_t i);
+/// Removes an autoformat. Returns pointer to the removed autoformat or 
nullptr.
+std::unique_ptr ReleaseAutoFormat(const OUString& 
rName);
 
 /// Find table style with the provided name, return nullptr when not found.
 SwTableAutoFormat* FindAutoFormat(const OUString& rName) const;
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index e48d67c..40ca4e5 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -62,6 +62,7 @@
 #include "UndoManager.hxx"
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -200,6 +201,7 @@ public:
 void testTdf99004();
 void testTdf84695();
 void testTdf84695NormalChar();
+void testTableStyleUndo();
 
 CPPUNIT_TEST_SUITE(SwUiWriterTest);
 CPPUNIT_TEST(testReplaceForward);
@@ -302,6 +304,7 @@ public:
 CPPUNIT_TEST(testTdf99004);
 CPPUNIT_TEST(testTdf84695);
 CPPUNIT_TEST(testTdf84695NormalChar);
+CPPUNIT_TEST(testTableStyleUndo);

GSoC Weekly Report #11 - Table Styles

2016-08-08 Thread Jakub Trzebiatowski

Hello
This week I was still working on table styles "Styles and Formatting" 
panel.
Added option to delete table style: 
https://gerrit.libreoffice.org/#/c/27797/

Beside that been working on Undo & Redo, and adding table style by example.
Modified Table and Formatting panel that you can not add style by 
example when

youre not in the table.
The commit is on gerrit but still need a little polish:
https://gerrit.libreoffice.org/#/c/27990/

In next week I plan to work editing a table style. And think how to 
store and

load default set of table styles.

Regards,
Jakub, ubap
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: sw/source

2016-08-03 Thread Jakub Trzebiatowski
 sw/source/uibase/app/docstyle.cxx |   19 +++
 1 file changed, 19 insertions(+)

New commits:
commit 8c80a56ea979eccc39cc748c35e4fd9d33e837dc
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Tue Aug 2 16:44:10 2016 +0200

GSoC Writer Table Styles; Table styles panel; Delete table style

+ Enabled delete from context menu of Table style tab in Styles and 
Formatting panel

Change-Id: I23523169e0427eb14571102e30fa693b5777af76
Reviewed-on: https://gerrit.libreoffice.org/27797
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sw/source/uibase/app/docstyle.cxx 
b/sw/source/uibase/app/docstyle.cxx
index f99b5ea..22deb32 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -2468,6 +2468,25 @@ void SwDocStyleSheetPool::Remove( SfxStyleSheetBase* 
pStyle)
 }
 break;
 
+case SfxStyleFamily::Table:
+{
+const SwTableAutoFormat* pFormat = lcl_FindTableStyle(rDoc, sName);
+if (pFormat)
+{
+size_t nTableCount = rDoc.GetTableFrameFormatCount(true);
+for (size_t i=0; i < nTableCount; ++i)
+{
+SwFrameFormat* pFrameFormat = (i, 
true);
+SwTable* pTable = SwTable::FindTable(pFrameFormat);
+if (pTable->GetTableStyleName() == pFormat->GetName())
+pTable->SetTableStyleName("");
+}
+
+rDoc.GetTableStyles().EraseAutoFormat(pFormat->GetName());
+}
+}
+break;
+
 default:
 OSL_ENSURE(false, "unknown style family");
 bBroadcast = false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


GSoC Weekly Report #10 - Table Styles

2016-08-01 Thread Jakub Trzebiatowski

Hello,

This week I fixed a table styles import bug:
https://gerrit.libreoffice.org/#/c/27539/
Made a basic "Styles and Formatting" Table styles tab.
https://gerrit.libreoffice.org/#/c/27638/
It's not yet fully functional, allows only basic operations.

Added one icon for table styles tab:
icon-themes/galaxy/sw/imglst/sf06.png

Soon I will add icons to other themes.

Now I'm working on deleting, creating and modifying a table style from 
table

styles tab.

Regards,
Jakub Trzebiatowski

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: icon-themes/galaxy include/sfx2 rsc/source sfx2/sdi sfx2/source sw/inc sw/sdi sw/source

2016-08-01 Thread Jakub Trzebiatowski
 icon-themes/galaxy/sw/imglst/sf06.png |binary
 include/sfx2/sfxsids.hrc  |1 
 rsc/source/parser/rscicpx.cxx |1 
 sfx2/sdi/sfx.sdi  |   17 +
 sfx2/source/dialog/templdlg.cxx   |5 +++
 sfx2/source/dialog/tplcitem.cxx   |3 ++
 sfx2/source/inc/templdgi.hxx  |4 +--
 sw/inc/doc.hxx|2 +
 sw/inc/fesh.hxx   |1 
 sw/inc/tblafmt.hxx|   12 +
 sw/sdi/_basesh.sdi|5 +++
 sw/sdi/_docsh.sdi |6 
 sw/sdi/annotsh.sdi|5 +++
 sw/source/core/doc/poolfmt.cxx|   16 
 sw/source/core/doc/tblafmt.cxx|6 
 sw/source/core/frmedt/fetab.cxx   |   15 +++
 sw/source/ui/app/app.src  |   16 ++--
 sw/source/uibase/app/docst.cxx|   17 +
 sw/source/uibase/app/docstyle.cxx |   44 +++---
 19 files changed, 169 insertions(+), 7 deletions(-)

New commits:
commit e7ea91f283ce9b96db58087d87d81d29bcb727a4
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Thu Jul 28 15:33:17 2016 +0200

GSoC Writer Table Styles; Table Styles Panel

Table styles panel:
+ Added simple table style panel tab icon.
icon-themes/galaxy/sw/imglst/sf06.png
+ Listing table styles (hierarchical, same order as in container)
+ Listing all table styles (sorted by name).
+ Listing applied table styles.
+ Listing custom styles.
+ Listing hidden styles.
+ Hide/show style.
+ Applying style by double clicking.
+ Highlight current table style.
Everything else yet to be done.

Table styles (SwTableAutoFormat):
+ "hidden" property.
+ "userDefined" property. "Default style" is not user defined. Styles loaded
from tblauto.fmt are also not user defined. Styles loaded from .odt are user
defined. Styles created manually (before binary load/save roundtrip) are 
user
defined.

Change-Id: I739a48ae1d7ae66f4f8c08076871437ca491bd4e
Reviewed-on: https://gerrit.libreoffice.org/27638
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/icon-themes/galaxy/sw/imglst/sf06.png 
b/icon-themes/galaxy/sw/imglst/sf06.png
new file mode 100644
index 000..ce7e5ac
Binary files /dev/null and b/icon-themes/galaxy/sw/imglst/sf06.png differ
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 0946248..b39390a 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -313,6 +313,7 @@
 #define SID_STYLE_FAMILY3   (SID_STYLE_FAMILY_START + 2)
 #define SID_STYLE_FAMILY4   (SID_STYLE_FAMILY_START + 3)
 #define SID_STYLE_FAMILY5   (SID_STYLE_FAMILY_START + 4)
+#define SID_STYLE_FAMILY6   (SID_STYLE_FAMILY_START + 5)
 
 #define SID_STYLE_NEW   (SID_SFX_START + 549)
 #define SID_STYLE_EDIT  (SID_SFX_START + 550)
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index a66f6a0..584b681 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -1151,6 +1151,7 @@ RscTop * RscTypCont::InitClassSfxStyleFamilyItem( RscTop 
* pSuper,
 SETCONST( pSfxStyleFamily, 
"SfxStyleFamily::Frame",SfxStyleFamily::Frame);
 SETCONST( pSfxStyleFamily, "SfxStyleFamily::Page", 
SfxStyleFamily::Page );
 SETCONST( pSfxStyleFamily, "SfxStyleFamily::Pseudo", 
SfxStyleFamily::Pseudo );
+SETCONST( pSfxStyleFamily, "SfxStyleFamily::Table", 
SfxStyleFamily::Table );
 aBaseLst.push_back( pSfxStyleFamily );
 
 nId = aNmTb.Put( "StyleFamily", VARNAME );
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 7e396af..f5e366a 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -4459,6 +4459,23 @@ SfxTemplateItem ListStyle SID_STYLE_FAMILY5
 GroupId = GID_DOCUMENT;
 ]
 
+SfxTemplateItem TableStyle SID_STYLE_FAMILY6
+
+[
+AutoUpdate = FALSE,
+FastCall = FALSE,
+ReadOnlyDoc = TRUE,
+Toggle = FALSE,
+Container = FALSE,
+RecordAbsolute = FALSE,
+RecordPerSet;
+
+
+AccelConfig = FALSE,
+MenuConfig = FALSE,
+ToolBoxConfig = FALSE,
+GroupId = GID_DOCUMENT;
+]
 
 SfxBoolItem TipsDialog SID_TIPWINDOW
 
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index e185487..f0a5369 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -754,6 +754,8 @@ void SfxCommonTemplateDialog_Impl::ReadResource()
 nSlot = SID_STYLE_FAMILY4; break;
 case SfxStyleFamily::Pseudo:
 nSlot = SID_STYLE_FAMILY5; break;
+case SfxStyleFamily::Table:
+

[Libreoffice-commits] core.git: sw/qa sw/source

2016-07-27 Thread Jakub Trzebiatowski
 sw/qa/extras/odfexport/data/table_styles_4.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx   |   13 +
 sw/qa/python/check_styles.py   |5 
 sw/source/core/doc/docnew.cxx  |2 
 sw/source/core/unocore/unostyle.cxx|  212 +++--
 5 files changed, 221 insertions(+), 11 deletions(-)

New commits:
commit b7138e03ebc8a33258c099c5cf6015970646a40e
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Tue Jul 26 14:29:40 2016 +0200

GSoC Writer Table Styles; Import bugfix

+ Binary autoformats are loaded into document on document creation
+ Imported table styles overwrite existing styles.

Change-Id: I88c08d1356e1c54a03624a051611357670f225ba
Reviewed-on: https://gerrit.libreoffice.org/27539
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sw/qa/extras/odfexport/data/table_styles_4.odt 
b/sw/qa/extras/odfexport/data/table_styles_4.odt
new file mode 100644
index 000..0d96127
Binary files /dev/null and b/sw/qa/extras/odfexport/data/table_styles_4.odt 
differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index 56d2d2a..cca1ed0 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -1126,6 +1126,19 @@ DECLARE_ODFEXPORT_TEST(testTableStyles3, 
"table_styles_3.odt")
 }
 }
 
+DECLARE_ODFIMPORT_TEST(testTableStyles4, "table_styles_4.odt")
+{
+// Test if loaded styles overwrite existing styles
+uno::Reference 
XFamiliesSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xFamilies(XFamiliesSupplier->getStyleFamilies());
+uno::Reference 
xTableFamily(xFamilies->getByName("TableStyles"), uno::UNO_QUERY);
+uno::Reference 
xTableStyle(xTableFamily->getByName("Green"), uno::UNO_QUERY);
+uno::Reference xCell1Style;
+
+xTableStyle->getByName("first-row-start-column") >>= xCell1Style;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff00), 
getProperty(xCell1Style, "BackColor"));
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/python/check_styles.py b/sw/qa/python/check_styles.py
index 372455e..8022acd 100644
--- a/sw/qa/python/check_styles.py
+++ b/sw/qa/python/check_styles.py
@@ -232,8 +232,9 @@ class CheckStyle(unittest.TestCase):
 xTableStyle2 = xDoc.createInstance("com.sun.star.style.TableStyle")
 with self.assertRaises(IllegalArgumentException):   #replace with 
other family style
 xTableStyle.replaceByName("first-row", xTableStyle2)
-with self.assertRaises(IllegalArgumentException):   #replace with 
already assigned cell style
-xTableStyle.replaceByName("first-row", 
xTableStyle2.getByName("first-row"))
+#replace with already assigned cell style
+xTableStyle.replaceByName("first-row", 
xTableStyle2.getByName("first-row"))
+self.assertEqual(xTableStyle.getByName("first-row"), 
xTableStyle2.getByName("first-row"))
 xDoc.StyleFamilies.getByName("CellStyles").insertByName("Test Cell 
Style", xCellStyle)
 xTableStyle.replaceByName("first-row", xCellStyle)
 self.assertEqual(xTableStyle.getByName("first-row"), xCellStyle)
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 0ada4b6..daa055b 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -374,6 +374,8 @@ SwDoc::SwDoc()
 }
 mnRsidRoot = mnRsid;
 
+mpTableStyles->Load();
+
 getIDocumentState().ResetModified();
 }
 
diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index 8d7e8a1..3d71381 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -4646,12 +4646,11 @@ void SAL_CALL SwXTextTableStyle::replaceByName(const 
OUString& rName, const uno:
 throw lang::IllegalArgumentException();
 
 SwXTextCellStyle* pStyleToReplaceWith = 
dynamic_cast<SwXTextCellStyle*>(xStyle.get());
-// replace only with physical ...
-if (pStyleToReplaceWith && !pStyleToReplaceWith->IsPhysical())
-throw lang::IllegalArgumentException();
+if (!pStyleToReplaceWith)
+ throw lang::IllegalArgumentException();
 
-// ... unassigned cell styles
-if 
(!m_pDocShell->GetDoc()->GetCellStyles().GetBoxFormat(xStyle->getName()))
+// replace only with physical ...
+if (!pStyleToReplaceWith->IsPhysical())
 throw lang::IllegalArgumentException();
 
 const auto& rTableTemplateMap = SwTableAutoFormat::GetTableTemplateMap();
@@ -4865,12 +4864,11 @@ OUString SAL_CALL SwXTextCellStyle::getParentStyle() 
throw (css::uno::RuntimeExc
 return m_sParentStyle;

GSoC Weekly Report #9 - Table Styles

2016-07-25 Thread Jakub Trzebiatowski

Hello,
This week wasn't very productive for me. I was feeling sick on Tuesday.

I was working on table style tab. Made a change and pushed it to the 
gerrit,
but it was touching to much in one commit. Also the tests were failing. 
Took
the change from gerrit down. Now I'm working to fix it into separate 
commits.


Regards,
Jakub
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


GSoC Weekly Report #8 - Table Styles

2016-07-18 Thread Jakub Trzebiatowski

Dear community,

This week I was working on XPropertyState for Cell styles.
https://gerrit.libreoffice.org/#/c/27215/

Also was working on a Table Styles tab in Styles and Formatting sidebar 
(F11).

Made some progress, picture: http://i.imgur.com/Y765dVA.png.

Discovered a bug in table styles import. When importing a table style, if a
table style with the same name already exists, then the table style is 
getting

corrupted.

Also found a potential import performance issue. When importing into a 
doc with

a lot of table styles, there is a loop with will iterate very much.
http://opengrok.libreoffice.org/xref/core/xmloff/source/table/XMLTableImport.
cxx#275

I'm working to fix these issues. And working on a Table Styles tab in 
Styles

and Formatting sidebar.

Regards,
Jakub Trzebiatowski, irc ubap

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: sw/qa sw/source

2016-07-15 Thread Jakub Trzebiatowski
 sw/qa/extras/odfexport/data/table_styles_3.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx   |   59 
 sw/source/core/unocore/unostyle.cxx|  120 -
 3 files changed, 177 insertions(+), 2 deletions(-)

New commits:
commit 0710fcd58d29d7ba98f0305caab79f9b7b1519a2
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Thu Jul 14 11:35:59 2016 +0200

GSoC Writer Table Styles; Cell Style XPropertyState

Implemented XPropertyState for SwXTextCellStyle,
that allows to skip export of default valued attributes.
Implemented odfexport tests.

Change-Id: I906c63d4937e378cf89750616fc9ec929c7f3e44
Reviewed-on: https://gerrit.libreoffice.org/27215
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>
Tested-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sw/qa/extras/odfexport/data/table_styles_3.odt 
b/sw/qa/extras/odfexport/data/table_styles_3.odt
new file mode 100644
index 000..7367864
Binary files /dev/null and b/sw/qa/extras/odfexport/data/table_styles_3.odt 
differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index fc8fd71..1e8febf 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -1064,6 +1064,65 @@ DECLARE_ODFEXPORT_TEST(testTableStyles2, 
"table_styles_2.odt")
 CPPUNIT_ASSERT_EQUAL(sal_Int16(2), nInt16);
 }
 
+DECLARE_ODFEXPORT_TEST(testTableStyles3, "table_styles_3.odt")
+{
+// This test checks if default valued attributes aren't exported.
+if (xmlDocPtr pXmlDoc = parseExport("styles.xml"))
+{
+// 
+// For this element the only exported attributes are: "border-left", 
"border-bottom"
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style3.2']/style:table-cell-properties", "background-color");
+// border-left place
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style3.2']/style:table-cell-properties", "border-right");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style3.2']/style:table-cell-properties", "border-top");
+// border-bottom place
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style3.2']/style:table-cell-properties", "padding");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style3.2']/style:table-cell-properties", "padding-left");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style3.2']/style:table-cell-properties", "padding-right");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style3.2']/style:table-cell-properties", "padding-top");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style3.2']/style:table-cell-properties", "padding-bottom");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style3.2']/style:table-cell-properties", "writing-mode");
+
+//  should be absent, because it has only 
"text-align" attribute, which shouldn't be exported.
+// Assume that style:paragraph-properties and style:text-properties 
exists.
+assertXPathChildren(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style3.2']", 2);
+
+// 
+// For this element the only exported attributes are: 
"use-window-font-color place", "font-size-asian", "font-name-asian", 
"font-family-asian", "font-name-complex", "font-family-complex"
+// use-window-font-color place
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style3.2']/style:text-properties", "text-shadow");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style3.2']/style:text-properties", "text-outline");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@style:display-name='Test 
style3.2']/style:text-properties", "text-line-through-style");
+assertXPathNoAttribute(pXmlDoc, 
"/office:document-styles/office:styles/style:style[@sty

GSoC Weekly Report #7 - Table Styles

2016-07-11 Thread Jakub Trzebiatowski

Dear community,

This week I was looking how to export paragraph and char attributes of a 
cell
style. Finally found it out. The export, import and exports tests code 
can be

found at gerrit:
https://gerrit.libreoffice.org/#/c/27115/

Next I will have to implement XPropertyState for a the remaining cell style
attributes.

If everything goes fine I would like to start working on table autoformat
dialog.
I have the following Design Meeting paper:
https://docs.google.com/document/d/1FPkf9fn79dXJ5tHpc-meMYxaQpj3nV5sEN6u9HOo2GQ/
edit
However I don't know which table autoformat dialog design would be the 
best to

implement.

Or maybe would it be better to start from table styles panel, or table
styles toolbar?

Looking forward to your reply.

Regards,
Jakub Trzebiatowski, ubap
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


GSoC Weekly Report #6 - Table Styles

2016-07-04 Thread Jakub Trzebiatowski

Hello community,

This week I was still working on importing of cell styles. Made basic
sw_odfexport test, and implemented two new log areas: sw.xml, xmloff.table.
https://gerrit.libreoffice.org/#/c/26721/

I don't know yet how to do a import and export of text/paragraph style of a
table cell. I think about creating temporary paragraph styles named same as
cell styles. Create them just for export of table template, then delete.

In parallel I started to think about the UI. Firstly, I want to focus on 
the

table autoformat dialog.

Regards,
Jakub
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


GSoC Weekly Report #5 - Table Styles

2016-06-27 Thread Jakub Trzebiatowski

Dear Community,

This was the fifth week. This week I was working on importing table styles.

 * Expanded the infrastructure of Table Style UNO API
   (https://gerrit.libreoffice.org/#/c/26578/):
 o insertByName
 o replaceByName
 o removeByName
 o replaceByName

 * Made import of table styles work.
 o https://gerrit.libreoffice.org/#/c/26721/
 o Still need to resolve some things.

 *  Things I want to do next:
 o  Polish import of table styles. Make tests to cover import code.
 o  Implement XPropertyState for cell styles (stop exporting
   properties with default value).
 o  Research how to export paragraph styles for cells.

Regards,
Jakub Trzebiatowski




___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: sw/inc sw/qa sw/source

2016-06-24 Thread Jakub Trzebiatowski
 sw/inc/tblafmt.hxx  |1 
 sw/inc/unostyle.hxx |   37 +++-
 sw/qa/python/check_styles.py|   30 +++
 sw/source/core/doc/tblafmt.cxx  |   30 ++-
 sw/source/core/unocore/unostyle.cxx |  294 +---
 5 files changed, 286 insertions(+), 106 deletions(-)

New commits:
commit d945e97d8f85465f04f59fd197ded2edb56caac3
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Wed Jun 22 22:40:20 2016 +0200

GSoC Table Style Family: insertByName, replaceByName, removeByName

- also implements SwXTextTableStyle::replaceByName

- some refactorization
  + use std::unique_ptr

- fixes some bugs:
 + posible nullptr dereference in tblafmt.cxx
 + SwXTextTableStyle::getName() returned translated name
 + remvoed unnecesary SetXObject in Cell Style Family replacebyName

- tests

Change-Id: Idd25d54695ab5a4bdd4daf7ebf37b05fbc2366e7
Reviewed-on: https://gerrit.libreoffice.org/26578
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index fc698ef..0eb799a 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -343,6 +343,7 @@ public:
 
 void InsertAutoFormat(size_t i, std::unique_ptr 
pFormat);
 void EraseAutoFormat(size_t i);
+void EraseAutoFormat(const OUString& rName);
 std::unique_ptr ReleaseAutoFormat(size_t i);
 
 /// Find table style with the provided name, return nullptr when not found.
diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx
index 07311e8..cc24073 100644
--- a/sw/inc/unostyle.hxx
+++ b/sw/inc/unostyle.hxx
@@ -254,12 +254,16 @@ class SwXTextTableStyle : public cppu::WeakImplHelper
 <
 css::style::XStyle,
 css::beans::XPropertySet,
-css::container::XNameAccess,
+css::container::XNameContainer,
 css::lang::XServiceInfo
 >
 {
 SwDocShell* m_pDocShell;
-OUString m_sTableAutoFormatName;
+SwTableAutoFormat* m_pTableAutoFormat;
+/// Stores SwTableAutoFormat when this is not a physical style.
+std::unique_ptr m_pTableAutoFormat_Impl;
+/// If true, then it points to a core object, if false, then this is a 
created, but not-yet-inserted format.
+bool m_bPhysical;
 
 enum {
 FIRST_ROW_STYLE = 0,
@@ -282,12 +286,21 @@ class SwXTextTableStyle : public cppu::WeakImplHelper
 STYLE_COUNT
 };
 
-SwTableAutoFormat* GetTableAutoFormat();
+/// Fills m_aCellStyles with SwXTextCellStyles pointing to children of 
this style.
+void UpdateCellStylesMapping();
 static const CellStyleNameMap& GetCellStyleNameMap();
 css::uno::Reference m_aCellStyles[STYLE_COUNT];
 public:
+SwXTextTableStyle(SwDocShell* pDocShell, SwTableAutoFormat* 
pTableAutoFormat);
+/// Create non physical style
 SwXTextTableStyle(SwDocShell* pDocShell, const OUString& 
rTableAutoFormatName);
 
+/// This function looks for a SwTableAutoFormat with given name. Returns 
nullptr if could not be found.
+static SwTableAutoFormat* GetTableAutoFormat(SwDocShell* pDocShell, const 
OUString& sName);
+/// Returns box format assigned to this style
+SwTableAutoFormat* GetTableFormat();
+void SetPhysical();
+
 //XStyle
 virtual sal_Bool SAL_CALL isUserDefined() throw 
(css::uno::RuntimeException, std::exception) override;
 virtual sal_Bool SAL_CALL isInUse() throw (css::uno::RuntimeException, 
std::exception) override;
@@ -312,6 +325,11 @@ public:
 virtual css::uno::Sequence SAL_CALL getElementNames() 
throw(css::uno::RuntimeException, std::exception) override;
 virtual sal_Bool SAL_CALL hasByName(const OUString& rName) 
throw(css::uno::RuntimeException, std::exception) override;
 
+//XNameContainer
+virtual void SAL_CALL insertByName(const OUString& rName, const 
css::uno::Any& aElement) throw(css::lang::IllegalArgumentException, 
css::container::ElementExistException, css::lang::WrappedTargetException, 
css::uno::RuntimeException, std::exception) override;
+virtual void SAL_CALL replaceByName(const OUString& rName, const 
css::uno::Any& aElement) throw(css::lang::IllegalArgumentException, 
css::container::NoSuchElementException, css::lang::WrappedTargetException, 
css::uno::RuntimeException, std::exception) override;
+virtual void SAL_CALL removeByName(const OUString& rName) 
throw(css::container::NoSuchElementException, 
css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) 
override;
+
 //XElementAccess
 virtual css::uno::Type SAL_CALL getElementType() 
throw(css::uno::RuntimeException, std::exception) override;
 virtual sal_Bool SAL_CALL hasElements() throw(css::uno::RuntimeException, 
std::exception) override;
@@ -335,15 +353,17 @@ class SwXTextCellStyle : public cppu::WeakImplHelper
 {
 SwDocShell* m_pDocShell;
 SwBoxAutoFormat* m_

GSoC Weekly Report #4 - Table Styles

2016-06-20 Thread Jakub Trzebiatowski

Dear Community,

This was the fourth week. This week I was working on:

- Implemented isInUse() and isUserDefined() for table styles and cell 
styles.

  This was required for a correct export.
  + https://gerrit.libreoffice.org/#/c/26366/

- Expanded table styles by table:first-row-end-column,
  table:first-row-start-column, table:last-row-end-column,
  table:last-row-start-column properties.
  + https://gerrit.libreoffice.org/#/c/26359/

- Implemented basic export of cell styles and table styles (table-template).
  To properly map a core table style class (SwTableAutoFormat) and
  odf table-template implemented new table-template elements in loext 
namespace:

  loext:first-row-even-column, loext:last-row-even-column
  loext:first-row-end-column, loext:first-row-start-column
  loext:last-row-end-column, loext:last-row-start-column.
  + https://gerrit.libreoffice.org/#/c/26185/

Plans for this week:
- Will be working on cell style and table style import.

Regards,
Jakub Trzebiatowski, ubap

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: include/xmloff sw/inc sw/qa sw/source xmloff/source

2016-06-20 Thread Jakub Trzebiatowski
 include/xmloff/table/XMLTableExport.hxx |1 
 include/xmloff/xmltoken.hxx |8 +
 sw/inc/unostyle.hxx |7 +
 sw/qa/python/check_styles.py|2 
 sw/source/core/doc/tblafmt.cxx  |   45 +++--
 sw/source/core/unocore/unomap.cxx   |   14 ++-
 sw/source/core/unocore/unostyle.cxx |   40 
 sw/source/filter/xml/xmlfmte.cxx|1 
 xmloff/source/core/xmltoken.cxx |8 +
 xmloff/source/style/prhdlfac.cxx|   21 
 xmloff/source/table/XMLTableExport.cxx  |  146 +---
 xmloff/source/text/txtprhdl.cxx |   19 
 12 files changed, 270 insertions(+), 42 deletions(-)

New commits:
commit 309bc35559cb823415139044272b10feccdb6ae7
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Sat Jun 11 15:17:48 2016 +0200

GSoC Table Styles, Export Cell Styles

Exporting cell-styles
Exporting table-template
To be able to map SwTableAutoFormat to table-template 1:1
extended table-template by the following elements:
loext:first-row-even-column
loext:last-row-even-column
loext:first-row-end-column
loext:first-row-start-column
loext:last-row-end-column
loext:last-row-start-column

Added attributes describing box format to SwXTextCellStyle

Change-Id: I2967ba461dfc6f030c1e5cdbba62e2673d3b232b
Reviewed-on: https://gerrit.libreoffice.org/26185
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/include/xmloff/table/XMLTableExport.hxx 
b/include/xmloff/table/XMLTableExport.hxx
index 73ad0e3..c91c734 100644
--- a/include/xmloff/table/XMLTableExport.hxx
+++ b/include/xmloff/table/XMLTableExport.hxx
@@ -83,6 +83,7 @@ private:
 std::map< const css::uno::Reference< css::table::XColumnRowRange >, 
std::shared_ptr< XMLTableInfo > >
 maTableInfoMap;
 boolmbExportTables;
+boolmbWriter;
 
 protected:
 SvXMLExport& GetExport() { return mrExport; }
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index aaabbba..5b0902d 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -3067,6 +3067,14 @@ namespace xmloff { namespace token {
 XML_ODD_ROWS,
 XML_EVEN_COLUMNS,
 XML_ODD_COLUMNS,
+// table styles
+XML_FIRST_ROW_EVEN_COLUMN,
+XML_LAST_ROW_EVEN_COLUMN,
+XML_FIRST_ROW_END_COLUMN,
+XML_FIRST_ROW_START_COLUMN,
+XML_LAST_ROW_END_COLUMN,
+XML_LAST_ROW_START_COLUMN,
+
 XML_HORIZONTAL_ON_ODD,
 // Password error from 1.4 to 2.0 Beta (#i45874#)
 XML_RESTART_NUMBERING,
diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx
index cbb04f5..07311e8 100644
--- a/sw/inc/unostyle.hxx
+++ b/sw/inc/unostyle.hxx
@@ -272,6 +272,13 @@ class SwXTextTableStyle : public cppu::WeakImplHelper
 ODD_COLUMNS_STYLE,
 BODY_STYLE,
 BACKGROUND_STYLE,
+// loext namespace
+FIRST_ROW_START_COLUMN_STYLE,
+FIRST_ROW_END_COLUMN_STYLE,
+LAST_ROW_START_COLUMN_STYLE,
+LAST_ROW_END_COLUMN_STYLE,
+FIRST_ROW_EVEN_COLUMN_STYLE,
+LAST_ROW_EVEN_COLUMN_STYLE,
 STYLE_COUNT
 };
 
diff --git a/sw/qa/python/check_styles.py b/sw/qa/python/check_styles.py
index 7a3e80e..144082a 100644
--- a/sw/qa/python/check_styles.py
+++ b/sw/qa/python/check_styles.py
@@ -206,7 +206,7 @@ class CheckStyle(unittest.TestCase):
 def test_CellFamily(self):
 xDoc = CheckStyle._uno.openEmptyWriterDoc()
 xCellStyles = xDoc.StyleFamilies["CellStyles"]
-vEmptyDocStyles = ['Default Style.1', 'Default Style.2', 'Default 
Style.3', 'Default Style.4', 'Default Style.5', 'Default Style.6', 'Default 
Style.7', 'Default Style.8', 'Default Style.9', 'Default Style.10']
+vEmptyDocStyles = ['Default Style.1', 'Default Style.2', 'Default 
Style.3', 'Default Style.4', 'Default Style.5', 'Default Style.6', 'Default 
Style.7', 'Default Style.8', 'Default Style.9', 'Default Style.10', 'Default 
Style.11', 'Default Style.12', 'Default Style.13', 'Default Style.14', 'Default 
Style.15', 'Default Style.16']
 self.__test_StyleFamily(xCellStyles, vEmptyDocStyles, 
"SwXTextCellStyle")
 self.__test_StyleFamilyIndex(xCellStyles, vEmptyDocStyles, 
"SwXTextCellStyle")
 self.__test_StyleFamilyInsert(xDoc, xCellStyles, vEmptyDocStyles, 
"com.sun.star.style.CellStyle", "com.sun.star.style.CharacterStyle")
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index d5b623d..481f65f 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -1073,22 +1073,47 @@ OUString 
Sw

[Libreoffice-commits] core.git: sw/inc sw/source

2016-06-17 Thread Jakub Trzebiatowski
 sw/inc/tblafmt.hxx  |8 +
 sw/inc/unoprnms.hxx |4 ++
 sw/inc/unostyle.hxx |   10 ++
 sw/source/core/doc/tblafmt.cxx  |   23 +++
 sw/source/core/unocore/unomap.cxx   |4 ++
 sw/source/core/unocore/unostyle.cxx |   54 
 6 files changed, 103 insertions(+)

New commits:
commit 98e3e2414b4cf80343af3499414f6a5ef86d7ae8
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Thu Jun 16 11:56:01 2016 +0200

GSoC Table Styles, Add TableStyle properties

Added properties for the following odf attributes:
table:first-row-end-column
table:first-row-start-column
table:last-row-end-column
table:last-row-start-column

Change-Id: Iac140e00a3439740623649ea234504f08146aaf3
Reviewed-on: https://gerrit.libreoffice.org/26359
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index 6ed138d..fc698ef 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -118,6 +118,8 @@ public:
 ~SwBoxAutoFormat();
 
 SwBoxAutoFormat& operator=( const SwBoxAutoFormat& rNew );
+/// Comparing based of boxes backgrounds.
+bool operator==(const SwBoxAutoFormat& rRight);
 
 // The get-methods.
 const SvxFontItem   () const{ return m_aFont; }
@@ -300,6 +302,12 @@ public:
 void SetValueFormat( const bool bNew )  { bInclValueFormat = bNew; }
 void SetWidthHeight( const bool bNew )  { bInclWidthHeight = bNew; }
 
+/// These methods returns what style (row or column) is applied first on 
given Cell
+bool FirstRowEndColumnIsRow();
+bool FirstRowStartColumnIsRow();
+bool LastRowEndColumnIsRow();
+bool LastRowStartColumnIsRow();
+
 bool Load( SvStream& rStream, const SwAfVersions& );
 bool Save( SvStream& rStream, sal_uInt16 fileVersion ) const;
 
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 8a43709..0d1322d 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -843,6 +843,10 @@
 #define UNO_NAME_ROW_INTEROP_GRAB_BAG "RowInteropGrabBag"
 #define UNO_NAME_TABLE_INTEROP_GRAB_BAG "TableInteropGrabBag"
 
+#define UNO_NAME_TABLE_FIRST_ROW_END_COLUMN "FirstRowEndColumn"
+#define UNO_NAME_TABLE_FIRST_ROW_START_COLUMN "FirstRowStartColumn"
+#define UNO_NAME_TABLE_LAST_ROW_END_COLUMN "LastRowEndColumn"
+#define UNO_NAME_TABLE_LAST_ROW_START_COLUMN "LastRowStartColumn"
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx
index bac73cf..cbb04f5 100644
--- a/sw/inc/unostyle.hxx
+++ b/sw/inc/unostyle.hxx
@@ -253,6 +253,7 @@ typedef std::map<OUString, sal_Int32> CellStyleNameMap;
 class SwXTextTableStyle : public cppu::WeakImplHelper
 <
 css::style::XStyle,
+css::beans::XPropertySet,
 css::container::XNameAccess,
 css::lang::XServiceInfo
 >
@@ -290,6 +291,15 @@ public:
 virtual OUString SAL_CALL getName() throw(css::uno::RuntimeException, 
std::exception) override;
 virtual void SAL_CALL setName(const OUString& rName) 
throw(css::uno::RuntimeException, std::exception) override;
 
+//XPropertySet
+virtual css::uno::Reference SAL_CALL 
getPropertySetInfo() throw(css::uno::RuntimeException, std::exception) override;
+virtual void SAL_CALL setPropertyValue(const OUString& aPropertyName, 
const css::uno::Any& aValue) throw(css::beans::UnknownPropertyException, 
css::beans::PropertyVetoException, css::lang::IllegalArgumentException, 
css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) 
override;
+virtual css::uno::Any SAL_CALL getPropertyValue(const OUString& 
PropertyName) throw(css::beans::UnknownPropertyException, 
css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) 
override;
+virtual void SAL_CALL addPropertyChangeListener(const OUString& 
aPropertyName, const css::uno::Reference& 
xListener) throw(css::beans::UnknownPropertyException, 
css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) 
override;
+virtual void SAL_CALL removePropertyChangeListener(const OUString& 
aPropertyName, const css::uno::Reference& 
aListener) throw(css::beans::UnknownPropertyException, 
css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) 
override;
+virtual void SAL_CALL addVetoableChangeListener(const OUString& 
PropertyName, const css::uno::Reference& 
aListener) throw(css::beans::UnknownPropertyException, 
css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) 
override;
+virtual void SAL_CALL removeVetoableChangeListener(const OUString& 
PropertyName, const css::uno::Reference& 
aListener) throw(css::beans::Un

[Libreoffice-commits] core.git: sw/qa sw/source

2016-06-17 Thread Jakub Trzebiatowski
 sw/qa/python/check_styles.py|   20 +
 sw/source/core/unocore/unostyle.cxx |   54 ++--
 2 files changed, 72 insertions(+), 2 deletions(-)

New commits:
commit 17f440e7e7f1621edebc58f8be5e85b68ee7dcf4
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Thu Jun 16 13:40:59 2016 +0200

GSoC Table Styles, TableStyle isInUse, isUserDefined, mutex fixes

Also added:
+ SwXTextCellStyle::IsInUse()
+ check_styles.py
SwXTextTableStyle::isUserDefined() tests

Change-Id: I76cb166107f186098599c4a8da6f94f7c40cc545
Reviewed-on: https://gerrit.libreoffice.org/26366
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sw/qa/python/check_styles.py b/sw/qa/python/check_styles.py
index d2ea6a9..7a3e80e 100644
--- a/sw/qa/python/check_styles.py
+++ b/sw/qa/python/check_styles.py
@@ -183,6 +183,26 @@ class CheckStyle(unittest.TestCase):
 xCellStyle.getPropertyValue("foobarbaz")
 xDoc.dispose()
 
+def test_tableStyleIsInUse(self):
+# extend when TableStyle insertByName comes
+xDoc = CheckStyle._uno.openEmptyWriterDoc()
+xBodyText = xDoc.getText()
+xCursor = xBodyText.createTextCursor()
+xTable = xDoc.createInstance("com.sun.star.text.TextTable")
+xTable.initialize(1, 1)
+xBodyText.insertTextContent(xCursor, xTable, True)
+xDefaultTableStyle = 
xDoc.StyleFamilies.getByName("TableStyles").getByName("Default Style")
+xDefaultCellStyle = 
xDoc.StyleFamilies.getByName("CellStyles").getByName("Default Style.1")
+self.assertFalse(xDefaultTableStyle.isInUse())
+self.assertFalse(xDefaultCellStyle.isInUse())
+xTable.setPropertyValue("TableTemplateName", "Default Style")
+self.assertTrue(xDefaultTableStyle.isInUse())
+self.assertTrue(xDefaultCellStyle.isInUse())
+xTable.setPropertyValue("TableTemplateName", "")
+self.assertFalse(xDefaultTableStyle.isInUse())
+self.assertFalse(xDefaultCellStyle.isInUse())
+xDoc.dispose()
+
 def test_CellFamily(self):
 xDoc = CheckStyle._uno.openEmptyWriterDoc()
 xCellStyles = xDoc.StyleFamilies["CellStyles"]
diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index ffc9619..ab000ae 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -61,6 +61,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -4408,11 +4409,36 @@ const CellStyleNameMap& 
SwXTextTableStyle::GetCellStyleNameMap()
 // XStyle
 sal_Bool SAL_CALL SwXTextTableStyle::isUserDefined() throw 
(uno::RuntimeException, std::exception)
 {
-return false;
+SolarMutexGuard aGuard;
+// only first style is not user defined
+if (m_pDocShell->GetDoc()->GetTableStyles()[0].GetName() == 
m_sTableAutoFormatName)
+return false;
+
+return true;
 }
 
 sal_Bool SAL_CALL SwXTextTableStyle::isInUse() throw (uno::RuntimeException, 
std::exception)
 {
+SolarMutexGuard aGuard;
+uno::Reference 
xTablesSupp(m_pDocShell->GetModel(), uno::UNO_QUERY);
+if (!xTablesSupp.is())
+return false;
+
+uno::Reference 
xTables(xTablesSupp->getTextTables(), uno::UNO_QUERY);
+if (!xTables.is())
+return false;
+
+const sal_Int32 nCount = xTables->getCount();
+for (sal_Int32 i=0; i < nCount; ++i)
+{
+uno::Reference xTablePropertySet;
+xTables->getByIndex(i) >>= xTablePropertySet;
+OUString sTableTemplateName;
+if (xTablePropertySet.is() && 
(xTablePropertySet->getPropertyValue("TableTemplateName") >>= 
sTableTemplateName)
+&& sTableTemplateName == m_sTableAutoFormatName)
+return true;
+}
+
 return false;
 }
 
@@ -4427,6 +4453,7 @@ void SAL_CALL SwXTextTableStyle::setParentStyle(const 
OUString& /*aParentStyle*/
 //XNamed
 OUString SAL_CALL SwXTextTableStyle::getName() throw(uno::RuntimeException, 
std::exception)
 {
+SolarMutexGuard aGuard;
 OUString sProgName;
 SwStyleNameMapper::FillProgName(m_sTableAutoFormatName, sProgName, 
nsSwGetPoolIdFromName::GET_POOLID_TABSTYLE, true);
 return m_sTableAutoFormatName;
@@ -4621,6 +4648,7 @@ css::uno::Reference 
SwXTextCellStyle::CreateXTextCellStyle(S
 // XStyle
 sal_Bool SAL_CALL SwXTextCellStyle::isUserDefined() throw 
(css::uno::RuntimeException, std::exception)
 {
+SolarMutexGuard aGuard;
 // if this cell belong to first table style then its defaut style
 if (_pDocShell->GetDoc()->GetTableStyles()[0] == 
m_pDocShell->GetDoc()->GetTableStyles().FindAutoFormat(m_sParentStyle))
 return false;
@@ -4630,7 +4658

GSoC Weekly Report #3 - Table Styles

2016-06-13 Thread Jakub Trzebiatowski

Dear Community,

This was the third week. This week I was working on:

- Added CellStyle family. This required me to create a container in 
SwDoc to

  store unassigned SwBoxFormats.
+ getByName, getElementNames, getCount
https://gerrit.libreoffice.org/#/c/25896/
+ insertByName, replaceByName, removeByName
https://gerrit.libreoffice.org/#/c/26037/

- Added odf import test for fdo47267.
https://gerrit.libreoffice.org/#/c/26012/

- Working on odf table-template export. Set up the odfvalidator, officeotron
  Found that current Impress table-template export doesn't match OASIS 
ODF v1.2.

+ Sample export
http://paste.opensuse.org/4000839
+ Gerrit patch (work in progress)
https://gerrit.libreoffice.org/#/c/26185/

- This week I had four exams, and very probably I passed all of them.
  If so I'll have just one more exam, in two weeks. So for now I'll 
focus on my

  project.

Plans for this week:
- Research how to implement and implement table:first-row-end-column,
  table:first-row-start-column, table:last-row-end-column,
  table:last-row-start-column.
- Finish table-template export.
- Research and work on import.

If you have any remarks and/or suggestions, please share.

Regards,
Jakub Trzebiatowski, ubap

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: sw/inc sw/qa sw/source

2016-06-13 Thread Jakub Trzebiatowski
 sw/inc/doc.hxx  |7 
 sw/inc/tblafmt.hxx  |   31 +++
 sw/inc/unocoll.hxx  |1 
 sw/inc/unostyle.hxx |   28 ++-
 sw/qa/python/check_styles.py|4 
 sw/source/core/doc/docnew.cxx   |1 
 sw/source/core/doc/tblafmt.cxx  |   86 +
 sw/source/core/unocore/unocoll.cxx  |7 
 sw/source/core/unocore/unostyle.cxx |  316 ++--
 sw/source/uibase/app/docstyle.cxx   |   34 ++-
 10 files changed, 406 insertions(+), 109 deletions(-)

New commits:
commit 3464befb48ccf1bf9ad4c8f321c7342db43c4019
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Tue Jun 7 21:57:49 2016 +0200

GSoC Table Styles, CellStyle

- insertByName
- replaceByName
- removeByName

Change-Id: I964aa0dc2e7f5a5be9eaec719b8944e847eb9d6a
Reviewed-on: https://gerrit.libreoffice.org/26037
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index e9b3be5..412b419 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -79,6 +79,7 @@ class SwAutoCompleteWord;
 class SwAutoCorrExceptWord;
 class SwCalc;
 class SwCellFrame;
+class SwCellStyleTable;
 class SwCharFormat;
 class SwCharFormats;
 class SwConditionTextFormatColl;
@@ -344,7 +345,8 @@ class SW_DLLPUBLIC SwDoc :
 
 /// Table styles (autoformats that are applied with table changes).
 std::unique_ptr mpTableStyles;
-
+/// Cell Styles not assigned to a Table Style
+std::unique_ptr mpCellStyles;
 private:
 ::std::unique_ptr< ::sfx2::IXmlIdRegistry > m_pXmlIdRegistry;
 
@@ -1255,6 +1257,9 @@ public:
 SwTableAutoFormatTable& GetTableStyles() { return *mpTableStyles.get(); }
 const SwTableAutoFormatTable& GetTableStyles() const { return 
*mpTableStyles.get(); }
 
+const SwCellStyleTable& GetCellStyles() const  { return 
*mpCellStyles.get(); }
+  SwCellStyleTable& GetCellStyles(){ return 
*mpCellStyles.get(); }
+
 void AppendUndoForInsertFromDB( const SwPaM& rPam, bool bIsTable );
 
 bool SetColRowWidthHeight( SwTableBox& rAktBox, sal_uInt16 eType,
diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index 9e5f4a3..6ed138d 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -344,6 +344,37 @@ public:
 bool Save() const;
 };
 
+class SwCellStyleDescriptor
+{
+const std::pair<OUString, SwBoxAutoFormat*>& m_rCellStyleDesc;
+public:
+SwCellStyleDescriptor(const std::pair<OUString, SwBoxAutoFormat*>& 
rCellStyleDesc) : m_rCellStyleDesc(rCellStyleDesc) { }
+
+const OUString&  GetName()   { return m_rCellStyleDesc.first; }
+SwBoxAutoFormat* GetFormat() { return m_rCellStyleDesc.second; }
+};
+
+class SwCellStyleTable
+{
+std::vector<std::pair<OUString, SwBoxAutoFormat*>> m_aCellStyles;
+public:
+SwCellStyleTable();
+~SwCellStyleTable();
+
+size_t size() const;
+SwCellStyleDescriptor operator[](size_t i) const;
+void clear();
+
+/// Add a copy of rBoxFormat
+void AddBoxFormat(const SwBoxAutoFormat& rBoxFormat, const OUString& 
sName);
+void RemoveBoxFormat(const OUString& sName);
+void ChangeBoxFormatName(const OUString& sFromName, const OUString& 
sToName);
+/// If found returns its name. If not found returns an empty OUString
+OUString GetBoxFormatName(const SwBoxAutoFormat& rBoxFormat) const;
+/// If found returns a ptr to a BoxFormat. If not found returns nullptr
+SwBoxAutoFormat* GetBoxFormat(const OUString& sName) const;
+};
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx
index 32979a9..f853fe4 100644
--- a/sw/inc/unocoll.hxx
+++ b/sw/inc/unocoll.hxx
@@ -183,6 +183,7 @@ class SwUnoCollection
 #define SW_SERVICE_VBAPROJECTNAMEPROVIDER   112
 #define SW_SERVICE_VBAGLOBALS   113
 #define SW_SERVICE_STYLE_TABLE_STYLE114
+#define SW_SERVICE_STYLE_CELL_STYLE 115
 
 #define SW_SERVICE_INVALID  USHRT_MAX
 
diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx
index 8b7401a..bac73cf 100644
--- a/sw/inc/unostyle.hxx
+++ b/sw/inc/unostyle.hxx
@@ -317,10 +317,28 @@ class SwXTextCellStyle : public cppu::WeakImplHelper
 >
 {
 SwDocShell* m_pDocShell;
-SwBoxAutoFormat& m_rBoxAutoFormat;
-OUString m_sParentStyle;
-public:
-SwXTextCellStyle(SwDocShell* pDocShell, SwBoxAutoFormat& rBoxAutoFormat, 
const OUString& sParentStyle);
+SwBoxAutoFormat* m_pBoxAutoFormat;
+OUString m_sParentStyle; // used when style is physical
+OUString m_sName;   // used when style is not physical
+bool m_bPhysical; // delete a m_pBoxAutoFormat when changing from false to 
true!
+
+ public:
+SwXTextCellStyle(SwDocShell* pDocShell, SwBox

[Libreoffice-commits] core.git: sw/source

2016-06-08 Thread Jakub Trzebiatowski
 sw/source/core/unocore/unostyle.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 05cd178535619d7cfecc15c059a92c2006f9282d
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Tue Jun 7 23:13:44 2016 +0200

sw SwXTextCellStyle fix possible nullptr dereference

Change-Id: Id6303afdbd294066332c1806699a47086331e9ef
Reviewed-on: https://gerrit.libreoffice.org/26038
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Jakub Trzebiatowski <ubap@gmail.com>
Reviewed-by: jan iversen <j...@documentfoundation.org>

diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index 7f73a61..b87dfe3 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -4468,6 +4468,9 @@ css::uno::Reference 
SwXTextCellStyle::CreateXTextCellStyle(S
 throw;
 
 SwTableAutoFormat* pFormat = 
pDocShell->GetDoc()->GetTableStyles().FindAutoFormat(sParentName);
+if (!pFormat)
+throw;
+
 sal_uInt32 nBoxIndex = rTableTemplateMap[nTemplateIndex];
 pBoxFormat = >GetBoxFormat(nBoxIndex);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/qa

2016-06-08 Thread Jakub Trzebiatowski
 sw/qa/extras/odfimport/data/fdo47267-3.odt |binary
 sw/qa/extras/odfimport/odfimport.cxx   |5 +
 2 files changed, 5 insertions(+)

New commits:
commit 3fd25d2fd8dd29a2c775dee2781591074f1f8f34
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Tue Jun 7 12:40:39 2016 +0200

fdo47267 odf import unit test

Change-Id: I0f745483245b0e75b250ae1c2752f2e157307f0a
Reviewed-on: https://gerrit.libreoffice.org/26012
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: jan iversen <j...@documentfoundation.org>

diff --git a/sw/qa/extras/odfimport/data/fdo47267-3.odt 
b/sw/qa/extras/odfimport/data/fdo47267-3.odt
new file mode 100644
index 000..a30fbc6
Binary files /dev/null and b/sw/qa/extras/odfimport/data/fdo47267-3.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx 
b/sw/qa/extras/odfimport/odfimport.cxx
index 065cf78..6a1f493 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -637,5 +637,10 @@ DECLARE_ODFIMPORT_TEST(testTdf96113, "tdf96113.odt")
 CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff00), 
getProperty(getShape(1), "BackColor"));
 }
 
+DECLARE_ODFIMPORT_TEST(testFdo47267, "fdo47267-3.odt")
+{
+// This was a Style Families getByName() crash
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/rsc sw/inc sw/qa sw/source

2016-06-07 Thread Jakub Trzebiatowski
 include/rsc/rscsfx.hxx   |1 
 sw/inc/SwGetPoolIdFromName.hxx   |1 
 sw/inc/SwStyleNameMapper.hxx |   10 +-
 sw/inc/docstyle.hxx  |2 
 sw/inc/poolfmt.hxx   |7 +
 sw/inc/tblafmt.hxx   |   12 ++
 sw/inc/unocore.hrc   |3 
 sw/inc/unostyle.hxx  |   13 ++-
 sw/qa/python/check_styles.py |   12 ++
 sw/source/core/doc/SwStyleNameMapper.cxx |   30 ++-
 sw/source/core/doc/tblafmt.cxx   |   41 +
 sw/source/core/unocore/unocore.src   |5 +
 sw/source/core/unocore/unostyle.cxx  |  129 ++-
 sw/source/uibase/app/docstyle.cxx|   66 +++
 14 files changed, 305 insertions(+), 27 deletions(-)

New commits:
commit 45a6fdad8101e4ba552ca4d4532d0b03b79dd15a
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Sat Jun 4 12:02:37 2016 +0200

sw UNO Cell Style family, SwXTextCellStyle

Cell Family :: getByName
Cell Family :: getElementNames
Cell Family :: getCount

Change-Id: I37d567ee284054f847c704d9fce370d174a0c48c
Reviewed-on: https://gerrit.libreoffice.org/25896
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/include/rsc/rscsfx.hxx b/include/rsc/rscsfx.hxx
index cc3ab9c..dadf191 100644
--- a/include/rsc/rscsfx.hxx
+++ b/include/rsc/rscsfx.hxx
@@ -38,6 +38,7 @@ enum class SfxStyleFamily {
 Page= 0x08,
 Pseudo  = 0x10,
 Table   = 0x20,
+Cell= 0x40,
 All = 0x7fff
 };
 
diff --git a/sw/inc/SwGetPoolIdFromName.hxx b/sw/inc/SwGetPoolIdFromName.hxx
index 55f3ca6..57e2802 100644
--- a/sw/inc/SwGetPoolIdFromName.hxx
+++ b/sw/inc/SwGetPoolIdFromName.hxx
@@ -32,6 +32,7 @@ namespace nsSwGetPoolIdFromName
 const SwGetPoolIdFromName GET_POOLID_PAGEDESC = 0x08;
 const SwGetPoolIdFromName GET_POOLID_NUMRULE  = 0x10;
 const SwGetPoolIdFromName GET_POOLID_TABSTYLE = 0x20;
+const SwGetPoolIdFromName GET_POOLID_CELLSTYLE= 0x40;
 }
 
 #endif
diff --git a/sw/inc/SwStyleNameMapper.hxx b/sw/inc/SwStyleNameMapper.hxx
index 035e0c6..d4fd06e 100644
--- a/sw/inc/SwStyleNameMapper.hxx
+++ b/sw/inc/SwStyleNameMapper.hxx
@@ -94,6 +94,7 @@ protected:
 *m_pPageDescUINameArray,
 *m_pNumRuleUINameArray,
 *m_pTableStyleUINameArray,
+*m_pCellStyleUINameArray,
 // Programmatic Name tables
 *m_pTextProgNameArray,
 *m_pListsProgNameArray,
@@ -106,7 +107,8 @@ protected:
 *m_pHTMLChrFormatProgNameArray,
 *m_pPageDescProgNameArray,
 *m_pNumRuleProgNameArray,
-*m_pTableStyleProgNameArray;
+*m_pTableStyleProgNameArray,
+*m_pCellStyleProgNameArray;
 
 static NameToIdHash *m_pParaUIMap,
 *m_pCharUIMap,
@@ -114,13 +116,15 @@ protected:
 *m_pFrameUIMap,
 *m_pNumRuleUIMap,
 *m_pTableStyleUIMap,
+*m_pCellStyleUIMap,
 
 *m_pParaProgMap,
 *m_pCharProgMap,
 *m_pPageProgMap,
 *m_pFrameProgMap,
 *m_pNumRuleProgMap,
-*m_pTableStyleProgMap;
+*m_pTableStyleProgMap,
+*m_pCellStyleProgMap;
 
 static void fillNameFromId(sal_uInt16 nId, OUString , bool 
bProgName);
 static const OUString& getNameFromId(sal_uInt16 nId, const OUString ,
@@ -181,6 +185,7 @@ public:
 static const ::std::vector& GetPageDescUINameArray();
 static const ::std::vector& GetNumRuleUINameArray();
 static const ::std::vector& GetTableStyleUINameArray();
+static const ::std::vector& GetCellStyleUINameArray();
 
 static const ::std::vector& GetTextProgNameArray();
 static const ::std::vector& GetListsProgNameArray();
@@ -194,6 +199,7 @@ public:
 static const ::std::vector& GetPageDescProgNameArray();
 static const ::std::vector& GetNumRuleProgNameArray();
 static const ::std::vector& GetTableStyleProgNameArray();
+static const ::std::vector& GetCellStyleProgNameArray();
 };
 #endif // _NAME_MAPPER_HXX
 
diff --git a/sw/inc/docstyle.hxx b/sw/inc/docstyle.hxx
index 89a0745..56a7568 100644
--- a/sw/inc/docstyle.hxx
+++ b/sw/inc/docstyle.hxx
@@ -37,6 +37,7 @@ class SwTextFormatColl;
 class SwFrameFormat;
 class SwNumRule;
 class SwTableAutoFormat;
+class SwBoxAutoFormat;
 
 // Temporary StyleSheet.
 class SW_DLLPUBLIC SwDo

GSoC Weekly Report #2 - Table Styles

2016-06-06 Thread Jakub Trzebiatowski

Dear Community,

This was the second week. This week I was working on:

- added table-template property to an existing table UNO API
  https://gerrit.libreoffice.org/#/c/25688/
- basic export of a table-template. However it appeared it is too early 
to do

  that.
- fixed a fdo47267 import crash which I introduced last week
  https://gerrit.libreoffice.org/#/c/25887/
- working on Cell Styles UNO family. Still have to resolve doubts. How and
  where will be unassigned Cell Styles stored.
  https://gerrit.libreoffice.org/#/c/25896/2

Plans for this week:
- finish Cell Styles UNO family
- research, and try to do a proper, basic table-template export
- I'll have two exams this week, so I'll have to skip a day or two

If you have any remarks and/or suggestions, please share.

Regards,
Jakub Trzebiatowski, ubap
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: sw/inc sw/source

2016-06-06 Thread Jakub Trzebiatowski
 sw/inc/docstyle.hxx  |3 -
 sw/inc/poolfmt.hrc   |   16 +++
 sw/inc/poolfmt.hxx   |   16 +++
 sw/source/core/doc/SwStyleNameMapper.cxx |   18 
 sw/source/core/doc/tblafmt.cxx   |   12 ++---
 sw/source/core/unocore/unostyle.cxx  |   10 ++--
 sw/source/ui/utlui/poolfmt.src   |   64 +++
 sw/source/uibase/app/docstyle.cxx|   25 
 8 files changed, 152 insertions(+), 12 deletions(-)

New commits:
commit efb38949a44dec7e9f5fee7e9ec34164633d926c
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Sat Jun 4 10:39:41 2016 +0200

fdo47267 fix import crash

fixed import crash introduced in d4188f643db050c962a937547d19a9a08bd2235d

Change-Id: I0bf76fd345438e3cd303ee85c770aa0515c056df
Reviewed-on: https://gerrit.libreoffice.org/25887
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sw/inc/docstyle.hxx b/sw/inc/docstyle.hxx
index a58ba3a..89a0745 100644
--- a/sw/inc/docstyle.hxx
+++ b/sw/inc/docstyle.hxx
@@ -36,6 +36,7 @@ class SwCharFormat;
 class SwTextFormatColl;
 class SwFrameFormat;
 class SwNumRule;
+class SwTableAutoFormat;
 
 // Temporary StyleSheet.
 class SW_DLLPUBLIC SwDocStyleSheet : public SfxStyleSheetBase
@@ -48,7 +49,7 @@ class SW_DLLPUBLIC SwDocStyleSheet : public SfxStyleSheetBase
 SwFrameFormat*   pFrameFormat;
 const SwPageDesc*   pDesc;
 const SwNumRule*pNumRule;
-
+const SwTableAutoFormat* pTableFormat;
 SwDoc&  rDoc;
 SfxItemSet  aCoreSet;
 
diff --git a/sw/inc/poolfmt.hrc b/sw/inc/poolfmt.hrc
index c1140fb..3cc6858 100644
--- a/sw/inc/poolfmt.hrc
+++ b/sw/inc/poolfmt.hrc
@@ -266,6 +266,22 @@
 // Table styles
 
 #define STR_TABSTYLE_DEFAULT(RC_POOLTABSTYLE_BEGIN+  0)
+#define STR_TABSTYLE_3D (RC_POOLTABSTYLE_BEGIN+  1)
+#define STR_TABSTYLE_BLACK1 (RC_POOLTABSTYLE_BEGIN+  2)
+#define STR_TABSTYLE_BLACK2 (RC_POOLTABSTYLE_BEGIN+  3)
+#define STR_TABSTYLE_BLUE   (RC_POOLTABSTYLE_BEGIN+  4)
+#define STR_TABSTYLE_BROWN  (RC_POOLTABSTYLE_BEGIN+  5)
+#define STR_TABSTYLE_CURRENCY   (RC_POOLTABSTYLE_BEGIN+  6)
+#define STR_TABSTYLE_CURRENCY_3D(RC_POOLTABSTYLE_BEGIN+  7)
+#define STR_TABSTYLE_CURRENCY_GRAY  (RC_POOLTABSTYLE_BEGIN+  8)
+#define STR_TABSTYLE_CURRENCY_LAVENDER  (RC_POOLTABSTYLE_BEGIN+  9)
+#define STR_TABSTYLE_CURRENCY_TURQUOISE (RC_POOLTABSTYLE_BEGIN+  10)
+#define STR_TABSTYLE_GRAY   (RC_POOLTABSTYLE_BEGIN+  11)
+#define STR_TABSTYLE_GREEN  (RC_POOLTABSTYLE_BEGIN+  12)
+#define STR_TABSTYLE_LAVENDER   (RC_POOLTABSTYLE_BEGIN+  13)
+#define STR_TABSTYLE_RED(RC_POOLTABSTYLE_BEGIN+  14)
+#define STR_TABSTYLE_TURQUOISE  (RC_POOLTABSTYLE_BEGIN+  15)
+#define STR_TABSTYLE_YELLOW (RC_POOLTABSTYLE_BEGIN+  16)
 
 #endif
 
diff --git a/sw/inc/poolfmt.hxx b/sw/inc/poolfmt.hxx
index 65a6d07..6707c43 100644
--- a/sw/inc/poolfmt.hxx
+++ b/sw/inc/poolfmt.hxx
@@ -203,6 +203,22 @@ enum RES_POOL_TABSTYLE_TYPE
 {
 RES_POOLTABSTYLE_BEGIN = POOLGRP_TABSTYLE,
 RES_POOLTABSTYLE_DEFAULT = RES_POOLTABSTYLE_BEGIN,
+RES_POOLTABLESTYLE_3D,
+RES_POOLTABLESTYLE_BLACK1,
+RES_POOLTABLESTYLE_BLACK2,
+RES_POOLTABLESTYLE_BLUE,
+RES_POOLTABLESTYLE_BROWN,
+RES_POOLTABLESTYLE_CURRENCY,
+RES_POOLTABLESTYLE_CURRENCY_3D,
+RES_POOLTABLESTYLE_CURRENCY_GRAY,
+RES_POOLTABLESTYLE_CURRENCY_LAVENDER,
+RES_POOLTABLESTYLE_CURRENCY_TURQUOISE,
+RES_POOLTABLESTYLE_GRAY,
+RES_POOLTABLESTYLE_GREEN,
+RES_POOLTABLESTYLE_LAVENDER,
+RES_POOLTABLESTYLE_RED,
+RES_POOLTABLESTYLE_TURQUOISE,
+RES_POOLTABLESTYLE_YELLOW,
 RES_POOLTABSTYLE_END
 };
 
diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx 
b/sw/source/core/doc/SwStyleNameMapper.cxx
index 4d23cca..f644bbf 100644
--- a/sw/source/core/doc/SwStyleNameMapper.cxx
+++ b/sw/source/core/doc/SwStyleNameMapper.cxx
@@ -317,7 +317,23 @@ const struct SwTableEntry NumRuleProgNameTable [] =
 
 const struct SwTableEntry TableStyleProgNameTable [] =
 {
-ENTRY( "Default Style" ), // RES_POOLTABLESTYLE_DEFAULT
+ENTRY( "Default Style" ), // RES_POOLTABLESTYLE_DEFAULT
+ENTRY( "3D" ),// RES_POOLTABLESTYLE_3D
+ENTRY( "Black 1" ),   // RES_POOLTABLESTYLE_BLACK1
+ENTRY( "Black 2" ),   // RES_POOLTABLESTYLE_BLACK2
+ENTRY( "Blue" ),  // RES_POOLTABLESTYLE_BLUE
+ENTRY( "Brown" ), // RES_POOLTABLESTYLE_BROWN
+ENTRY( "Currency" ),  // RES_POOLTABLESTYLE_CURRENCY
+ENTRY( "Currency 3D" ),   // RES_POOLTABLESTYLE_CURRENCY_3D
+ENTRY( "Currency Gray" ), // RES_POOLTABLESTYLE_CURRENCY_GRAY
+ENTRY( "Currency Lavender" ), /

[Libreoffice-commits] core.git: offapi/com sw/inc sw/qa sw/source

2016-06-01 Thread Jakub Trzebiatowski
 offapi/com/sun/star/text/TextTable.idl |6 ++
 sw/inc/cmdid.h |1 +
 sw/inc/unoprnms.hxx|1 +
 sw/qa/python/check_table.py|   12 
 sw/source/core/unocore/unomap1.cxx |1 +
 sw/source/core/unocore/unotbl.cxx  |   22 ++
 6 files changed, 43 insertions(+)

New commits:
commit fe10783e4abd5509676c777c7aa6f172ab3a8bf6
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Mon May 30 22:07:04 2016 +0200

sw UNO API XTextTable add TableTemplateName property

Change-Id: I8450fd4003ad5f9b082817765a2d44fc00dea15e
Reviewed-on: https://gerrit.libreoffice.org/25688
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/offapi/com/sun/star/text/TextTable.idl 
b/offapi/com/sun/star/text/TextTable.idl
index 23ff278..e47ad56 100644
--- a/offapi/com/sun/star/text/TextTable.idl
+++ b/offapi/com/sun/star/text/TextTable.idl
@@ -221,6 +221,12 @@ published service TextTable
 */
 [optional, property] sequence 
TableInteropGrabBag;
 
+/** contains the name of table style used by the table.
+
+@since LibreOffice 5.3
+ */
+[optional, property] string TableTemplateName;
+
 };
 
 
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 09cd1f4..94bbb0e 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -623,6 +623,7 @@
 #define FN_UNO_REPLACEMENT_GRAPHIC_U_R_L(FN_EXTRA2 + 121)
 #define FN_UNO_HIDDEN   (FN_EXTRA2 + 122)
 #define FN_UNO_STYLE_INTEROP_GRAB_BAG   (FN_EXTRA2 + 123)
+#define FN_UNO_TABLE_TEMPLATE_NAME  (FN_EXTRA2 + 124)
 
 // Area: Help
 // Region: Traveling & Selection
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 63589f2..8a43709 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -306,6 +306,7 @@
 #define UNO_NAME_SURROUND_CONTOUR "SurroundContour"
 #define UNO_NAME_SURROUND_ANCHORONLY "SurroundAnchorOnly"
 #define UNO_NAME_TABLE_NAME "TableName"
+#define UNO_NAME_TABLE_TEMPLATE_NAME "TableTemplateName"
 #define UNO_NAME_TABSTOPS "ParaTabStops"
 #define UNO_NAME_TITLE "Title"
 #define UNO_NAME_TOP_MARGIN "TopMargin"
diff --git a/sw/qa/python/check_table.py b/sw/qa/python/check_table.py
index d718fb8..d766f91 100644
--- a/sw/qa/python/check_table.py
+++ b/sw/qa/python/check_table.py
@@ -482,6 +482,18 @@ class CheckTable(unittest.TestCase):
 self.assertEqual(xTable.getCellByPosition(0, 1).getValue(), 42307.0)
 xDoc.dispose()
 
+def test_tableTemplate(self):
+xDoc = CheckTable._uno.openEmptyWriterDoc()
+xTable = xDoc.createInstance("com.sun.star.text.TextTable")
+xTable.initialize(1, 1)
+xTable.setPropertyValue("TableTemplateName", "Default")
+self.assertEqual(xTable.getPropertyValue("TableTemplateName"), 
"Default")
+xTable.setPropertyValue("TableTemplateName", "other_style")
+self.assertEqual(xTable.getPropertyValue("TableTemplateName"), 
"other_style")
+xTable.setPropertyValue("TableTemplateName", "")
+self.assertEqual(xTable.getPropertyValue("TableTemplateName"), "")
+xDoc.dispose()
+
 if __name__ == '__main__':
 unittest.main()
 
diff --git a/sw/source/core/unocore/unomap1.cxx 
b/sw/source/core/unocore/unomap1.cxx
index 069a15f..c93effc 100644
--- a/sw/source/core/unocore/unomap1.cxx
+++ b/sw/source/core/unocore/unomap1.cxx
@@ -680,6 +680,7 @@ const SfxItemPropertyMapEntry*  
SwUnoPropertyMapProvider::GetTablePropertyMap()
 { OUString(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, 
cppu::UnoType::get(), PROPERTY_NONE, 0 },
 { OUString(UNO_NAME_TABLE_NAME),   FN_UNO_TABLE_NAME,   
cppu::UnoType::get(),PROPERTY_NONE, 0 },
  { OUString(UNO_NAME_PAGE_STYLE_NAME), RES_PAGEDESC, 
cppu::UnoType::get(), PROPERTY_NONE, 0},
+{ OUString(UNO_NAME_TABLE_TEMPLATE_NAME),   
FN_UNO_TABLE_TEMPLATE_NAME,   cppu::UnoType::get(),
PROPERTY_NONE, 0 },
 // #i29550#
 { OUString(UNO_NAME_COLLAPSING_BORDERS), RES_COLLAPSING_BORDERS, 
cppu::UnoType::get(), PROPERTY_NONE, 0},
 REDLINE_NODE_PROPERTIES
diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index eb1de8f..0ff7440 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -106,6 +106,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 using namespace ::com::sun::star;
 using ::editeng::SvxBorderLine;
@@ -2779,6 +2781,18 @@ void SwXTextTable::setPropertyValue(const OUString& 
rPropertyName, const uno::An
 
 case FN_UNO_TABLE_COLUMN_RELATIVE_SUM:/*_readonly_*/ break;
 
+case FN_UNO_TABLE_TEMPLATE_NAME:
+  

[Libreoffice-commits] core.git: sw/inc sw/qa sw/source

2016-05-31 Thread Jakub Trzebiatowski
 sw/inc/tblafmt.hxx  |1 
 sw/inc/unocoll.hxx  |2 
 sw/inc/unomap.hxx   |3 
 sw/inc/unostyle.hxx |   69 +++-
 sw/qa/python/check_styles.py|9 +
 sw/source/core/doc/tblafmt.cxx  |   15 ++
 sw/source/core/unocore/unocoll.cxx  |7 +
 sw/source/core/unocore/unomap.cxx   |   10 +
 sw/source/core/unocore/unomap1.cxx  |6 +
 sw/source/core/unocore/unostyle.cxx |  206 ++--
 10 files changed, 312 insertions(+), 16 deletions(-)

New commits:
commit be0c898587f9464cd7a11be5e6b1d4e8dbd078d8
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Fri May 27 17:55:44 2016 +0200

Sw UNO API SwXTextCellStyle; TableStyles createInstance, XNameAccess

Making createInstance("com.sun.star.style.TableStyle") possible
Making SwXTextTableStyle a XNameAccess container of SwXTextCellStyles

Implementing basic SwXTextCellStyle

CellStyleMap based on svx/source/table/tabledesign.cxx

Change-Id: I5afff1f514582a63a6eb9f9fb44667665749855a
Reviewed-on: https://gerrit.libreoffice.org/25558
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index 73c1f5a..5490dce 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -266,6 +266,7 @@ public:
 
 void SetBoxFormat( const SwBoxAutoFormat& rNew, sal_uInt8 nPos );
 const SwBoxAutoFormat& GetBoxFormat( sal_uInt8 nPos ) const;
+SwBoxAutoFormat& GetBoxFormat( sal_uInt8 nPos );
 
 void SetName( const OUString& rNew ) { m_aName = rNew; nStrResId = 
USHRT_MAX; }
 const OUString& GetName() const { return m_aName; }
diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx
index f4cc3c8..32979a9 100644
--- a/sw/inc/unocoll.hxx
+++ b/sw/inc/unocoll.hxx
@@ -182,7 +182,7 @@ class SwUnoCollection
 #define SW_SERVICE_VBACODENAMEPROVIDER  111
 #define SW_SERVICE_VBAPROJECTNAMEPROVIDER   112
 #define SW_SERVICE_VBAGLOBALS   113
-
+#define SW_SERVICE_STYLE_TABLE_STYLE114
 
 #define SW_SERVICE_INVALID  USHRT_MAX
 
diff --git a/sw/inc/unomap.hxx b/sw/inc/unomap.hxx
index 80439cb..cf5b068 100644
--- a/sw/inc/unomap.hxx
+++ b/sw/inc/unomap.hxx
@@ -123,7 +123,8 @@
 #define PROPERTY_MAP_METAFIELD  98
 #define PROPERTY_MAP_ACCESSIBILITY_TEXT_ATTRIBUTE   99
 #define PROPERTY_MAP_TABLE_STYLE100
-#define PROPERTY_MAP_END101
+#define PROPERTY_MAP_CELL_STYLE 101
+#define PROPERTY_MAP_END102
 
 //S
 #define WID_WORDS0
diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx
index 9a56b5c..9b59091 100644
--- a/sw/inc/unostyle.hxx
+++ b/sw/inc/unostyle.hxx
@@ -248,16 +248,39 @@ protected:
 };
 
 class SwTableAutoFormat;
+typedef std::map<OUString, sal_Int32> CellStyleNameMap;
 
 /// A text table style is a uno api wrapper for a SwTableAutoFormat
-class SwXTextTableStyle : public cppu::WeakImplHelper<css::style::XStyle, 
css::lang::XServiceInfo>
+class SwXTextTableStyle : public cppu::WeakImplHelper
+<
+css::style::XStyle,
+css::container::XNameAccess,
+css::lang::XServiceInfo
+>
 {
-OUString m_sTableAutoFormatName;
 SwDocShell* m_pDocShell;
+OUString m_sTableAutoFormatName;
+
+enum {
+FIRST_ROW_STYLE = 0,
+LAST_ROW_STYLE,
+FIRST_COLUMN_STYLE,
+LAST_COLUMN_STYLE,
+EVEN_ROWS_STYLE,
+ODD_ROWS_STYLE,
+EVEN_COLUMNS_STYLE,
+ODD_COLUMNS_STYLE,
+BODY_STYLE,
+BACKGROUND_STYLE,
+STYLE_COUNT
+};
 
 SwTableAutoFormat* GetTableAutoFormat();
+static const CellStyleNameMap& GetCellStyleNameMap();
+css::uno::Reference m_aCellStyles[STYLE_COUNT];
 public:
 SwXTextTableStyle(SwDocShell* pDocShell, const OUString& 
rTableAutoFormatName);
+
 //XStyle
 virtual sal_Bool SAL_CALL isUserDefined() throw 
(css::uno::RuntimeException, std::exception) override;
 virtual sal_Bool SAL_CALL isInUse() throw (css::uno::RuntimeException, 
std::exception) override;
@@ -268,6 +291,15 @@ public:
 virtual OUString SAL_CALL getName() throw(css::uno::RuntimeException, 
std::exception) override;
 virtual void SAL_CALL setName(const OUString& rName) 
throw(css::uno::RuntimeException, std::exception) override;
 
+//XNameAccess
+virtual css::uno::Any SAL_CALL getByName(const OUString& rName) 
throw(css::container::NoSuchElementException, 
css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) 
override;
+virtual css::uno::Sequence SAL_CALL getElementNames() 
throw(css::uno::RuntimeException, std::exception) override;
+virtual sal_Bool SAL_CALL hasByName(

GSoC Report

2016-05-30 Thread Jakub Trzebiatowski

Dear Community,

I'm working on a table styles as a GSoC project. My first goal is 
to make

existing table styles export and import.
I have started with a core part of table styles - adding them to 
Writer's

UNO API.

Summary of first week:
- Modifified sw_python tests to cover table styles
- Added TableStyles style family
- Implemented getCount, getByIndex, getElementNames, getByName in 
TableStyle

family
- Modified stylesheets iterator to consider table style family.

- Added SwXTextTableStyle class
- A wrapper for internal SwTableAutoFormat class
- A container containing 10 cell styles:
"first-row", "last-row", "first-column", "last-column", "body",
"even-rows", "odd-rows", "even-columns", "odd-columns", 
"background"


Patches can be found here:
https://gerrit.libreoffice.org/#/c/25351/
https://gerrit.libreoffice.org/#/c/25410/
https://gerrit.libreoffice.org/#/c/25558/

If you have any remarks and/or suggestions, please share.

Regards,
Jakub Trzebiatowski, irc: ubap

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: sw/inc sw/qa sw/source

2016-05-26 Thread Jakub Trzebiatowski
 sw/inc/tblafmt.hxx  |7 +
 sw/inc/unostyle.hxx |   29 
 sw/qa/python/check_styles.py|   38 ++
 sw/source/core/unocore/unostyle.cxx |  129 ++--
 sw/source/uibase/app/docstyle.cxx   |3 
 5 files changed, 186 insertions(+), 20 deletions(-)

New commits:
commit d4188f643db050c962a937547d19a9a08bd2235d
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Tue May 24 16:44:19 2016 +0200

Sw UNO API TableStyles getByName

Implementing TableStyle family getByName, hasByName, getByIndex
Implementing SwXTextTableStyle
Implementing basic tests

Change-Id: I256189db8631a713c4aae6b449409bbfaa776f24
Reviewed-on: https://gerrit.libreoffice.org/25410
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index f98067a..73c1f5a 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -230,6 +230,8 @@ class SW_DLLPUBLIC SwTableAutoFormat
 friend void FinitCore();   // To destroy default pointer.
 static SwBoxAutoFormat* pDfltBoxAutoFormat;
 
+css::uno::WeakReference m_wXObject;
+
 OUString m_aName;
 sal_uInt16 nStrResId;
 
@@ -292,6 +294,11 @@ public:
 
 bool Load( SvStream& rStream, const SwAfVersions& );
 bool Save( SvStream& rStream, sal_uInt16 fileVersion ) const;
+
+css::uno::WeakReference const& GetXObject() const
+{ return m_wXObject; }
+void SetXObject(css::uno::Reference const& xObject)
+{ m_wXObject = xObject; }
 };
 
 class SW_DLLPUBLIC SwTableAutoFormatTable
diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx
index 72b6b04..9a56b5c 100644
--- a/sw/inc/unostyle.hxx
+++ b/sw/inc/unostyle.hxx
@@ -246,6 +246,35 @@ protected:
 virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) 
override;
 
 };
+
+class SwTableAutoFormat;
+
+/// A text table style is a uno api wrapper for a SwTableAutoFormat
+class SwXTextTableStyle : public cppu::WeakImplHelper<css::style::XStyle, 
css::lang::XServiceInfo>
+{
+OUString m_sTableAutoFormatName;
+SwDocShell* m_pDocShell;
+
+SwTableAutoFormat* GetTableAutoFormat();
+public:
+SwXTextTableStyle(SwDocShell* pDocShell, const OUString& 
rTableAutoFormatName);
+//XStyle
+virtual sal_Bool SAL_CALL isUserDefined() throw 
(css::uno::RuntimeException, std::exception) override;
+virtual sal_Bool SAL_CALL isInUse() throw (css::uno::RuntimeException, 
std::exception) override;
+virtual OUString SAL_CALL getParentStyle() throw 
(css::uno::RuntimeException, std::exception) override;
+virtual void SAL_CALL setParentStyle(const OUString& aParentStyle ) throw 
(css::container::NoSuchElementException, css::uno::RuntimeException, 
std::exception) override;
+
+//XNamed
+virtual OUString SAL_CALL getName() throw(css::uno::RuntimeException, 
std::exception) override;
+virtual void SAL_CALL setName(const OUString& rName) 
throw(css::uno::RuntimeException, std::exception) override;
+
+//XServiceInfo
+virtual OUString SAL_CALL getImplementationName() 
throw(css::uno::RuntimeException, std::exception) override;
+virtual sal_Bool SAL_CALL supportsService(const OUString& rServiceName) 
throw(css::uno::RuntimeException, std::exception) override;
+virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() 
throw(css::uno::RuntimeException, std::exception) override;
+
+static css::uno::Reference 
CreateXTextTableStyle(SwDocShell* pDocShell, const OUString& 
rTableAutoFormatName);
+};
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/python/check_styles.py b/sw/qa/python/check_styles.py
index 4f9cefb..79972ef 100644
--- a/sw/qa/python/check_styles.py
+++ b/sw/qa/python/check_styles.py
@@ -48,7 +48,7 @@ class CheckStyle(unittest.TestCase):
 xStyleFamilies.getByName("foobarbaz")
 xDoc.dispose()
 
-def __test_StyleFamily(self, xFamily, vExpectedNames):
+def __test_StyleFamily(self, xFamily, vExpectedNames, sElementImplName):
 self.assertEqual(xFamily.ImplementationName, "XStyleFamily")
 self.assertEqual(len(xFamily.SupportedServiceNames), 1)
 
@@ -67,7 +67,7 @@ class CheckStyle(unittest.TestCase):
 
 for sStylename in xFamily.ElementNames:
 self.assertTrue(xFamily.hasByName(sStylename))
-self.assertEqual(xFamily[sStylename].ImplementationName, 
"SwXStyle")
+self.assertEqual(xFamily[sStylename].ImplementationName, 
sElementImplName)
 self.assertFalse(xFamily[sStylename].isUserDefined())
 
 vExpectedNames.sort()
@@ -75,12 +75,12 @@ class CheckStyle(unittest.TestCase):
 vNames.sort()
 self.assertListEqual(vNames, vExpectedNames)
 
-def __test_StyleFamilyIndex(self, xFamily, vExp

[Libreoffice-commits] core.git: include/rsc svl/source sw/inc sw/qa sw/source

2016-05-24 Thread Jakub Trzebiatowski
 include/rsc/rscsfx.hxx   |1 
 svl/source/items/IndexedStyleSheets.cxx  |6 ++--
 sw/inc/SwGetPoolIdFromName.hxx   |1 
 sw/inc/SwStyleNameMapper.hxx |   10 +--
 sw/inc/doc.hxx   |1 
 sw/inc/poolfmt.hrc   |4 ++
 sw/inc/poolfmt.hxx   |9 ++
 sw/inc/rcid.hrc  |5 +++
 sw/inc/unocore.hrc   |3 +-
 sw/inc/unomap.hxx|3 +-
 sw/qa/python/check_styles.py |4 +-
 sw/source/core/doc/SwStyleNameMapper.cxx |   43 +--
 sw/source/core/unocore/unocore.src   |5 +++
 sw/source/core/unocore/unomap.cxx|9 ++
 sw/source/core/unocore/unomap1.cxx   |6 
 sw/source/core/unocore/unostyle.cxx  |   16 ++-
 sw/source/ui/utlui/poolfmt.src   |7 +
 sw/source/uibase/app/docstyle.cxx|   12 
 18 files changed, 134 insertions(+), 11 deletions(-)

New commits:
commit 8b8159784821b7ddf031aec925353c274a10875e
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Mon May 23 09:18:52 2016 +0200

Implement basic TableStyle Family

Change-Id: I3da13d26ced05e1948d483d432d6268b10c208b5
Implementing: getCount, getElementNames
Reviewed-on: https://gerrit.libreoffice.org/25351
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/include/rsc/rscsfx.hxx b/include/rsc/rscsfx.hxx
index b4dd3c7..cc3ab9c 100644
--- a/include/rsc/rscsfx.hxx
+++ b/include/rsc/rscsfx.hxx
@@ -37,6 +37,7 @@ enum class SfxStyleFamily {
 Frame   = 0x04,
 Page= 0x08,
 Pseudo  = 0x10,
+Table   = 0x20,
 All = 0x7fff
 };
 
diff --git a/svl/source/items/IndexedStyleSheets.cxx 
b/svl/source/items/IndexedStyleSheets.cxx
index 1b1b54e..260ae10 100644
--- a/svl/source/items/IndexedStyleSheets.cxx
+++ b/svl/source/items/IndexedStyleSheets.cxx
@@ -19,7 +19,7 @@ using rtl::OUString;
 
 
 namespace {
-const size_t NUMBER_OF_FAMILIES = 6;
+const size_t NUMBER_OF_FAMILIES = 7;
 size_t family_to_index(SfxStyleFamily family)
 {
 switch (family) {
@@ -33,8 +33,10 @@ size_t family_to_index(SfxStyleFamily family)
 return 3;
 case SfxStyleFamily::Pseudo:
 return 4;
-case SfxStyleFamily::All:
+case SfxStyleFamily::Table:
 return 5;
+case SfxStyleFamily::All:
+return 6;
 default: break;
 }
 assert(false); // only for compiler warning. all cases are handled in the 
switch
diff --git a/sw/inc/SwGetPoolIdFromName.hxx b/sw/inc/SwGetPoolIdFromName.hxx
index 9d93e26..55f3ca6 100644
--- a/sw/inc/SwGetPoolIdFromName.hxx
+++ b/sw/inc/SwGetPoolIdFromName.hxx
@@ -31,6 +31,7 @@ namespace nsSwGetPoolIdFromName
 const SwGetPoolIdFromName GET_POOLID_FRMFMT   = 0x04;
 const SwGetPoolIdFromName GET_POOLID_PAGEDESC = 0x08;
 const SwGetPoolIdFromName GET_POOLID_NUMRULE  = 0x10;
+const SwGetPoolIdFromName GET_POOLID_TABSTYLE = 0x20;
 }
 
 #endif
diff --git a/sw/inc/SwStyleNameMapper.hxx b/sw/inc/SwStyleNameMapper.hxx
index 89011ca..035e0c6 100644
--- a/sw/inc/SwStyleNameMapper.hxx
+++ b/sw/inc/SwStyleNameMapper.hxx
@@ -93,6 +93,7 @@ protected:
 *m_pHTMLChrFormatUINameArray,
 *m_pPageDescUINameArray,
 *m_pNumRuleUINameArray,
+*m_pTableStyleUINameArray,
 // Programmatic Name tables
 *m_pTextProgNameArray,
 *m_pListsProgNameArray,
@@ -104,19 +105,22 @@ protected:
 *m_pChrFormatProgNameArray,
 *m_pHTMLChrFormatProgNameArray,
 *m_pPageDescProgNameArray,
-*m_pNumRuleProgNameArray;
+*m_pNumRuleProgNameArray,
+*m_pTableStyleProgNameArray;
 
 static NameToIdHash *m_pParaUIMap,
 *m_pCharUIMap,
 *m_pPageUIMap,
 *m_pFrameUIMap,
 *m_pNumRuleUIMap,
+*m_pTableStyleUIMap,
 
 *m_pParaProgMap,
 *m_pCharProgMap,
 *m_pPageProgMap,
 *m_pFrameProgMap,
-*m_pNumRuleProgMap;
+*m_pNumRuleProgMap,
+*m_pTableStyleProgMap;
 
 static void fillNameFromId(sal_uInt16 nId, OUString , bool 
bProgName);
 static const OUString& getNameFromId(sal_uInt16 nId, const OUString ,
@@ -176,6 +180,7 @@ public:
 static const ::std::vector& GetHTMLChrFormatUINameArray();
 static const ::std::vector& GetPageDescUINameArray();
 

[Libreoffice-commits] core.git: desktop/qa

2016-05-18 Thread Jakub Trzebiatowski
 desktop/qa/desktop_lib/test_desktop_lib.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 7eb86f35537aa9fc1b861c8880e474b369870937
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Tue May 17 14:21:01 2016 +0200

Inlucde TableStyles in GetStyles test

Change-Id: I8df7cb9baf2359c632bb2a23ed5f3e6eb0f6577c
Reviewed-on: https://gerrit.libreoffice.org/25058
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 905325d..efa055a 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -260,6 +260,7 @@ void DesktopLOKTest::testGetStyles()
 rPair.first != "NumberingStyles" &&
 rPair.first != "CellStyles" &&
 rPair.first != "ShapeStyles" &&
+rPair.first != "TableStyles" &&
 rPair.first != "Commands")
 {
 CPPUNIT_FAIL("Unknown style family: " + rPair.first);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-04-04 Thread Jakub Trzebiatowski
 cui/source/customize/selector.cxx |  178 ++
 cui/source/dialogs/cuires.src |5 +
 cui/source/inc/cuires.hrc |1 
 cui/source/inc/selector.hxx   |3 
 4 files changed, 113 insertions(+), 74 deletions(-)

New commits:
commit edc63d3abb5c4dae223f745f6384e7d0e5fc717e
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Thu Mar 31 22:54:23 2016 +0200

tdf#45129 Customize Toolbars: Add category "All categories"

- added string "All commands" to resources
- moved code responsible for flling functions list to a function
- defined SVX_CFGGROUP_ALLFUNCTIONS
- added "All categories" category

Change-Id: I4f03c8bc0af44dba2ef89ddd64b3fac67c5f2695
Reviewed-on: https://gerrit.libreoffice.org/23572
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>

diff --git a/cui/source/customize/selector.cxx 
b/cui/source/customize/selector.cxx
index 21d58e0..01d4f42 100644
--- a/cui/source/customize/selector.cxx
+++ b/cui/source/customize/selector.cxx
@@ -468,6 +468,14 @@ void SvxConfigGroupListBox::Init(bool bShowSlots, const 
Reference< frame::XFrame
 
 if ( xModuleCategories.is() )
 {
+SvTreeListEntry *pEntry = InsertEntry( 
CUI_RES(RID_SVXSTR_ALLFUNCTIONS) );
+
+SvxGroupInfo_Impl *pInfo =
+new SvxGroupInfo_Impl( SVX_CFGGROUP_ALLFUNCTIONS, 0 );
+aArr.push_back( std::unique_ptr(pInfo) );
+
+pEntry->SetUserData( pInfo );
+
 Sequence< sal_Int16 > gids =
 xDIP->getSupportedCommandGroups();
 
@@ -500,10 +508,9 @@ void SvxConfigGroupListBox::Init(bool bShowSlots, const 
Reference< frame::XFrame
 {
 }
 
-SvTreeListEntry *pEntry = InsertEntry( group );
+pEntry = InsertEntry( group );
 
-SvxGroupInfo_Impl *pInfo =
-new SvxGroupInfo_Impl( SVX_CFGGROUP_FUNCTION, gids[i] );
+pInfo = new SvxGroupInfo_Impl( SVX_CFGGROUP_FUNCTION, gids[i] 
);
 aArr.push_back( std::unique_ptr(pInfo) );
 
 pEntry->SetUserData( pInfo );
@@ -636,6 +643,72 @@ SvxConfigGroupListBox::getDocumentModel(
 return xModel;
 }
 
+void SvxConfigGroupListBox::fillFunctionList(const Sequence< 
frame::DispatchInformation >& commands)
+{
+for ( sal_Int32 i = 0; i < commands.getLength(); ++i )
+{
+if ( commands[i].Command.isEmpty() )
+{
+continue;
+}
+
+Image aImage;
+
+OUString aCmdURL( commands[i].Command );
+
+if ( m_pImageProvider )
+{
+aImage = m_pImageProvider->GetImage( aCmdURL );
+}
+
+OUString aLabel;
+try
+{
+Any a = m_xModuleCommands->getByName( aCmdURL );
+Sequence< beans::PropertyValue > aPropSeq;
+
+if ( a >>= aPropSeq )
+{
+for ( sal_Int32 k = 0; k < aPropSeq.getLength(); ++k )
+{
+if ( aPropSeq[k].Name == "Name" )
+{
+aPropSeq[k].Value >>= aLabel;
+break;
+}
+}
+}
+}
+catch ( container::NoSuchElementException& )
+{
+}
+
+if ( aLabel.isEmpty() )
+{
+aLabel = commands[i].Command;
+}
+
+SvTreeListEntry* pFuncEntry = nullptr;
+if ( !!aImage )
+{
+pFuncEntry = pFunctionListBox->InsertEntry(
+aLabel, aImage, aImage );
+}
+else
+{
+pFuncEntry = pFunctionListBox->InsertEntry(
+aLabel );
+}
+
+SvxGroupInfo_Impl *_pGroupInfo = new SvxGroupInfo_Impl(
+SVX_CFGFUNCTION_SLOT, 123, aCmdURL, OUString() );
+
+pFunctionListBox->aArr.push_back( 
std::unique_ptr(_pGroupInfo) );
+
+pFuncEntry->SetUserData( _pGroupInfo );
+}
+}
+
 void SvxConfigGroupListBox::GroupSelected()
 {
 SvTreeListEntry *pEntry = FirstSelected();
@@ -643,7 +716,8 @@ void SvxConfigGroupListBox::GroupSelected()
 pFunctionListBox->SetUpdateMode(false);
 pFunctionListBox->ClearAll();
 if ( pInfo->nKind != SVX_CFGGROUP_FUNCTION &&
- pInfo->nKind != SVX_CFGGROUP_SCRIPTCONTAINER )
+ pInfo->nKind != SVX_CFGGROUP_SCRIPTCONTAINER &&
+ pInfo->nKind != SVX_CFGGROUP_ALLFUNCTIONS )
 {
 pFunctionListBox->SetUpdateMode(true);
 return;
@@ -651,90 +725,46 @@ void SvxConfigGroupListBox::GroupSelected()
 
 switch ( pInfo->nKind )
 {
-case SVX_CFGGROUP_FUNCTION :
+case SVX_CFGGROUP_FUNCTION:
 {
-

[Libreoffice-commits] core.git: sw/source

2016-04-04 Thread Jakub Trzebiatowski
 sw/source/ui/misc/bookmark.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3dd9a3027d39ee9932b26abcde12363c881bff6a
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Mon Mar 28 13:25:26 2016 +0200

tdf#90855 replace Dialog::Close with Dialog::EndDialog

Change-Id: I1b23ba8b93e8451b8f5b9db56a212f3c497b80de
Reviewed-on: https://gerrit.libreoffice.org/23565
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
Tested-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>

diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index ba9fc87..59b56cc 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -214,7 +214,7 @@ IMPL_LINK_NOARG_TYPED(SwInsertBookmarkDlg, InsertHdl, 
Button*, void)
 if (!rReq.IsDone())
 rReq.Ignore();
 
-Close();
+EndDialog(RET_OK);
 }
 
 void SwInsertBookmarkDlg::GotoSelectedBookmark()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/inc sw/source

2016-03-31 Thread Jakub Trzebiatowski
 sw/inc/globals.hrc |3 +++
 sw/source/ui/app/app.src   |   10 ++
 sw/source/ui/misc/bookmark.cxx |8 
 3 files changed, 17 insertions(+), 4 deletions(-)

New commits:
commit 8d123bf1491bcc7415f4dde3ddd397a11146bb38
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Sat Mar 26 12:54:18 2016 +0100

tdf#90855 add table header entries to resources

removed hardcoded table header entries

Change-Id: Ib0268421d1b0035e7764555054377d08ee47a29d
Reviewed-on: https://gerrit.libreoffice.org/23520
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
Tested-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>

diff --git a/sw/inc/globals.hrc b/sw/inc/globals.hrc
index a907906..4471435 100644
--- a/sw/inc/globals.hrc
+++ b/sw/inc/globals.hrc
@@ -95,6 +95,9 @@
 
 // free
 
+#define STR_BOOKMARK_NAME   (RC_GLOBALS_BEGIN + 36)
+#define STR_BOOKMARK_TEXT   (RC_GLOBALS_BEGIN + 37)
+
 #define STR_LOAD_HTML_DOC   (RC_GLOBALS_BEGIN + 38)
 
 #define STR_JAVA_EDIT   (RC_GLOBALS_BEGIN + 39)
diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src
index 74c3ce1..4f16b1d 100644
--- a/sw/source/ui/app/app.src
+++ b/sw/source/ui/app/app.src
@@ -223,6 +223,16 @@ String STR_REMOVE_WARNING
 Text [ en-US ] = "The following characters are not valid and have been 
removed: ";
 };
 
+String STR_BOOKMARK_NAME
+{
+Text [ en-US ] = "Name";
+};
+
+String STR_BOOKMARK_TEXT
+{
+Text [ en-US ] = "Text";
+};
+
 String SW_STR_NONE
 {
 Text [ en-US ] = "[None]" ;
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index a65ddaf..ba9fc87 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -337,13 +337,13 @@ void SwInsertBookmarkDlg::dispose()
 BookmarkTable::BookmarkTable(SvSimpleTableContainer& rParent) :
 SvSimpleTable(rParent, 0)
 {
-static long nTabs[] = {3, 0, 30, 150};
+static long nTabs[] = {3, 0, 40, 150};
 
 SetTabs(nTabs, MAP_PIXEL);
 SetSelectionMode(MULTIPLE_SELECTION);
-InsertHeaderEntry("Page");
-InsertHeaderEntry("Name");
-InsertHeaderEntry("Text");
+InsertHeaderEntry(OUString(SW_RES(STR_PAGE)));
+InsertHeaderEntry(OUString(SW_RES(STR_BOOKMARK_NAME)));
+InsertHeaderEntry(OUString(SW_RES(STR_BOOKMARK_TEXT)));
 
 rParent.SetTable(this);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-03-31 Thread Jakub Trzebiatowski
 cui/source/dialogs/hlinettp.cxx  |   33 ---
 cui/source/inc/hlinettp.hxx  |2 -
 cui/uiconfig/ui/hyperlinkinternetpage.ui |   14 -
 3 files changed, 49 deletions(-)

New commits:
commit bb2fdee74fddd42914d0fa7d7b3820d0bd33237a
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Tue Mar 29 15:46:18 2016 +0200

tdf#98885 - hyperlink dialog - remove useless button

removed browse button and its code

Change-Id: I0b2a611760d346d5f0fff6d129676410aea30c41
Reviewed-on: https://gerrit.libreoffice.org/23599
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
Tested-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>

diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx
index 700a58f..7c92332 100644
--- a/cui/source/dialogs/hlinettp.cxx
+++ b/cui/source/dialogs/hlinettp.cxx
@@ -45,19 +45,12 @@ SvxHyperlinkInternetTp::SvxHyperlinkInternetTp ( 
vcl::Window *pParent,
 get(m_pRbtLinktypFTP, "linktyp_ftp");
 get(m_pCbbTarget, "target");
 m_pCbbTarget->SetSmartProtocol(INetProtocol::Http);
-get(m_pBtBrowse, "browse");
-BitmapEx aBitmap = Image(CUI_RES (RID_SVXBMP_BROWSE)).GetBitmapEx();
-
aBitmap.Scale(GetDPIScaleFactor(),GetDPIScaleFactor(),BmpScaleFlag::BestQuality 
);
-m_pBtBrowse->SetModeImage(Image(aBitmap));
 get(m_pFtLogin, "login_label");
 get(m_pEdLogin, "login");
 get(m_pFtPassword, "password_label");
 get(m_pEdPassword, "password");
 get(m_pCbAnonymous, "anonymous");
 
-// Disable display of bitmap names.
-m_pBtBrowse->EnableTextDisplay (false);
-
 InitStdControls();
 
 m_pCbbTarget->Show();
@@ -68,7 +61,6 @@ SvxHyperlinkInternetTp::SvxHyperlinkInternetTp ( vcl::Window 
*pParent,
 
 // set defaults
 m_pRbtLinktypInternet->Check ();
-m_pBtBrowse->Enable();
 
 
 // set handlers
@@ -76,7 +68,6 @@ SvxHyperlinkInternetTp::SvxHyperlinkInternetTp ( vcl::Window 
*pParent,
 m_pRbtLinktypInternet->SetClickHdl( aLink );
 m_pRbtLinktypFTP->SetClickHdl ( aLink );
 m_pCbAnonymous->SetClickHdl   ( LINK ( this, SvxHyperlinkInternetTp, 
ClickAnonymousHdl_Impl ) );
-m_pBtBrowse->SetClickHdl  ( LINK ( this, SvxHyperlinkInternetTp, 
ClickBrowseHdl_Impl ) );
 m_pEdLogin->SetModifyHdl  ( LINK ( this, SvxHyperlinkInternetTp, 
ModifiedLoginHdl_Impl ) );
 m_pCbbTarget->SetLoseFocusHdl ( LINK ( this, SvxHyperlinkInternetTp, 
LostFocusTargetHdl_Impl ) );
 m_pCbbTarget->SetModifyHdl( LINK ( this, SvxHyperlinkInternetTp, 
ModifiedTargetHdl_Impl ) );
@@ -93,7 +84,6 @@ void SvxHyperlinkInternetTp::dispose()
 m_pRbtLinktypInternet.clear();
 m_pRbtLinktypFTP.clear();
 m_pCbbTarget.clear();
-m_pBtBrowse.clear();
 m_pFtLogin.clear();
 m_pEdLogin.clear();
 m_pFtPassword.clear();
@@ -386,29 +376,6 @@ IMPL_LINK_NOARG_TYPED(SvxHyperlinkInternetTp, 
LostFocusTargetHdl_Impl, Control&,
 RefreshMarkWindow();
 }
 
-/*
-|*
-|* Click on imagebutton : Browse
-|*
-|/
-
-IMPL_LINK_NOARG_TYPED(SvxHyperlinkInternetTp, ClickBrowseHdl_Impl, Button*, 
void)
-{
-
-// Open URL if available
-
-SfxStringItem aName( SID_FILE_NAME, OUString("http://;) );
-SfxStringItem aRefererItem( SID_REFERER, OUString("private:user") );
-SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, true );
-SfxBoolItem aSilent( SID_SILENT, true );
-SfxBoolItem aReadOnly( SID_DOC_READONLY, true );
-
-SfxBoolItem aBrowse( SID_BROWSE, true );
-
-const SfxPoolItem *ppItems[] = { , , , , 
, , nullptr };
-static_cast<SvxHpLinkDlg*>(mpDialog.get())->GetBindings()->Execute( 
SID_OPENDOC, ppItems, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
-}
-
 void SvxHyperlinkInternetTp::RefreshMarkWindow()
 {
 if ( m_pRbtLinktypInternet->IsChecked() && IsMarkWndVisible() )
diff --git a/cui/source/inc/hlinettp.hxx b/cui/source/inc/hlinettp.hxx
index f70b8f7..05e2467 100644
--- a/cui/source/inc/hlinettp.hxx
+++ b/cui/source/inc/hlinettp.hxx
@@ -35,7 +35,6 @@ private:
 VclPtrm_pRbtLinktypInternet;
 VclPtr m_pRbtLinktypFTP;
 VclPtr  m_pCbbTarget;
-VclPtr  m_pBtBrowse;
 VclPtr   m_pFtLogin;
 VclPtrm_pEdLogin;
 VclPtr   m_pFtPassword;
@@ -49,7 +48,6 @@ private:
 
 DECL_LINK_TYPED( Click_SmartProtocol_Impl  , Button*, void ); ///< 
Radiobutton clicked: Type HTTP or FTP
 DECL_LINK_TYPED( ClickAnonymousHdl_Impl, Button*, void ); ///< 
Checkbox : Anonymous User
-DECL_LINK_TYPED( ClickBrowseHdl_Impl   , Button*, void ); ///< Button 
: Browse
 DECL_LINK_TYPED

[Libreoffice-commits] core.git: sw/source sw/uiconfig

2016-03-25 Thread Jakub Trzebiatowski
 sw/source/ui/misc/bookmark.cxx   |  457 ++-
 sw/source/uibase/inc/bookmark.hxx|   57 ++-
 sw/uiconfig/swriter/ui/insertbookmark.ui |  188 +---
 3 files changed, 511 insertions(+), 191 deletions(-)

New commits:
commit 08da15cabdcef60191f4ed98ed694eba3e35b5e1
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Fri Mar 11 20:58:34 2016 +0100

tdf#90855 Improve the 'Insert Bookmark' dialog

implemented:
- display page number
- displaying bookmark text
- goto (button and table doubleclick)
- help
- rename
- selecting multiple bookmarks in TableView or in EditField by ";"
- sorting by any column

Change-Id: I7523dc066380bc360bd484c88a6f4ba45e867320
Reviewed-on: https://gerrit.libreoffice.org/23156
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index c12da8d..a65ddaf 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -22,220 +22,419 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
+#include "swabstdlg.hxx"
+#include "swuiexp.hxx"
 #include "view.hxx"
 #include "basesh.hxx"
 #include "wrtsh.hxx"
 #include "cmdid.h"
 #include "bookmark.hxx"
-#include "IMark.hxx"
+#include "docsh.hxx"
 #include "globals.hrc"
 
-const OUString BookmarkCombo::aForbiddenChars("/\\@*?\";,#");
+using namespace ::com::sun::star;
 
-IMPL_LINK_TYPED( SwInsertBookmarkDlg, ModifyHdl, Edit&, rEdit, void )
+const OUString BookmarkTable::aForbiddenChars("/\\@*?\",#");
+const char BookmarkTable::cSeparator(';');
+const OUString BookmarkTable::sDefaultBookmarkName("Bookmark");
+
+// callback to modify EditBox
+IMPL_LINK_NOARG_TYPED(SwInsertBookmarkDlg, ModifyHdl, Edit&, void)
 {
-BookmarkCombo& rBox = static_cast<BookmarkCombo&>(rEdit);
-bool bSelEntries = rBox.GetSelectEntryCount() != 0;
+ValidateBookmarks();
+m_pBookmarksBox->SelectAll(false);
 // if a string has been pasted from the clipboard then
 // there may be illegal characters in the box
-if(!bSelEntries)
+// sanitization
+OUString sTmp = m_pEditBox->GetText();
+OUString sMsg;
+const sal_Int32 nLen = sTmp.getLength();
+for (sal_Int32 i = 0; i < BookmarkTable::aForbiddenChars.getLength(); i++)
 {
-OUString sTmp = rBox.GetText();
-const sal_Int32 nLen = sTmp.getLength();
-OUString sMsg;
-for(sal_Int32 i = 0; i < BookmarkCombo::aForbiddenChars.getLength(); 
i++)
-{
-const sal_Int32 nTmpLen = sTmp.getLength();
-sTmp = comphelper::string::remove(sTmp, 
BookmarkCombo::aForbiddenChars[i]);
-if(sTmp.getLength() != nTmpLen)
-sMsg += OUString(BookmarkCombo::aForbiddenChars[i]);
-}
-if(sTmp.getLength() != nLen)
+const sal_Int32 nTmpLen = sTmp.getLength();
+sTmp = comphelper::string::remove(sTmp, 
BookmarkTable::aForbiddenChars[i]);
+if (sTmp.getLength() != nTmpLen)
+   sMsg += OUString(BookmarkTable::aForbiddenChars[i]);
+}
+if (sTmp.getLength() != nLen)
+{
+m_pEditBox->SetText(sTmp);
+ScopedVclPtr::Create(this, sRemoveWarning + sMsg)->Execute();
+}
+
+sal_Int32 nSelectedEntries = 0;
+sal_Int32 nEntries = 0;
+sal_Int32 nTokenIndex = 0;
+while (!sTmp.isEmpty() && nTokenIndex >= 0)
+{
+OUString aToken = sTmp.getToken(0, BookmarkTable::cSeparator, 
nTokenIndex);
+if (m_pBookmarksBox->GetBookmarkByName(aToken))
 {
-rBox.SetText(sTmp);
-ScopedVclPtr::Create(this, 
sRemoveWarning+sMsg)->Execute();
+m_pBookmarksBox->SelectByName(aToken);
+nSelectedEntries++;
 }
-
+nEntries++;
 }
 
-m_pOkBtn->Enable(!bSelEntries);// new text mark
-m_pDeleteBtn->Enable(bSelEntries); // deletable?
+// allow to add new bookmark only if one name provided and its not taken
+m_pInsertBtn->Enable(nEntries == 1 && nSelectedEntries == 0);
+
+// allow to delete only if all bookmarks are recognized
+m_pDeleteBtn->Enable(nEntries > 0 && nSelectedEntries == nEntries);
+m_pGotoBtn->Enable(nEntries == 1 && nSelectedEntries == 1);
+m_pRenameBtn->Enable(nEntries == 1 && nSelectedEntries == 1);
 }
 
 // callback to delete a text mark
 IMPL_LINK_NOARG_TYPED(SwInsertBookmarkDlg, DeleteHdl, Button*, void)
 {
-// remove text marks from the ComboBox
+if (!ValidateBookmarks())
+return;
+if (m_pBookmarksBox->GetSelectionCount() == 0)
+return;
 
-for (sal_Int32 i = m_pBookmarkBox-

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

2016-03-19 Thread Jakub Trzebiatowski
 sc/source/core/opencl/opbase.cxx |2 +-
 sc/source/core/opencl/opbase.hxx |4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

New commits:
commit b869ee1950c3035a7f24de186e5112be6f71371a
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Mon Mar 7 21:54:28 2016 +0100

tdf#96099 fix trival typedef, sc/source/core/, std::vector

Change-Id: I45c2e397374732b6ad44803863fe271bffbe4ddb
Reviewed-on: https://gerrit.libreoffice.org/23013
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sc/source/core/opencl/opbase.cxx b/sc/source/core/opencl/opbase.cxx
index 6d0b37a2..479254b 100644
--- a/sc/source/core/opencl/opbase.cxx
+++ b/sc/source/core/opencl/opbase.cxx
@@ -186,7 +186,7 @@ bool VectorRef::NeedParallelReduction() const
 void Normal::GenSlidingWindowFunction(
 std::stringstream& ss, const std::string& sSymName, SubArguments& 
vSubArguments )
 {
-ArgVector argVector;
+std::vector argVector;
 ss << "\ndouble " << sSymName;
 ss << "_" << BinFuncName() << "(";
 for (size_t i = 0; i < vSubArguments.size(); i++)
diff --git a/sc/source/core/opencl/opbase.hxx b/sc/source/core/opencl/opbase.hxx
index ec1afaf..2896b81 100644
--- a/sc/source/core/opencl/opbase.hxx
+++ b/sc/source/core/opencl/opbase.hxx
@@ -171,12 +171,10 @@ protected:
 class OpBase
 {
 public:
-typedef std::vector ArgVector;
-typedef std::vector::iterator ArgVectorIter;
 virtual std::string GetBottom() { return "";};
 virtual std::string Gen2( const std::string&/*lhs*/,
 const std::string&/*rhs*/ ) const { return "";}
-static std::string Gen( ArgVector& /*argVector*/ ) { return "";};
+static std::string Gen( std::vector& /*argVector*/ ) { return 
"";};
 virtual std::string BinFuncName() const { return "";};
 virtual void BinInlineFun( std::set&,
 std::set& ) { }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: configmgr/source

2016-03-15 Thread Jakub Trzebiatowski
 configmgr/source/access.cxx|   11 +--
 configmgr/source/access.hxx|7 +++
 configmgr/source/additions.hxx |7 +++
 configmgr/source/childaccess.cxx   |   13 ++---
 configmgr/source/childaccess.hxx   |7 +++
 configmgr/source/components.cxx|   10 +-
 configmgr/source/components.hxx|5 ++---
 configmgr/source/data.cxx  |2 +-
 configmgr/source/data.hxx  |3 +--
 configmgr/source/modifications.cxx |   11 +--
 configmgr/source/modifications.hxx |6 ++
 configmgr/source/partial.cxx   |4 ++--
 configmgr/source/partial.hxx   |3 +--
 configmgr/source/path.hxx  |   36 
 configmgr/source/rootaccess.cxx|9 -
 configmgr/source/rootaccess.hxx|9 -
 configmgr/source/setnode.hxx   |4 ++--
 configmgr/source/xcuparser.cxx |1 -
 configmgr/source/xcuparser.hxx |3 +--
 19 files changed, 50 insertions(+), 101 deletions(-)

New commits:
commit 89e0663c55f7f1763536a345d6315c71ef26
Author: Jakub Trzebiatowski <ubap@gmail.com>
Date:   Mon Mar 7 19:48:23 2016 +0100

tdf#96099 fix trival typedefs, Path to std::vector

Change-Id: I23fca48becbfdfd92db02a11b739a668fc1cd8c4
Reviewed-on: https://gerrit.libreoffice.org/23007
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Noel Grandin <noelgran...@gmail.com>

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 97543bb..3506beb 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -96,7 +96,6 @@
 #include "modifications.hxx"
 #include "node.hxx"
 #include "nodemap.hxx"
-#include "path.hxx"
 #include "propertynode.hxx"
 #include "rootaccess.hxx"
 #include "setnode.hxx"
@@ -253,7 +252,7 @@ css::uno::Sequence< OUString > 
Access::getSupportedServiceNames()
 assert(thisIs(IS_ANY));
 osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
-std::vector< OUString > services;
+std::vector services;
 services.push_back("com.sun.star.configuration.ConfigurationAccess");
 if (getRootAccess()->isUpdate()) {
 services.push_back(
@@ -424,7 +423,7 @@ css::uno::Sequence< OUString > Access::getElementNames()
 osl::MutexGuard g(*lock_);
 checkLocalizedPropertyAccess();
 std::vector< rtl::Reference< ChildAccess > > children(getAllChildren());
-std::vector< OUString > names;
+std::vector names;
 for (std::vector< rtl::Reference< ChildAccess > >::iterator i(
  children.begin());
  i != children.end(); ++i)
@@ -1673,7 +1672,7 @@ void Access::commitChildChanges(
 }
 }
 if (childValid && i->second.directlyModified) {
-Path path(getAbsolutePath());
+std::vector path(getAbsolutePath());
 path.push_back(i->first);
 components_.addModification(path);
 globalModifications->add(path);
@@ -2100,8 +2099,8 @@ rtl::Reference< ChildAccess > 
Access::getSubChild(OUString const & path) {
 if (!getRootAccess().is()) {
 return rtl::Reference< ChildAccess >();
 }
-Path abs(getAbsolutePath());
-for (Path::iterator j(abs.begin()); j != abs.end(); ++j) {
+std::vector abs(getAbsolutePath());
+for (auto j(abs.begin()); j != abs.end(); ++j) {
 OUString name1;
 bool setElement1;
 OUString templateName1;
diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx
index 5a71adb..63cba69 100644
--- a/configmgr/source/access.hxx
+++ b/configmgr/source/access.hxx
@@ -62,7 +62,6 @@
 #include 
 
 #include "modifications.hxx"
-#include "path.hxx"
 #include "type.hxx"
 
 namespace com { namespace sun { namespace star {
@@ -120,8 +119,8 @@ public:
 void markChildAsModified(rtl::Reference< ChildAccess > const & child);
 void releaseChild(OUString const & name);
 
-virtual Path getAbsolutePath() = 0;
-virtual Path getRelativePath() = 0;
+virtual std::vector getAbsolutePath() = 0;
+virtual std::vector getRelativePath() = 0;
 
 virtual OUString getRelativePathRepresentation() = 0;
 virtual rtl::Reference< Node > getNode() = 0;
@@ -438,7 +437,7 @@ protected:
 const = 0;
 
 virtual void addSupportedServiceNames(
-std::vector< OUString > * services) = 0;
+std::vector * services) = 0;
 
 virtual void initDisposeBroadcaster(Broadcaster * broadcaster);
 virtual void clearListeners() throw ();
diff --git a/configmgr/source/additions.hxx b/configmgr/source/additions.hxx
index 399528d..1bc779e 100644
--- a/configmgr/source/additions.hxx
+++ b/configmgr/source/additions.hxx

Jakub Trzebiatowski License Statement

2016-03-07 Thread Jakub Trzebiatowski

Hello,
I'm Jakub Trzebiatowski.

All of my past & future contributions to LibreOffice may be licensed
under the MPLv2/LGPLv3+ dual license.

Regards

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice