core.git: Branch 'distro/collabora/co-23.05' - editeng/source

2024-03-15 Thread Gülşah Köse (via logerrit)
 editeng/source/outliner/outlvw.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit ff637041bd96cd1e4ea0ef78e54b1d89cb627dc3
Author: Gülşah Köse 
AuthorDate: Thu Mar 14 09:09:51 2024 +0300
Commit: Gülşah Köse 
CommitDate: Fri Mar 15 13:54:42 2024 +0100

tdf#160213 Don't let insert empty line with numbering, end numbering

We applied the writer's empty bullet line policy to impres. Now We don't let
insert empty bullet lines in impress too. Instead we end numbering and start
to write normal paragraph at the same line.

Signed-off-by: Gülşah Köse 
Change-Id: I28042d9db59b5622434da0826f8b760f01ad64f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164799
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
(cherry picked from commit f3f3ea4cc9c3bec761d095fbfefd6ba8724fcdef)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164829
Tested-by: Jenkins CollaboraOffice 

diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index fa17099f043f..356d8076481c 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -189,6 +189,13 @@ bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, 
vcl::Window const * pFra
 
 if( !aKeyCode.IsShift() )
 {
+// Don't let insert empty paragraph with numbering. 
Instead end numbering.
+if (pPara->GetDepth() > -1 &&
+pOwner->pEditEngine->GetTextLen( aSel.nEndPara ) 
== 0)
+{
+ToggleBullets();
+return true;
+}
 // ImpGetCursor again???
 if( !bSelection &&
 aSel.nEndPos == 
pOwner->pEditEngine->GetTextLen( aSel.nEndPara ) )


core.git: Branch 'distro/collabora/co-24.04' - editeng/source

2024-03-15 Thread Gülşah Köse (via logerrit)
 editeng/source/outliner/outlvw.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 0aeabaf654428c1d84187ed8a40b37033ed01dcb
Author: Gülşah Köse 
AuthorDate: Thu Mar 14 09:09:51 2024 +0300
Commit: Gülşah Köse 
CommitDate: Fri Mar 15 13:54:56 2024 +0100

tdf#160213 Don't let insert empty line with numbering, end numbering

We applied the writer's empty bullet line policy to impres. Now We don't let
insert empty bullet lines in impress too. Instead we end numbering and start
to write normal paragraph at the same line.

Signed-off-by: Gülşah Köse 
Change-Id: I28042d9db59b5622434da0826f8b760f01ad64f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164799
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
(cherry picked from commit f3f3ea4cc9c3bec761d095fbfefd6ba8724fcdef)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164828
Tested-by: Jenkins CollaboraOffice 

diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index 136ecd776c26..f3fd835ec1c9 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -189,6 +189,13 @@ bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, 
vcl::Window const * pFra
 
 if( !aKeyCode.IsShift() )
 {
+// Don't let insert empty paragraph with numbering. 
Instead end numbering.
+if (pPara->GetDepth() > -1 &&
+pOwner->pEditEngine->GetTextLen( aSel.nEndPara ) 
== 0)
+{
+ToggleBullets();
+return true;
+}
 // ImpGetCursor again???
 if( !bSelection &&
 aSel.nEndPos == 
pOwner->pEditEngine->GetTextLen( aSel.nEndPara ) )


core.git: editeng/source

2024-03-15 Thread Gülşah Köse (via logerrit)
 editeng/source/outliner/outlvw.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit f3f3ea4cc9c3bec761d095fbfefd6ba8724fcdef
Author: Gülşah Köse 
AuthorDate: Thu Mar 14 09:09:51 2024 +0300
Commit: Mike Kaganski 
CommitDate: Fri Mar 15 12:12:51 2024 +0100

tdf#160213 Don't let insert empty line with numbering, end numbering

We applied the writer's empty bullet line policy to impres. Now We don't let
insert empty bullet lines in impress too. Instead we end numbering and start
to write normal paragraph at the same line.

Signed-off-by: Gülşah Köse 
Change-Id: I28042d9db59b5622434da0826f8b760f01ad64f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164799
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index e3e28207d11e..cd01503731eb 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -189,6 +189,13 @@ bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, 
vcl::Window const * pFra
 
 if( !aKeyCode.IsShift() )
 {
+// Don't let insert empty paragraph with numbering. 
Instead end numbering.
+if (pPara->GetDepth() > -1 &&
+pOwner->pEditEngine->GetTextLen( aSel.nEndPara ) 
== 0)
+{
+ToggleBullets();
+return true;
+}
 // ImpGetCursor again???
 if( !bSelection &&
 aSel.nEndPos == 
pOwner->pEditEngine->GetTextLen( aSel.nEndPara ) )


core.git: Branch 'distro/collabora/co-24.04' - sc/source sw/source

2024-02-29 Thread Gülşah Köse (via logerrit)
 sc/source/ui/app/inputhdl.cxx  |9 -
 sw/source/uibase/docvw/edtwin2.cxx |1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 3e42811c2935a6501d8a0383431b2f2154baf709
Author: Gülşah Köse 
AuthorDate: Wed Feb 28 15:05:06 2024 +0300
Commit: Gülşah Köse 
CommitDate: Thu Feb 29 19:53:38 2024 +0100

Online: Make tooltip message specific to function usage tooltip

Using same callback caused a regression about showing tooltip while
reviewing a change in writer. So we need a type to understand which
tooltip comes.

Signed-off-by: Gülşah Köse 
Change-Id: Iae26ff48f9c5c711af071fd66b5314e7bc96ff8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164122
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index d3c838c24322..5c6f73d5a6d6 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -58,6 +58,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1292,7 +1293,13 @@ void ScInputHandler::ShowArgumentsTip( OUString& 
rSelText )
 
 const SfxViewShell* pViewShell = 
SfxViewShell::Current();
 if (comphelper::LibreOfficeKit::isActive() && 
pViewShell->isLOKDesktop())
-
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TOOLTIP, aNew.toUtf8());
+{
+tools::JsonWriter writer;
+writer.put("type", "formulausage");
+writer.put("text", aNew);
+OString sFunctionUsageTip = 
writer.finishAndGetAsOString();
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TOOLTIP, sFunctionUsageTip);
+}
 }
 }
 }
diff --git a/sw/source/uibase/docvw/edtwin2.cxx 
b/sw/source/uibase/docvw/edtwin2.cxx
index b6dcfdbeb70e..07bf72ff4b99 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -315,6 +315,7 @@ static OString getTooltipPayload(const OUString& tooltip, 
const SwRect& rect)
 {
 tools::JsonWriter writer;
 {
+writer.put("type", "generaltooltip");
 writer.put("text", tooltip);
 writer.put("rectangle", rect.SVRect().toString());
 }


core.git: Branch 'distro/collabora/co-23.05' - sc/source sw/source

2024-02-29 Thread Gülşah Köse (via logerrit)
 sc/source/ui/app/inputhdl.cxx  |9 -
 sw/source/uibase/docvw/edtwin2.cxx |1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit d6b18dc269625dede7c739770984cbe78c41d9a2
Author: Gülşah Köse 
AuthorDate: Wed Feb 28 15:05:06 2024 +0300
Commit: Gülşah Köse 
CommitDate: Thu Feb 29 19:53:25 2024 +0100

Online: Make tooltip message specific to function usage tooltip

Using same callback caused a regression about showing tooltip while
reviewing a change in writer. So we need a type to understand which
tooltip comes.

Signed-off-by: Gülşah Köse 
Change-Id: Iae26ff48f9c5c711af071fd66b5314e7bc96ff8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164093
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164150
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 47416cf3c361..48b0fa6b6296 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -58,6 +58,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1298,7 +1299,13 @@ void ScInputHandler::ShowArgumentsTip( OUString& 
rSelText )
 
 const SfxViewShell* pViewShell = 
SfxViewShell::Current();
 if (comphelper::LibreOfficeKit::isActive() && 
pViewShell->isLOKDesktop())
-
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TOOLTIP, 
aNew.toUtf8().getStr());
+{
+tools::JsonWriter writer;
+writer.put("type", "formulausage");
+writer.put("text", aNew);
+OString sFunctionUsageTip = 
writer.extractAsOString();
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TOOLTIP, 
sFunctionUsageTip.getStr());
+}
 }
 }
 }
diff --git a/sw/source/uibase/docvw/edtwin2.cxx 
b/sw/source/uibase/docvw/edtwin2.cxx
index ec3b76324e79..f985e0483911 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -114,6 +114,7 @@ static OString getTooltipPayload(const OUString& tooltip, 
const SwRect& rect)
 {
 tools::JsonWriter writer;
 {
+writer.put("type", "generaltooltip");
 writer.put("text", tooltip);
 writer.put("rectangle", rect.SVRect().toString());
 }


core.git: sc/source sw/source

2024-02-29 Thread Gülşah Köse (via logerrit)
 sc/source/ui/app/inputhdl.cxx  |9 -
 sw/source/uibase/docvw/edtwin2.cxx |1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit b1f84f5479a8ed06d07d4eef6b83578789fd67f0
Author: Gülşah Köse 
AuthorDate: Wed Feb 28 15:05:06 2024 +0300
Commit: Szymon Kłos 
CommitDate: Thu Feb 29 14:24:20 2024 +0100

Online: Make tooltip message specific to function usage tooltip

Using same callback caused a regression about showing tooltip while
reviewing a change in writer. So we need a type to understand which
tooltip comes.

Signed-off-by: Gülşah Köse 
Change-Id: Iae26ff48f9c5c711af071fd66b5314e7bc96ff8b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164093
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 6658bde6af7f..62bd2a3c66cf 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -58,6 +58,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1277,7 +1278,13 @@ void ScInputHandler::ShowArgumentsTip( OUString& 
rSelText )
 
 const SfxViewShell* pViewShell = 
SfxViewShell::Current();
 if (comphelper::LibreOfficeKit::isActive() && 
pViewShell->isLOKDesktop())
-
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TOOLTIP, aNew.toUtf8());
+{
+tools::JsonWriter writer;
+writer.put("type", "formulausage");
+writer.put("text", aNew);
+OString sFunctionUsageTip = 
writer.finishAndGetAsOString();
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TOOLTIP, sFunctionUsageTip);
+}
 }
 }
 }
diff --git a/sw/source/uibase/docvw/edtwin2.cxx 
b/sw/source/uibase/docvw/edtwin2.cxx
index b6dcfdbeb70e..07bf72ff4b99 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -315,6 +315,7 @@ static OString getTooltipPayload(const OUString& tooltip, 
const SwRect& rect)
 {
 tools::JsonWriter writer;
 {
+writer.put("type", "generaltooltip");
 writer.put("text", tooltip);
 writer.put("rectangle", rect.SVRect().toString());
 }


core.git: Branch 'distro/collabora/co-24.04' - sc/source

2024-02-27 Thread Gülşah Köse (via logerrit)
 sc/source/ui/app/inputhdl.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit d52dfa7ecbf9cb50a4007b44af9cd23ad08c5d8e
Author: Gülşah Köse 
AuthorDate: Tue Feb 27 13:07:18 2024 +0300
Commit: Gülşah Köse 
CommitDate: Tue Feb 27 21:49:17 2024 +0100

Online: Prevent hiding tooltips due to other users action.

Other user's actions like reloading reopening or refreshing
document causes hiding other user function tooltips.

Signed-off-by: Gülşah Köse 
Change-Id: I0aeb0aeb98182398e4740c71cfd65c4df2c51ba6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163978
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 62a7d7b9bf09..5d45d930b3eb 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -4446,7 +4446,9 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* 
pState,
 pDelayTimer->Start();
 }
 
-HideTip();
+// Don't hide function tooltip in LOK, a remote user might be using tip.
+if (bStopEditing)
+HideTip();
 HideTipBelow();
 bInOwnChange = false;
 }


core.git: Branch 'distro/collabora/co-23.05' - sc/source

2024-02-27 Thread Gülşah Köse (via logerrit)
 sc/source/ui/app/inputhdl.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 73d3ee33f80c8e46a7002ec538eef23a69842135
Author: Gülşah Köse 
AuthorDate: Tue Feb 27 13:07:18 2024 +0300
Commit: Gülşah Köse 
CommitDate: Tue Feb 27 21:35:22 2024 +0100

Online: Prevent hiding tooltips due to other users action.

Other user's actions like reloading reopening or refreshing
document causes hiding other user function tooltips.

Signed-off-by: Gülşah Köse 
Change-Id: I0aeb0aeb98182398e4740c71cfd65c4df2c51ba6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163979
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index aede676ebdde..c03d36aab311 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -4451,7 +4451,9 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* 
pState,
 pDelayTimer->Start();
 }
 
-HideTip();
+// Don't hide function tooltip in LOK, a remote user might be using tip.
+if (bStopEditing)
+HideTip();
 HideTipBelow();
 bInOwnChange = false;
 }


core.git: sc/source

2024-02-27 Thread Gülşah Köse (via logerrit)
 sc/source/ui/app/inputhdl.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit d208c1910b54f5dc711e490e68899ca13121e586
Author: Gülşah Köse 
AuthorDate: Tue Feb 27 13:07:18 2024 +0300
Commit: Gülşah Köse 
CommitDate: Tue Feb 27 17:13:34 2024 +0100

Online: Prevent hiding tooltips due to other users action.

Other user's actions like reloading reopening or refreshing
document causes hiding other user function tooltips.

Signed-off-by: Gülşah Köse 
Change-Id: I0aeb0aeb98182398e4740c71cfd65c4df2c51ba6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164027
Tested-by: Jenkins

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index e0d9be5bdc97..8ea3f33157a9 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -4445,7 +4445,9 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* 
pState,
 pDelayTimer->Start();
 }
 
-HideTip();
+// Don't hide function tooltip in LOK, a remote user might be using tip.
+if (bStopEditing)
+HideTip();
 HideTipBelow();
 bInOwnChange = false;
 }


core.git: sc/source

2024-02-23 Thread Gülşah Köse (via logerrit)
 sc/source/ui/app/inputhdl.cxx |   16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 7e406cf5df7d5110a2cbf85463efa042ef18640f
Author: Gülşah Köse 
AuthorDate: Mon Feb 19 16:00:25 2024 +0300
Commit: Gülşah Köse 
CommitDate: Fri Feb 23 11:29:26 2024 +0100

ONLINE: Add calc formula tooltip support.

Signed-off-by: Gülşah Köse 
Change-Id: I1f3c438f5152e2b372212d003c1ec4e74e4d3ff2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163651
Tested-by: Jenkins

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 745e69158d3b..e0d9be5bdc97 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1109,6 +1109,10 @@ void ScInputHandler::HideTip()
 pTipVisibleParent = nullptr;
 }
 aManualTip.clear();
+
+const SfxViewShell* pViewShell = SfxViewShell::Current();
+if (comphelper::LibreOfficeKit::isActive() && pViewShell)
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CALC_FUNCTION_LIST, 
"hidetip"_ostr);
 }
 void ScInputHandler::HideTipBelow()
 {
@@ -1134,11 +1138,6 @@ bool lcl_hasSingleToken(std::u16string_view s, 
sal_Unicode c)
 
 void ScInputHandler::ShowArgumentsTip( OUString& rSelText )
 {
-if (comphelper::LibreOfficeKit::isActive())
-{
-return;
-}
-
 if ( !pActiveViewSh )
 return;
 
@@ -1282,6 +1281,10 @@ void ScInputHandler::ShowArgumentsTip( OUString& 
rSelText )
 ShowTipBelow( aNew );
 bFound = true;
 }
+
+const SfxViewShell* pViewShell = 
SfxViewShell::Current();
+if (comphelper::LibreOfficeKit::isActive() && 
pViewShell->isLOKDesktop())
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TOOLTIP, aNew.toUtf8());
 }
 }
 }
@@ -1430,7 +1433,7 @@ void ScInputHandler::ShowFuncList( const ::std::vector< 
OUString > & rFuncStrVec
 const SfxViewShell* pViewShell = SfxViewShell::Current();
 if (comphelper::LibreOfficeKit::isActive())
 {
-if (rFuncStrVec.size() && pViewShell && pViewShell->isLOKMobilePhone())
+if (rFuncStrVec.size() && pViewShell)
 {
 auto aPos = pFormulaData->begin();
 sal_uInt32 nCurIndex = std::distance(aPos, miAutoPosFormula);
@@ -1483,7 +1486,6 @@ void ScInputHandler::ShowFuncList( const ::std::vector< 
OUString > & rFuncStrVec
 OString s = aPayload.makeStringAndClear();
 
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CALC_FUNCTION_LIST, s);
 }
-// not tunnel tooltips in the lok case
 return;
 }
 


core.git: Branch 'distro/collabora/co-23.05' - sc/source

2024-02-23 Thread Gülşah Köse (via logerrit)
 sc/source/ui/app/inputhdl.cxx |   18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

New commits:
commit c48151369f04c4f01dceb0ca31cf23287aa8d676
Author: Gülşah Köse 
AuthorDate: Mon Feb 19 16:00:25 2024 +0300
Commit: Gülşah Köse 
CommitDate: Fri Feb 23 11:29:03 2024 +0100

ONLINE: Add calc formula tooltip support.

Signed-off-by: Gülşah Köse 
Change-Id: I1f3c438f5152e2b372212d003c1ec4e74e4d3ff2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163594
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 1f5ae2869c6e..aede676ebdde 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1113,6 +1113,12 @@ void ScInputHandler::HideTip()
 pTipVisibleParent = nullptr;
 }
 aManualTip.clear();
+
+const SfxViewShell* pViewShell = SfxViewShell::Current();
+if (comphelper::LibreOfficeKit::isActive() && pViewShell) {
+OUString sHideMsg = "hidetip";
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CALC_FUNCTION_LIST, 
sHideMsg.toUtf8().getStr());
+}
 }
 void ScInputHandler::HideTipBelow()
 {
@@ -1138,11 +1144,6 @@ bool lcl_hasSingleToken(std::u16string_view s, 
sal_Unicode c)
 
 void ScInputHandler::ShowArgumentsTip( OUString& rSelText )
 {
-if (comphelper::LibreOfficeKit::isActive())
-{
-return;
-}
-
 if ( !pActiveViewSh )
 return;
 
@@ -1286,6 +1287,10 @@ void ScInputHandler::ShowArgumentsTip( OUString& 
rSelText )
 ShowTipBelow( aNew );
 bFound = true;
 }
+
+const SfxViewShell* pViewShell = 
SfxViewShell::Current();
+if (comphelper::LibreOfficeKit::isActive() && 
pViewShell->isLOKDesktop())
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TOOLTIP, 
aNew.toUtf8().getStr());
 }
 }
 }
@@ -1434,7 +1439,7 @@ void ScInputHandler::ShowFuncList( const ::std::vector< 
OUString > & rFuncStrVec
 const SfxViewShell* pViewShell = SfxViewShell::Current();
 if (comphelper::LibreOfficeKit::isActive())
 {
-if (rFuncStrVec.size() && pViewShell && pViewShell->isLOKMobilePhone())
+if (rFuncStrVec.size() && pViewShell)
 {
 auto aPos = pFormulaData->begin();
 sal_uInt32 nCurIndex = std::distance(aPos, miAutoPosFormula);
@@ -1488,7 +1493,6 @@ void ScInputHandler::ShowFuncList( const ::std::vector< 
OUString > & rFuncStrVec
 OString s = aPayload.makeStringAndClear();
 
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CALC_FUNCTION_LIST, 
s.getStr());
 }
-// not tunnel tooltips in the lok case
 return;
 }
 


core.git: Branch 'distro/collabora/co-24.04' - sc/source

2024-02-23 Thread Gülşah Köse (via logerrit)
 sc/source/ui/app/inputhdl.cxx |   16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit c86f6421524c187fa75a19c6e8ba09bd800d3518
Author: Gülşah Köse 
AuthorDate: Mon Feb 19 16:00:25 2024 +0300
Commit: Pedro Silva 
CommitDate: Fri Feb 23 10:07:26 2024 +0100

ONLINE: Add calc formula tooltip support.

Signed-off-by: Gülşah Köse 
Change-Id: I1f3c438f5152e2b372212d003c1ec4e74e4d3ff2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163721
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 9b45a88b1d31..62a7d7b9bf09 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1109,6 +1109,10 @@ void ScInputHandler::HideTip()
 pTipVisibleParent = nullptr;
 }
 aManualTip.clear();
+
+const SfxViewShell* pViewShell = SfxViewShell::Current();
+if (comphelper::LibreOfficeKit::isActive() && pViewShell)
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CALC_FUNCTION_LIST, 
"hidetip"_ostr);
 }
 void ScInputHandler::HideTipBelow()
 {
@@ -1134,11 +1138,6 @@ bool lcl_hasSingleToken(std::u16string_view s, 
sal_Unicode c)
 
 void ScInputHandler::ShowArgumentsTip( OUString& rSelText )
 {
-if (comphelper::LibreOfficeKit::isActive())
-{
-return;
-}
-
 if ( !pActiveViewSh )
 return;
 
@@ -1282,6 +1281,10 @@ void ScInputHandler::ShowArgumentsTip( OUString& 
rSelText )
 ShowTipBelow( aNew );
 bFound = true;
 }
+
+const SfxViewShell* pViewShell = 
SfxViewShell::Current();
+if (comphelper::LibreOfficeKit::isActive() && 
pViewShell->isLOKDesktop())
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TOOLTIP, aNew.toUtf8());
 }
 }
 }
@@ -1430,7 +1433,7 @@ void ScInputHandler::ShowFuncList( const ::std::vector< 
OUString > & rFuncStrVec
 const SfxViewShell* pViewShell = SfxViewShell::Current();
 if (comphelper::LibreOfficeKit::isActive())
 {
-if (rFuncStrVec.size() && pViewShell && pViewShell->isLOKMobilePhone())
+if (rFuncStrVec.size() && pViewShell)
 {
 auto aPos = pFormulaData->begin();
 sal_uInt32 nCurIndex = std::distance(aPos, miAutoPosFormula);
@@ -1483,7 +1486,6 @@ void ScInputHandler::ShowFuncList( const ::std::vector< 
OUString > & rFuncStrVec
 OString s = aPayload.makeStringAndClear();
 
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CALC_FUNCTION_LIST, s);
 }
-// not tunnel tooltips in the lok case
 return;
 }
 


core.git: Branch 'distro/collabora/co-23.05' - sc/source

2024-01-04 Thread Gülşah Köse (via logerrit)
 sc/source/core/data/document.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 59b3cf0cc098cefb5aa509f28e0b640f9d6679f4
Author: Gülşah Köse 
AuthorDate: Thu Dec 14 12:07:48 2023 +0300
Commit: Gülşah Köse 
CommitDate: Thu Jan 4 12:03:10 2024 +0100

ONLINE: Exit cell edit mode before add a new sheet

Prevents to move last edited cell to new sheet.

Signed-off-by: Gülşah Köse 
Change-Id: If4a4533d81ce244ae50bbdde1fae89da14f6b53a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160758
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161583
Tested-by: Jenkins CollaboraOffice 

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index e07dcf146640..aee46bad2ecc 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -507,6 +507,11 @@ void ScDocument::InvalidateStreamOnSave()
 bool ScDocument::InsertTab(
 SCTAB nPos, const OUString& rName, bool bExternalDocument, bool 
bUndoDeleteTab )
 {
+// auto-accept any in-process input to prevent move the cell into next 
sheet in online.
+if (comphelper::LibreOfficeKit::isActive())
+if (!SC_MOD()->IsFormulaMode())
+SC_MOD()->InputEnterHandler();
+
 SCTAB   nTabCount = static_cast(maTabs.size());
 boolbValid = ValidTab(nTabCount);
 if ( !bExternalDocument )   // else test rName == "'Doc'!Tab" first


core.git: sc/source

2024-01-03 Thread Gülşah Köse (via logerrit)
 sc/source/core/data/document.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit e0f710ad29d33acda3c1b77d7a0980ca9ae2e3d1
Author: Gülşah Köse 
AuthorDate: Thu Dec 14 12:07:48 2023 +0300
Commit: Gülşah Köse 
CommitDate: Wed Jan 3 11:59:46 2024 +0100

ONLINE: Exit cell edit mode before add a new sheet

Prevents to move last edited cell to new sheet.

Signed-off-by: Gülşah Köse 
Change-Id: If4a4533d81ce244ae50bbdde1fae89da14f6b53a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160758
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index aafd4271e5d1..04e20ce4b8ac 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -485,6 +485,11 @@ void ScDocument::InvalidateStreamOnSave()
 bool ScDocument::InsertTab(
 SCTAB nPos, const OUString& rName, bool bExternalDocument, bool 
bUndoDeleteTab )
 {
+// auto-accept any in-process input to prevent move the cell into next 
sheet in online.
+if (comphelper::LibreOfficeKit::isActive())
+if (!SC_MOD()->IsFormulaMode())
+SC_MOD()->InputEnterHandler();
+
 SCTAB nTabCount = GetTableCount();
 bool bValid = ValidTab(nTabCount);
 if ( !bExternalDocument )   // else test rName == "'Doc'!Tab" first


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - vcl/source

2023-11-29 Thread Gülşah Köse (via logerrit)
 vcl/source/window/layout.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit cf813141285dda900ccb2f102836385a8705bad9
Author: Gülşah Köse 
AuthorDate: Wed Nov 29 16:40:00 2023 +0300
Commit: Szymon Kłos 
CommitDate: Thu Nov 30 00:14:50 2023 +0100

Online: Put the image width height info into json.

When online's image render is delayed we don't have any image size info
so getting 0x0. To show better result we need that info into message.

Signed-off-by: Gülşah Köse 
Change-Id: I28f345cdd64de5fa47b3b1054330e606e7b32f03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160106
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 
(cherry picked from commit 10da3d0be5d4f5fe174908a2db0d92cd3dc0398a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160039
Tested-by: Jenkins CollaboraOffice 

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 8534b2809017..3d200eb68ffd 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -3099,6 +3099,8 @@ void 
VclDrawingArea::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
 
 BitmapEx aImage = pDevice->GetBitmapEx(Point(0,0), aRenderSize);
 aImage.Scale(aOutputSize);
+rJsonWriter.put("imagewidth", aRenderSize.Width());
+rJsonWriter.put("imageheight", aRenderSize.Height());
 
 SvMemoryStream aOStm(65535, 65535);
 if(GraphicConverter::Export(aOStm, aImage, ConvertDataFormat::PNG) == 
ERRCODE_NONE)


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

2023-11-29 Thread Gülşah Köse (via logerrit)
 vcl/source/window/layout.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit c9bae2d26ed065bad1e490815a7606435cf63556
Author: Gülşah Köse 
AuthorDate: Wed Nov 29 16:40:00 2023 +0300
Commit: Szymon Kłos 
CommitDate: Wed Nov 29 22:28:50 2023 +0100

Online: Put the image width height info into json.

When online's image render is delayed we don't have any image size info
so getting 0x0. To show better result we need that info into message.

Signed-off-by: Gülşah Köse 
Change-Id: I28f345cdd64de5fa47b3b1054330e606e7b32f03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160106
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 5095ee62009d..5639d8e62d57 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -3104,6 +3104,8 @@ void 
VclDrawingArea::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
 
 BitmapEx aImage = pDevice->GetBitmapEx(Point(0,0), aRenderSize);
 aImage.Scale(aOutputSize);
+rJsonWriter.put("imagewidth", aRenderSize.Width());
+rJsonWriter.put("imageheight", aRenderSize.Height());
 
 SvMemoryStream aOStm(65535, 65535);
 if(GraphicConverter::Export(aOStm, aImage, ConvertDataFormat::PNG) == 
ERRCODE_NONE)


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - vcl/inc vcl/jsdialog vcl/source

2023-11-23 Thread Gülşah Köse (via logerrit)
 vcl/inc/wizdlg.hxx   |1 
 vcl/jsdialog/jsdialogbuilder.cxx |7 
 vcl/source/control/roadmapwizard.cxx |   56 +--
 vcl/source/control/wizardmachine.cxx |7 
 vcl/source/control/wizimpldata.hxx   |   47 +
 5 files changed, 71 insertions(+), 47 deletions(-)

New commits:
commit 88639cdb35ff243263b04dacc794725b9e7e2703
Author: Gülşah Köse 
AuthorDate: Fri Nov 10 11:32:34 2023 +0300
Commit: Szymon Kłos 
CommitDate: Thu Nov 23 09:39:10 2023 +0100

Online: Fix Wizard Help button

Wizard dialog help button's response is not initialized if we don't run
any other dialogs. It should be initialized in RoadmapWizard itself.

response_help function can not detect wizard dialog's Help button. So we
should handle this case in function too.

Signed-off-by: Gülşah Köse 
Change-Id: If80a2e54dcbf5eaa3d0e07347d12296ace5c9569
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159282
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins
(cherry picked from commit a6fffac0336fa7d5843f73139ec88a5eef8269d5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159756
Tested-by: Jenkins CollaboraOffice 

diff --git a/vcl/inc/wizdlg.hxx b/vcl/inc/wizdlg.hxx
index 71da672a356e..a36619f2e30c 100644
--- a/vcl/inc/wizdlg.hxx
+++ b/vcl/inc/wizdlg.hxx
@@ -129,6 +129,7 @@ namespace vcl
 
 voidAddButton( Button* pButton, tools::Long nOffset = 
0 );
 voidRemoveButton( Button* pButton );
+voidAddButtonResponse( Button* pButton, int response);
 
 voidSetPageSizePixel( const Size& rSize ) { maPageSize 
= rSize; }
 const Size& GetPageSizePixel() const { return maPageSize; }
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 3cdf403c6242..c2cea61a6197 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -57,7 +57,14 @@ void response_help(vcl::Window* pWindow)
 vcl::Window* pButtonWindow = pDialog->get_widget_for_response(RET_HELP);
 ::Button* pButton = dynamic_cast<::Button*>(pButtonWindow);
 if (!pButton)
+{
+// Is it a wizard dialog?
+vcl::RoadmapWizard* pWizard = 
dynamic_cast(pWindow);
+if (!pWizard || !pWizard->m_pHelp)
+return;
+pWizard->m_pHelp->Click();
 return;
+}
 
 pButton->Click();
 }
diff --git a/vcl/source/control/roadmapwizard.cxx 
b/vcl/source/control/roadmapwizard.cxx
index 0aef0d00527e..0b3834d61237 100644
--- a/vcl/source/control/roadmapwizard.cxx
+++ b/vcl/source/control/roadmapwizard.cxx
@@ -28,59 +28,12 @@
 #include 
 
 #include 
-#include 
-#include 
 
 #include "wizimpldata.hxx"
 #include 
 
 namespace vcl
 {
-using namespace RoadmapWizardTypes;
-
-namespace
-{
-typedef ::std::set< WizardTypes::WizardState > StateSet;
-
-typedef ::std::map<
-PathId,
-WizardPath
-> Paths;
-
-typedef ::std::map<
-WizardTypes::WizardState,
-::std::pair<
-OUString,
-RoadmapPageFactory
->
-> StateDescriptions;
-}
-
-struct RoadmapWizardImpl
-{
-ScopedVclPtr pRoadmap;
-Paths   aPaths;
-PathId  nActivePath;
-StateDescriptions   aStateDescriptors;
-StateSetaDisabledStates;
-boolbActivePathIsDefinite;
-
-RoadmapWizardImpl()
-:pRoadmap( nullptr )
-,nActivePath( -1 )
-,bActivePathIsDefinite( false )
-{
-}
-
-/// returns the index of the current state in given path, or -1
-static sal_Int32 getStateIndexInPath( WizardTypes::WizardState 
_nState, const WizardPath& _rPath );
-/// returns the index of the current state in the path with the given 
id, or -1
-sal_Int32 getStateIndexInPath( WizardTypes::WizardState _nState, 
PathId _nPathId );
-/// returns the index of the first state in which the two given paths 
differ
-static sal_Int32 getFirstDifferentIndex( const WizardPath& _rLHS, 
const WizardPath& _rRHS );
-};
-
-
 sal_Int32 RoadmapWizardImpl::getStateIndexInPath( WizardTypes::WizardState 
_nState, const WizardPath& _rPath )
 {
 sal_Int32 nStateIndexInPath = 0;
@@ -818,6 +771,15 @@ namespace vcl
 sal_Int32 nStartPos = sDialogId.lastIndexOf('/');
 nStartPos = nStartPos >= 0 ? nStartPos + 1 : 0;
 rJsonWriter.put("dialogid", sDialogId.copy(nStartPos));
+{
+auto aResponses = rJsonWriter.startArray("responses");
+for (const auto& rResponse : m_xRoadmapImpl->maResponses)
+{
+auto aResponse = 

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

2023-11-22 Thread Gülşah Köse (via logerrit)
 vcl/inc/wizdlg.hxx   |1 
 vcl/jsdialog/jsdialogbuilder.cxx |7 
 vcl/source/control/roadmapwizard.cxx |   56 +--
 vcl/source/control/wizardmachine.cxx |7 
 vcl/source/control/wizimpldata.hxx   |   47 +
 5 files changed, 71 insertions(+), 47 deletions(-)

New commits:
commit a6fffac0336fa7d5843f73139ec88a5eef8269d5
Author: Gülşah Köse 
AuthorDate: Fri Nov 10 11:32:34 2023 +0300
Commit: Gülşah Köse 
CommitDate: Wed Nov 22 13:46:39 2023 +0100

Online: Fix Wizard Help button

Wizard dialog help button's response is not initialized if we don't run
any other dialogs. It should be initialized in RoadmapWizard itself.

response_help function can not detect wizard dialog's Help button. So we
should handle this case in function too.

Signed-off-by: Gülşah Köse 
Change-Id: If80a2e54dcbf5eaa3d0e07347d12296ace5c9569
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159282
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins

diff --git a/vcl/inc/wizdlg.hxx b/vcl/inc/wizdlg.hxx
index 4416ed2e5891..56a9ed5261d7 100644
--- a/vcl/inc/wizdlg.hxx
+++ b/vcl/inc/wizdlg.hxx
@@ -128,6 +128,7 @@ namespace vcl
 
 voidAddButton( Button* pButton, tools::Long nOffset = 
0 );
 voidRemoveButton( Button* pButton );
+voidAddButtonResponse( Button* pButton, int response);
 
 voidSetPageSizePixel( const Size& rSize ) { maPageSize 
= rSize; }
 const Size& GetPageSizePixel() const { return maPageSize; }
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 151928f873f6..48946baa15f9 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -54,7 +54,14 @@ void response_help(vcl::Window* pWindow)
 vcl::Window* pButtonWindow = pDialog->get_widget_for_response(RET_HELP);
 ::Button* pButton = dynamic_cast<::Button*>(pButtonWindow);
 if (!pButton)
+{
+// Is it a wizard dialog?
+vcl::RoadmapWizard* pWizard = 
dynamic_cast(pWindow);
+if (!pWizard || !pWizard->m_pHelp)
+return;
+pWizard->m_pHelp->Click();
 return;
+}
 
 pButton->Click();
 }
diff --git a/vcl/source/control/roadmapwizard.cxx 
b/vcl/source/control/roadmapwizard.cxx
index 846e6f2ee2f3..1b3c9e96b477 100644
--- a/vcl/source/control/roadmapwizard.cxx
+++ b/vcl/source/control/roadmapwizard.cxx
@@ -28,59 +28,12 @@
 #include 
 
 #include 
-#include 
-#include 
 
 #include "wizimpldata.hxx"
 #include 
 
 namespace vcl
 {
-using namespace RoadmapWizardTypes;
-
-namespace
-{
-typedef ::std::set< WizardTypes::WizardState > StateSet;
-
-typedef ::std::map<
-PathId,
-WizardPath
-> Paths;
-
-typedef ::std::map<
-WizardTypes::WizardState,
-::std::pair<
-OUString,
-RoadmapPageFactory
->
-> StateDescriptions;
-}
-
-struct RoadmapWizardImpl
-{
-ScopedVclPtr pRoadmap;
-Paths   aPaths;
-PathId  nActivePath;
-StateDescriptions   aStateDescriptors;
-StateSetaDisabledStates;
-boolbActivePathIsDefinite;
-
-RoadmapWizardImpl()
-:pRoadmap( nullptr )
-,nActivePath( -1 )
-,bActivePathIsDefinite( false )
-{
-}
-
-/// returns the index of the current state in given path, or -1
-static sal_Int32 getStateIndexInPath( WizardTypes::WizardState 
_nState, const WizardPath& _rPath );
-/// returns the index of the current state in the path with the given 
id, or -1
-sal_Int32 getStateIndexInPath( WizardTypes::WizardState _nState, 
PathId _nPathId );
-/// returns the index of the first state in which the two given paths 
differ
-static sal_Int32 getFirstDifferentIndex( const WizardPath& _rLHS, 
const WizardPath& _rRHS );
-};
-
-
 sal_Int32 RoadmapWizardImpl::getStateIndexInPath( WizardTypes::WizardState 
_nState, const WizardPath& _rPath )
 {
 sal_Int32 nStateIndexInPath = 0;
@@ -818,6 +771,15 @@ namespace vcl
 sal_Int32 nStartPos = sDialogId.lastIndexOf('/');
 nStartPos = nStartPos >= 0 ? nStartPos + 1 : 0;
 rJsonWriter.put("dialogid", sDialogId.copy(nStartPos));
+{
+auto aResponses = rJsonWriter.startArray("responses");
+for (const auto& rResponse : m_xRoadmapImpl->maResponses)
+{
+auto aResponse = rJsonWriter.startStruct();
+rJsonWriter.put("id", rResponse.first->get_id());
+rJsonWriter.put("response", rResponse.second);
+}
+}
 
 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/svx svx/source

2023-08-10 Thread Gülşah Köse (via logerrit)
 include/svx/dialog/ThemeDialog.hxx |1 +
 svx/source/dialog/ThemeDialog.cxx  |   11 +--
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit b380a9068472bf9ee8a78aefdf72d1296bae6662
Author: Gülşah Köse 
AuthorDate: Mon Jul 31 11:04:35 2023 +0300
Commit: Gülşah Köse 
CommitDate: Thu Aug 10 11:44:35 2023 +0200

Prevent to open multiple Theme Color Edit dialog

When we do super fast clicks to Add button prevent to open multiple
dialog. Follow-up commit e73b2bc4e6fdaba3098fa2c701342e1df112514c

Signed-off-by: Gülşah Köse 
Change-Id: If40c4982b873d41984bea298284eae062742b057
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155083
Tested-by: Jenkins
(cherry picked from commit 5a683f2d7c59bbb9ad93172f8dcf43e9efa56053)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155477
Tested-by: Jenkins CollaboraOffice 

diff --git a/include/svx/dialog/ThemeDialog.hxx 
b/include/svx/dialog/ThemeDialog.hxx
index 020240c97ca3..7003fdebf168 100644
--- a/include/svx/dialog/ThemeDialog.hxx
+++ b/include/svx/dialog/ThemeDialog.hxx
@@ -30,6 +30,7 @@ class SVX_DLLPUBLIC ThemeDialog final : public 
weld::GenericDialogController
 private:
 weld::Window* mpWindow;
 model::Theme* mpTheme;
+bool mxSubDialog;
 std::vector maColorSets;
 
 std::unique_ptr mxValueSetThemeColors;
diff --git a/svx/source/dialog/ThemeDialog.cxx 
b/svx/source/dialog/ThemeDialog.cxx
index ab743b0df4bd..99e7c3ad466e 100644
--- a/svx/source/dialog/ThemeDialog.cxx
+++ b/svx/source/dialog/ThemeDialog.cxx
@@ -22,6 +22,7 @@ ThemeDialog::ThemeDialog(weld::Window* pParent, model::Theme* 
pTheme)
 : GenericDialogController(pParent, "svx/ui/themedialog.ui", "ThemeDialog")
 , mpWindow(pParent)
 , mpTheme(pTheme)
+, mxSubDialog(false)
 , mxValueSetThemeColors(new svx::ThemeColorValueSet)
 , mxValueSetThemeColorsWindow(
   new weld::CustomWeld(*m_xBuilder, "valueset_theme_colors", 
*mxValueSetThemeColors))
@@ -85,12 +86,17 @@ IMPL_LINK_NOARG(ThemeDialog, SelectItem, ValueSet*, void)
 
 void ThemeDialog::runThemeColorEditDialog()
 {
+if (mxSubDialog)
+return;
+
 auto pDialog = std::make_shared(mpWindow, 
*mpCurrentColorSet);
 std::shared_ptr xKeepAlive(shared_from_this());
-weld::DialogController::runAsync(pDialog, [this, xKeepAlive, 
pDialog](sal_uInt32 nResult) {
+
+mxSubDialog = weld::DialogController::runAsync(pDialog, [this, 
pDialog](sal_uInt32 nResult) {
 if (nResult != RET_OK)
 {
 mxAdd->set_sensitive(true);
+mxSubDialog = false;
 return;
 }
 auto aColorSet = pDialog->getColorSet();
@@ -107,15 +113,16 @@ void ThemeDialog::runThemeColorEditDialog()
 = 
std::make_shared(maColorSets[maColorSets.size() - 1]);
 }
 mxAdd->set_sensitive(true);
+mxSubDialog = false;
 });
 }
 
 IMPL_LINK(ThemeDialog, ButtonClicked, weld::Button&, rButton, void)
 {
+mxAdd->set_sensitive(false);
 if (mpCurrentColorSet && mxAdd.get() == )
 {
 runThemeColorEditDialog();
-mxAdd->set_sensitive(false);
 }
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - svx/source

2023-08-09 Thread Gülşah Köse (via logerrit)
 svx/source/dialog/ThemeDialog.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit b0a33352536e251598c6cc5ac1f69bfd043e6ba2
Author: Gülşah Köse 
AuthorDate: Mon Jul 17 11:27:08 2023 +0300
Commit: Gülşah Köse 
CommitDate: Wed Aug 9 14:42:44 2023 +0200

Prevent to open multiple Theme Color Edit dialog

Signed-off-by: Gülşah Köse 
Change-Id: Ibf4db096b44ce941140a12d003b89b636f5e7224
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154514
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 
(cherry picked from commit e73b2bc4e6fdaba3098fa2c701342e1df112514c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155401
Tested-by: Jenkins CollaboraOffice 

diff --git a/svx/source/dialog/ThemeDialog.cxx 
b/svx/source/dialog/ThemeDialog.cxx
index 29d12f25c779..ab743b0df4bd 100644
--- a/svx/source/dialog/ThemeDialog.cxx
+++ b/svx/source/dialog/ThemeDialog.cxx
@@ -89,7 +89,10 @@ void ThemeDialog::runThemeColorEditDialog()
 std::shared_ptr xKeepAlive(shared_from_this());
 weld::DialogController::runAsync(pDialog, [this, xKeepAlive, 
pDialog](sal_uInt32 nResult) {
 if (nResult != RET_OK)
+{
+mxAdd->set_sensitive(true);
 return;
+}
 auto aColorSet = pDialog->getColorSet();
 if (!aColorSet.getName().isEmpty())
 {
@@ -103,6 +106,7 @@ void ThemeDialog::runThemeColorEditDialog()
 mpCurrentColorSet
 = 
std::make_shared(maColorSets[maColorSets.size() - 1]);
 }
+mxAdd->set_sensitive(true);
 });
 }
 
@@ -111,6 +115,7 @@ IMPL_LINK(ThemeDialog, ButtonClicked, weld::Button&, 
rButton, void)
 if (mpCurrentColorSet && mxAdd.get() == )
 {
 runThemeColorEditDialog();
+mxAdd->set_sensitive(false);
 }
 }
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - svx/source

2023-08-02 Thread Gülşah Köse (via logerrit)
 svx/source/dialog/ThemeDialog.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 20d4f0ed59549c098cbd89a9b5361d2769e8c2d0
Author: Gülşah Köse 
AuthorDate: Mon Jul 17 11:27:08 2023 +0300
Commit: Caolán McNamara 
CommitDate: Wed Aug 2 12:53:42 2023 +0200

Prevent to open multiple Theme Color Edit dialog

Signed-off-by: Gülşah Köse 
Change-Id: Ibf4db096b44ce941140a12d003b89b636f5e7224
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154514
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 
(cherry picked from commit e73b2bc4e6fdaba3098fa2c701342e1df112514c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155175
Reviewed-by: Caolán McNamara 

diff --git a/svx/source/dialog/ThemeDialog.cxx 
b/svx/source/dialog/ThemeDialog.cxx
index 29d12f25c779..ab743b0df4bd 100644
--- a/svx/source/dialog/ThemeDialog.cxx
+++ b/svx/source/dialog/ThemeDialog.cxx
@@ -89,7 +89,10 @@ void ThemeDialog::runThemeColorEditDialog()
 std::shared_ptr xKeepAlive(shared_from_this());
 weld::DialogController::runAsync(pDialog, [this, xKeepAlive, 
pDialog](sal_uInt32 nResult) {
 if (nResult != RET_OK)
+{
+mxAdd->set_sensitive(true);
 return;
+}
 auto aColorSet = pDialog->getColorSet();
 if (!aColorSet.getName().isEmpty())
 {
@@ -103,6 +106,7 @@ void ThemeDialog::runThemeColorEditDialog()
 mpCurrentColorSet
 = 
std::make_shared(maColorSets[maColorSets.size() - 1]);
 }
+mxAdd->set_sensitive(true);
 });
 }
 
@@ -111,6 +115,7 @@ IMPL_LINK(ThemeDialog, ButtonClicked, weld::Button&, 
rButton, void)
 if (mpCurrentColorSet && mxAdd.get() == )
 {
 runThemeColorEditDialog();
+mxAdd->set_sensitive(false);
 }
 }
 


[Libreoffice-commits] core.git: include/svx svx/source

2023-08-02 Thread Gülşah Köse (via logerrit)
 include/svx/dialog/ThemeDialog.hxx |1 +
 svx/source/dialog/ThemeDialog.cxx  |   11 +--
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 5a683f2d7c59bbb9ad93172f8dcf43e9efa56053
Author: Gülşah Köse 
AuthorDate: Mon Jul 31 11:04:35 2023 +0300
Commit: Gülşah Köse 
CommitDate: Wed Aug 2 11:46:51 2023 +0200

Prevent to open multiple Theme Color Edit dialog

When we do super fast clicks to Add button prevent to open multiple
dialog. Follow-up commit e73b2bc4e6fdaba3098fa2c701342e1df112514c

Signed-off-by: Gülşah Köse 
Change-Id: If40c4982b873d41984bea298284eae062742b057
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155083
Tested-by: Jenkins

diff --git a/include/svx/dialog/ThemeDialog.hxx 
b/include/svx/dialog/ThemeDialog.hxx
index 020240c97ca3..7003fdebf168 100644
--- a/include/svx/dialog/ThemeDialog.hxx
+++ b/include/svx/dialog/ThemeDialog.hxx
@@ -30,6 +30,7 @@ class SVX_DLLPUBLIC ThemeDialog final : public 
weld::GenericDialogController
 private:
 weld::Window* mpWindow;
 model::Theme* mpTheme;
+bool mxSubDialog;
 std::vector maColorSets;
 
 std::unique_ptr mxValueSetThemeColors;
diff --git a/svx/source/dialog/ThemeDialog.cxx 
b/svx/source/dialog/ThemeDialog.cxx
index ab743b0df4bd..99e7c3ad466e 100644
--- a/svx/source/dialog/ThemeDialog.cxx
+++ b/svx/source/dialog/ThemeDialog.cxx
@@ -22,6 +22,7 @@ ThemeDialog::ThemeDialog(weld::Window* pParent, model::Theme* 
pTheme)
 : GenericDialogController(pParent, "svx/ui/themedialog.ui", "ThemeDialog")
 , mpWindow(pParent)
 , mpTheme(pTheme)
+, mxSubDialog(false)
 , mxValueSetThemeColors(new svx::ThemeColorValueSet)
 , mxValueSetThemeColorsWindow(
   new weld::CustomWeld(*m_xBuilder, "valueset_theme_colors", 
*mxValueSetThemeColors))
@@ -85,12 +86,17 @@ IMPL_LINK_NOARG(ThemeDialog, SelectItem, ValueSet*, void)
 
 void ThemeDialog::runThemeColorEditDialog()
 {
+if (mxSubDialog)
+return;
+
 auto pDialog = std::make_shared(mpWindow, 
*mpCurrentColorSet);
 std::shared_ptr xKeepAlive(shared_from_this());
-weld::DialogController::runAsync(pDialog, [this, xKeepAlive, 
pDialog](sal_uInt32 nResult) {
+
+mxSubDialog = weld::DialogController::runAsync(pDialog, [this, 
pDialog](sal_uInt32 nResult) {
 if (nResult != RET_OK)
 {
 mxAdd->set_sensitive(true);
+mxSubDialog = false;
 return;
 }
 auto aColorSet = pDialog->getColorSet();
@@ -107,15 +113,16 @@ void ThemeDialog::runThemeColorEditDialog()
 = 
std::make_shared(maColorSets[maColorSets.size() - 1]);
 }
 mxAdd->set_sensitive(true);
+mxSubDialog = false;
 });
 }
 
 IMPL_LINK(ThemeDialog, ButtonClicked, weld::Button&, rButton, void)
 {
+mxAdd->set_sensitive(false);
 if (mpCurrentColorSet && mxAdd.get() == )
 {
 runThemeColorEditDialog();
-mxAdd->set_sensitive(false);
 }
 }
 


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

2023-07-17 Thread Gülşah Köse (via logerrit)
 svx/source/dialog/ThemeDialog.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit e73b2bc4e6fdaba3098fa2c701342e1df112514c
Author: Gülşah Köse 
AuthorDate: Mon Jul 17 11:27:08 2023 +0300
Commit: Tomaž Vajngerl 
CommitDate: Mon Jul 17 13:53:20 2023 +0200

Prevent to open multiple Theme Color Edit dialog

Signed-off-by: Gülşah Köse 
Change-Id: Ibf4db096b44ce941140a12d003b89b636f5e7224
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154514
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/svx/source/dialog/ThemeDialog.cxx 
b/svx/source/dialog/ThemeDialog.cxx
index 8af6f5975df2..cda60a457b04 100644
--- a/svx/source/dialog/ThemeDialog.cxx
+++ b/svx/source/dialog/ThemeDialog.cxx
@@ -88,7 +88,10 @@ void ThemeDialog::runThemeColorEditDialog()
 auto pDialog = std::make_shared(mpWindow, 
*mpCurrentColorSet);
 weld::DialogController::runAsync(pDialog, [this, pDialog](sal_uInt32 
nResult) {
 if (nResult != RET_OK)
+{
+mxAdd->set_sensitive(true);
 return;
+}
 auto aColorSet = pDialog->getColorSet();
 if (!aColorSet.getName().isEmpty())
 {
@@ -102,6 +105,7 @@ void ThemeDialog::runThemeColorEditDialog()
 mpCurrentColorSet
 = 
std::make_shared(maColorSets[maColorSets.size() - 1]);
 }
+mxAdd->set_sensitive(true);
 });
 }
 
@@ -110,6 +114,7 @@ IMPL_LINK(ThemeDialog, ButtonClicked, weld::Button&, 
rButton, void)
 if (mpCurrentColorSet && mxAdd.get() == )
 {
 runThemeColorEditDialog();
+mxAdd->set_sensitive(false);
 }
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - chart2/qa chart2/source sc/qa sw/qa

2023-06-14 Thread Gülşah Köse (via logerrit)
 chart2/qa/extras/chart2import.cxx   |  
 92 ++
 chart2/qa/extras/chart2import2.cxx  |  
 14 -
 chart2/qa/extras/charttest.hxx  |  
 38 
 chart2/qa/extras/data/pptx/PieChartWithAutomaticLayout_SizeAndPosition.pptx 
|binary
 chart2/source/view/main/ChartView.cxx   |  
 18 +
 sc/qa/uitest/chart/chartDataLabels.py   |  
  8 
 sw/qa/extras/layout/layout2.cxx |  
  4 
 7 files changed, 158 insertions(+), 16 deletions(-)

New commits:
commit c93d88a7d321483e9d040fad17394a738f8cde7c
Author: Gülşah Köse 
AuthorDate: Wed Nov 23 17:05:28 2022 +0300
Commit: Aron Budea 
CommitDate: Wed Jun 14 08:06:15 2023 +0200

tdf#91265 Use same plot area distance as used in MSO

Changes the postion calculation for pie charts, where the margin
min distance is now constant for pie charts, but unchanged for
other chart types.

This changes the positions of various pie charts used in tests,
which have been changed to the new value after the cases have been
checked.

Added a new test with all 3 use cases (chart area width equals
height, width is greater than height, width is less than height).

Change-Id: I51f98f336a7c64a3e6762144fc7dc8d9df80f696
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143179
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
(cherry picked from commit 959fbfc000d2e3167b2b57b6d11bea231993b4f0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153017
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 243597a060ab..d9f443466d9f 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -139,6 +139,7 @@ public:
 void testFixedSizeBarChartVeryLongLabel();
 void testAutomaticSizeBarChartVeryLongLabel();
 void testTotalsRowIgnored();
+void testPieChartPlotAreaMarginWithAutomaticLayout();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest);
 CPPUNIT_TEST(Fdo60083);
@@ -226,6 +227,7 @@ public:
 CPPUNIT_TEST(testFixedSizeBarChartVeryLongLabel);
 CPPUNIT_TEST(testAutomaticSizeBarChartVeryLongLabel);
 CPPUNIT_TEST(testTotalsRowIgnored);
+CPPUNIT_TEST(testPieChartPlotAreaMarginWithAutomaticLayout);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -2319,6 +2321,96 @@ void Chart2ImportTest::testTotalsRowIgnored()
 }
 }
 
+void Chart2ImportTest::testPieChartPlotAreaMarginWithAutomaticLayout()
+{
+// tdf#91265
+// Checks the margin and calculation of the plot area for the pie chart 
inside the chart area.
+
+loadFromURL(u"pptx/PieChartWithAutomaticLayout_SizeAndPosition.pptx");
+
+OUString aCheckShapeName = "CID/D=0:CS=0:CT=0:Series=0";
+// Chart Wuse case Width == Height
+{
+// Load chart Chart_2_2 - 2cm x 2cm -
+auto xDocument = getChartDocFromDrawImpressNamed(0, u"Chart_2_2");
+CPPUNIT_ASSERT(xDocument.is());
+
+uno::ReferencexChartDocument(xDocument, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDocument.is());
+
+// Get the shape of the diagram / chart
+uno::Reference 
xDrawPageSupplier(xChartDocument, uno::UNO_QUERY);
+CPPUNIT_ASSERT(xDrawPageSupplier.is());
+uno::Reference xDrawPage = 
xDrawPageSupplier->getDrawPage();
+uno::Reference xShapes(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xShapes.is());
+
+uno::Reference xChartDiagramShape = 
getShapeByName(xShapes, aCheckShapeName);
+CPPUNIT_ASSERT(xChartDiagramShape.is());
+
+// Size
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1300, 
xChartDiagramShape->getSize().Width, 5);  // calculated chart area size - 2 * 
margin
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1300, 
xChartDiagramShape->getSize().Height, 5); // calculated chart area size - 2 * 
margin
+// Position
+CPPUNIT_ASSERT_DOUBLES_EQUAL(350, xChartDiagramShape->getPosition().X, 
5); // margin
+CPPUNIT_ASSERT_DOUBLES_EQUAL(350, xChartDiagramShape->getPosition().Y, 
5); // margin
+}
+
+// Chart use case - Width < Height
+{
+// Load chart Chart_3_4 - 3cm x 4cm
+auto xDocument = getChartDocFromDrawImpressNamed(0, u"Chart_3_4");
+CPPUNIT_ASSERT(xDocument.is());
+
+uno::ReferencexChartDocument(xDocument, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDocument.is());
+
+// Get the shape of the diagram / chart
+uno::Reference 
xDrawPageSupplier(xChartDocument, uno::UNO_QUERY);
+CPPUNIT_ASSERT(xDrawPageSupplier.is());
+uno::Reference xDrawPage = 
xDrawPageSupplier->getDrawPage();
+uno::Reference xShapes(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xShapes.is());
+
+ 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - chart2/qa chart2/source sc/qa sw/qa

2023-02-13 Thread Gülşah Köse (via logerrit)
 chart2/qa/extras/chart2import.cxx   |  
 92 ++
 chart2/qa/extras/chart2import2.cxx  |  
 14 -
 chart2/qa/extras/charttest.hxx  |  
 38 
 chart2/qa/extras/data/pptx/PieChartWithAutomaticLayout_SizeAndPosition.pptx 
|binary
 chart2/source/view/main/ChartView.cxx   |  
 20 +-
 sc/qa/uitest/chart/chartDataLabels.py   |  
  8 
 sw/qa/extras/layout/layout2.cxx |  
  4 
 7 files changed, 159 insertions(+), 17 deletions(-)

New commits:
commit a6dbb1c765eb5f268badd8727beedfe27786bd08
Author: Gülşah Köse 
AuthorDate: Wed Nov 23 17:05:28 2022 +0300
Commit: Gülşah Köse 
CommitDate: Mon Feb 13 09:12:32 2023 +

tdf#91265 Use same plot area distance as used in MSO

Changes the postion calculation for pie charts, where the margin
min distance is now constant for pie charts, but unchanged for
other chart types.

This changes the positions of various pie charts used in tests,
which have been changed to the new value after the cases have been
checked.

Added a new test with all 3 use cases (chart area width equals
height, width is greater than height, width is less than height).

Change-Id: I51f98f336a7c64a3e6762144fc7dc8d9df80f696
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143179
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146603
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Pedro Silva 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 6710c86aba90..91abc305ebd2 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -138,6 +138,7 @@ public:
 void testFixedSizeBarChartVeryLongLabel();
 void testAutomaticSizeBarChartVeryLongLabel();
 void testTotalsRowIgnored();
+void testPieChartPlotAreaMarginWithAutomaticLayout();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest);
 CPPUNIT_TEST(Fdo60083);
@@ -224,6 +225,7 @@ public:
 CPPUNIT_TEST(testFixedSizeBarChartVeryLongLabel);
 CPPUNIT_TEST(testAutomaticSizeBarChartVeryLongLabel);
 CPPUNIT_TEST(testTotalsRowIgnored);
+CPPUNIT_TEST(testPieChartPlotAreaMarginWithAutomaticLayout);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -2283,6 +2285,96 @@ void Chart2ImportTest::testTotalsRowIgnored()
 }
 }
 
+void Chart2ImportTest::testPieChartPlotAreaMarginWithAutomaticLayout()
+{
+// tdf#91265
+// Checks the margin and calculation of the plot area for the pie chart 
inside the chart area.
+
+load(u"/chart2/qa/extras/data/pptx/", 
"PieChartWithAutomaticLayout_SizeAndPosition.pptx");
+
+OUString aCheckShapeName = "CID/D=0:CS=0:CT=0:Series=0";
+// Chart Wuse case Width == Height
+{
+// Load chart Chart_2_2 - 2cm x 2cm -
+auto xDocument = getChartDocFromDrawImpressNamed(0, u"Chart_2_2");
+CPPUNIT_ASSERT(xDocument.is());
+
+uno::ReferencexChartDocument(xDocument, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDocument.is());
+
+// Get the shape of the diagram / chart
+uno::Reference 
xDrawPageSupplier(xChartDocument, uno::UNO_QUERY);
+CPPUNIT_ASSERT(xDrawPageSupplier.is());
+uno::Reference xDrawPage = 
xDrawPageSupplier->getDrawPage();
+uno::Reference xShapes(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xShapes.is());
+
+uno::Reference xChartDiagramShape = 
getShapeByName(xShapes, aCheckShapeName);
+CPPUNIT_ASSERT(xChartDiagramShape.is());
+
+// Size
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1300, 
xChartDiagramShape->getSize().Width, 5);  // calculated chart area size - 2 * 
margin
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1300, 
xChartDiagramShape->getSize().Height, 5); // calculated chart area size - 2 * 
margin
+// Position
+CPPUNIT_ASSERT_DOUBLES_EQUAL(350, xChartDiagramShape->getPosition().X, 
5); // margin
+CPPUNIT_ASSERT_DOUBLES_EQUAL(350, xChartDiagramShape->getPosition().Y, 
5); // margin
+}
+
+// Chart use case - Width < Height
+{
+// Load chart Chart_3_4 - 3cm x 4cm
+auto xDocument = getChartDocFromDrawImpressNamed(0, u"Chart_3_4");
+CPPUNIT_ASSERT(xDocument.is());
+
+uno::ReferencexChartDocument(xDocument, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDocument.is());
+
+// Get the shape of the diagram / chart
+uno::Reference 
xDrawPageSupplier(xChartDocument, uno::UNO_QUERY);
+CPPUNIT_ASSERT(xDrawPageSupplier.is());
+uno::Reference xDrawPage = 
xDrawPageSupplier->getDrawPage();
+uno::Reference xShapes(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xShapes.is());
+
+uno::Reference xChartDiagramShape = 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - svx/source

2023-02-03 Thread Gülşah Köse (via logerrit)
 svx/source/sidebar/area/AreaPropertyPanelBase.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 1aa01d562118a78a3e183e35a619b5fe1a9268cf
Author: Gülşah Köse 
AuthorDate: Thu Jan 19 18:10:11 2023 +0300
Commit: Andras Timar 
CommitDate: Fri Feb 3 23:29:39 2023 +0100

Hide fill Attribute widget if fill style is none

When Fill style is none we can not use fill attribute element. So It is
better to hide.

Change-Id: I88d5e49448040b3afa18fbf66377d254716e7415
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145817
Tested-by: Jenkins
Tested-by: Pedro Silva 
Reviewed-by: Pedro Silva 
Reviewed-by: Mike Kaganski 

diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx 
b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index 996026d1fa6c..220e3f04b829 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -876,8 +876,7 @@ void AreaPropertyPanelBase::updateFillStyle(bool bDisabled, 
bool bDefaultOrSet,
 default:
 case drawing::FillStyle_NONE:
 {
-mxLbFillAttr->set_active(-1);
-mxLbFillAttr->set_sensitive(false);
+mxLbFillAttr->hide();
 // "Use slide background" also uses FillStyle_NONE internally,
 // don't switch listbox in that case (will be handled by 
updateFillUseBackground)
 nPos = meLastXFS == USE_BACKGROUND ? USE_BACKGROUND : NONE;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - svx/source

2023-01-23 Thread Gülşah Köse (via logerrit)
 svx/source/sidebar/area/AreaPropertyPanelBase.cxx |8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 7f2e7e49759b4b5aa80addd8c6a49405e7dcf547
Author: Gülşah Köse 
AuthorDate: Thu Jan 19 18:10:11 2023 +0300
Commit: Pedro Silva 
CommitDate: Mon Jan 23 13:44:16 2023 +

Hide fill attribute widget if fill style is none

When fill style is none we can not use fill attribute element. So It is
better to hide.

Change-Id: I88d5e49448040b3afa18fbf66377d254716e7415
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145817
Tested-by: Jenkins
Tested-by: Pedro Silva 
Reviewed-by: Pedro Silva 
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145876
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Gülşah Köse 

diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx 
b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index 428d35d94d59..9c19924d6c62 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -246,14 +246,13 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, SelectFillTypeHdl, 
weld::ComboBox&, void)
 default:
 case NONE:
 {
-mxLbFillAttr->show();
+mxLbFillAttr->hide();
 mxLbFillGradFrom->hide();
 mxLbFillGradTo->hide();
 mxGradientStyle->hide();
 mxMTRAngle->hide();
 mxToolBoxColor->hide();
 mxBmpImport->hide();
-mxLbFillAttr->set_sensitive(false);
 
 // #i122676# need to call a single SID_ATTR_FILL_STYLE change
 setFillStyle(XFillStyleItem(drawing::FillStyle_NONE));
@@ -800,8 +799,7 @@ void AreaPropertyPanelBase::updateFillStyle(bool bDisabled, 
bool bDefaultOrSet,
 default:
 case drawing::FillStyle_NONE:
 {
-mxLbFillAttr->set_active(-1);
-mxLbFillAttr->set_sensitive(false);
+mxLbFillAttr->hide();
 nPos = NONE;
 break;
 }
@@ -1096,7 +1094,7 @@ void AreaPropertyPanelBase::Update()
 {
 case eFillStyle::NONE:
 {
-mxLbFillAttr->show();
+mxLbFillAttr->hide();
 mxLbFillGradFrom->hide();
 mxLbFillGradTo->hide();
 mxMTRAngle->hide();


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

2023-01-20 Thread Gülşah Köse (via logerrit)
 svx/source/sidebar/area/AreaPropertyPanelBase.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 48e84907845daaf633991f88efb85d93c058a88d
Author: Gülşah Köse 
AuthorDate: Thu Jan 19 18:10:11 2023 +0300
Commit: Mike Kaganski 
CommitDate: Fri Jan 20 09:51:23 2023 +

Hide fill Attribute widget if fill style is none

When Fill style is none we can not use fill attribute element. So It is
better to hide.

Change-Id: I88d5e49448040b3afa18fbf66377d254716e7415
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145817
Tested-by: Jenkins
Tested-by: Pedro Silva 
Reviewed-by: Pedro Silva 
Reviewed-by: Mike Kaganski 

diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx 
b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index deac0eb9dcca..e54002ef9589 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -876,8 +876,7 @@ void AreaPropertyPanelBase::updateFillStyle(bool bDisabled, 
bool bDefaultOrSet,
 default:
 case drawing::FillStyle_NONE:
 {
-mxLbFillAttr->set_active(-1);
-mxLbFillAttr->set_sensitive(false);
+mxLbFillAttr->hide();
 // "Use slide background" also uses FillStyle_NONE internally,
 // don't switch listbox in that case (will be handled by 
updateFillUseBackground)
 nPos = meLastXFS == USE_BACKGROUND ? USE_BACKGROUND : NONE;


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

2023-01-16 Thread Gülşah Köse (via logerrit)
 chart2/qa/extras/chart2import.cxx   |  
 92 ++
 chart2/qa/extras/chart2import2.cxx  |  
 14 -
 chart2/qa/extras/charttest.hxx  |  
 38 
 chart2/qa/extras/data/pptx/PieChartWithAutomaticLayout_SizeAndPosition.pptx 
|binary
 chart2/source/view/main/ChartView.cxx   |  
 18 +
 sc/qa/uitest/chart/chartDataLabels.py   |  
  8 
 sw/qa/extras/layout/layout2.cxx |  
  4 
 7 files changed, 158 insertions(+), 16 deletions(-)

New commits:
commit 959fbfc000d2e3167b2b57b6d11bea231993b4f0
Author: Gülşah Köse 
AuthorDate: Wed Nov 23 17:05:28 2022 +0300
Commit: Tomaž Vajngerl 
CommitDate: Tue Jan 17 07:19:32 2023 +

tdf#91265 Use same plot area distance as used in MSO

Changes the postion calculation for pie charts, where the margin
min distance is now constant for pie charts, but unchanged for
other chart types.

This changes the positions of various pie charts used in tests,
which have been changed to the new value after the cases have been
checked.

Added a new test with all 3 use cases (chart area width equals
height, width is greater than height, width is less than height).

Change-Id: I51f98f336a7c64a3e6762144fc7dc8d9df80f696
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143179
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index a9c301a94b93..b02f52c68411 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -138,6 +138,7 @@ public:
 void testFixedSizeBarChartVeryLongLabel();
 void testAutomaticSizeBarChartVeryLongLabel();
 void testTotalsRowIgnored();
+void testPieChartPlotAreaMarginWithAutomaticLayout();
 
 CPPUNIT_TEST_SUITE(Chart2ImportTest);
 CPPUNIT_TEST(Fdo60083);
@@ -225,6 +226,7 @@ public:
 CPPUNIT_TEST(testFixedSizeBarChartVeryLongLabel);
 CPPUNIT_TEST(testAutomaticSizeBarChartVeryLongLabel);
 CPPUNIT_TEST(testTotalsRowIgnored);
+CPPUNIT_TEST(testPieChartPlotAreaMarginWithAutomaticLayout);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -2303,6 +2305,96 @@ void Chart2ImportTest::testTotalsRowIgnored()
 }
 }
 
+void Chart2ImportTest::testPieChartPlotAreaMarginWithAutomaticLayout()
+{
+// tdf#91265
+// Checks the margin and calculation of the plot area for the pie chart 
inside the chart area.
+
+loadFromURL(u"pptx/PieChartWithAutomaticLayout_SizeAndPosition.pptx");
+
+OUString aCheckShapeName = "CID/D=0:CS=0:CT=0:Series=0";
+// Chart Wuse case Width == Height
+{
+// Load chart Chart_2_2 - 2cm x 2cm -
+auto xDocument = getChartDocFromDrawImpressNamed(0, u"Chart_2_2");
+CPPUNIT_ASSERT(xDocument.is());
+
+uno::ReferencexChartDocument(xDocument, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDocument.is());
+
+// Get the shape of the diagram / chart
+uno::Reference 
xDrawPageSupplier(xChartDocument, uno::UNO_QUERY);
+CPPUNIT_ASSERT(xDrawPageSupplier.is());
+uno::Reference xDrawPage = 
xDrawPageSupplier->getDrawPage();
+uno::Reference xShapes(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xShapes.is());
+
+uno::Reference xChartDiagramShape = 
getShapeByName(xShapes, aCheckShapeName);
+CPPUNIT_ASSERT(xChartDiagramShape.is());
+
+// Size
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1300, 
xChartDiagramShape->getSize().Width, 5);  // calculated chart area size - 2 * 
margin
+CPPUNIT_ASSERT_DOUBLES_EQUAL(1300, 
xChartDiagramShape->getSize().Height, 5); // calculated chart area size - 2 * 
margin
+// Position
+CPPUNIT_ASSERT_DOUBLES_EQUAL(350, xChartDiagramShape->getPosition().X, 
5); // margin
+CPPUNIT_ASSERT_DOUBLES_EQUAL(350, xChartDiagramShape->getPosition().Y, 
5); // margin
+}
+
+// Chart use case - Width < Height
+{
+// Load chart Chart_3_4 - 3cm x 4cm
+auto xDocument = getChartDocFromDrawImpressNamed(0, u"Chart_3_4");
+CPPUNIT_ASSERT(xDocument.is());
+
+uno::ReferencexChartDocument(xDocument, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xChartDocument.is());
+
+// Get the shape of the diagram / chart
+uno::Reference 
xDrawPageSupplier(xChartDocument, uno::UNO_QUERY);
+CPPUNIT_ASSERT(xDrawPageSupplier.is());
+uno::Reference xDrawPage = 
xDrawPageSupplier->getDrawPage();
+uno::Reference xShapes(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+CPPUNIT_ASSERT(xShapes.is());
+
+uno::Reference xChartDiagramShape = 
getShapeByName(xShapes, aCheckShapeName);
+CPPUNIT_ASSERT(xChartDiagramShape.is());
+
+// Size
+CPPUNIT_ASSERT_DOUBLES_EQUAL(2300, 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - editeng/source

2022-12-21 Thread Gülşah Köse (via logerrit)
 editeng/source/editeng/impedit.cxx |   13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

New commits:
commit 5b8b90d4bdc70dc697adf5014c394e5d2f1adffe
Author: Gülşah Köse 
AuthorDate: Mon Dec 12 14:22:53 2022 +0300
Commit: Gökay ŞATIR 
CommitDate: Wed Dec 21 10:53:27 2022 +

tdf#152483 Fix the insert hyperlink behaviour on Calc

Cursor invalidation message shouldn't carry a hyperlink info to online
side if there is no hyperlink under the cursor

Change-Id: Ibdb6e32d029e101212d03bc117a5a14a712822ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143986
Tested-by: Jenkins
Reviewed-by: Dennis Francis 
(cherry picked from commit e9356f9ced3167cd927e98617bab54048cc63073)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144184
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Gülşah Köse 
Reviewed-by: Gökay ŞATIR 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 344f9a24ba03..a6387ba1d776 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1415,19 +1416,17 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
 // is cursor at a misspelled word ?
 Reference< linguistic2::XSpellChecker1 >  xSpeller( 
pEditEngine->pImpEditEngine->GetSpeller() );
 bool bIsWrong = xSpeller.is() && IsWrongSpelledWord(aPaM, 
/*bMarkIfWrong*/ false);
+EditView* pActiveView = GetEditViewPtr();
 
 boost::property_tree::ptree aHyperlinkTree;
-if (const SvxFieldItem* pFld = GetField(aPos, nullptr, 
nullptr))
+if (URLFieldHelper::IsCursorAtURLField(*pActiveView))
 {
-if (auto pUrlField = dynamic_cast(pFld->GetField()))
-{
-aHyperlinkTree = 
getHyperlinkPropTree(pUrlField->GetRepresentation(), pUrlField->GetURL());
-}
+if (const SvxFieldItem* pFld = GetField(aPos, nullptr, 
nullptr))
+if (auto pUrlField = dynamic_cast(pFld->GetField()))
+aHyperlinkTree = 
getHyperlinkPropTree(pUrlField->GetRepresentation(), pUrlField->GetURL());
 }
 else if (GetEditSelection().HasRange())
 {
-EditView* pActiveView = GetEditViewPtr();
-
 if (pActiveView)
 {
 const SvxFieldItem* pFieldItem = 
pActiveView->GetFieldAtSelection();


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

2022-12-14 Thread Gülşah Köse (via logerrit)
 editeng/source/editeng/impedit.cxx |   13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

New commits:
commit e9356f9ced3167cd927e98617bab54048cc63073
Author: Gülşah Köse 
AuthorDate: Mon Dec 12 14:22:53 2022 +0300
Commit: Dennis Francis 
CommitDate: Wed Dec 14 12:15:12 2022 +

tdf#152483 Fix the insert hyperlink behaviour on Calc

Cursor invalidation message shouldn't carry a hyperlink info to online
side if there is no hyperlink under the cursor

Change-Id: Ibdb6e32d029e101212d03bc117a5a14a712822ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143986
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 1a425cbe64f4..1223d717f5e5 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1415,19 +1416,17 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
 // is cursor at a misspelled word ?
 Reference< linguistic2::XSpellChecker1 >  xSpeller( 
pEditEngine->pImpEditEngine->GetSpeller() );
 bool bIsWrong = xSpeller.is() && IsWrongSpelledWord(aPaM, 
/*bMarkIfWrong*/ false);
+EditView* pActiveView = GetEditViewPtr();
 
 boost::property_tree::ptree aHyperlinkTree;
-if (const SvxFieldItem* pFld = GetField(aPos, nullptr, 
nullptr))
+if (URLFieldHelper::IsCursorAtURLField(*pActiveView))
 {
-if (auto pUrlField = dynamic_cast(pFld->GetField()))
-{
-aHyperlinkTree = 
getHyperlinkPropTree(pUrlField->GetRepresentation(), pUrlField->GetURL());
-}
+if (const SvxFieldItem* pFld = GetField(aPos, nullptr, 
nullptr))
+if (auto pUrlField = dynamic_cast(pFld->GetField()))
+aHyperlinkTree = 
getHyperlinkPropTree(pUrlField->GetRepresentation(), pUrlField->GetURL());
 }
 else if (GetEditSelection().HasRange())
 {
-EditView* pActiveView = GetEditViewPtr();
-
 if (pActiveView)
 {
 const SvxFieldItem* pFieldItem = 
pActiveView->GetFieldAtSelection();


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sw/source

2022-07-30 Thread Gülşah Köse (via logerrit)
 sw/source/uibase/dbui/dbmgr.cxx |   37 ++---
 1 file changed, 18 insertions(+), 19 deletions(-)

New commits:
commit ccd7b9435f41d4be750555fe23ff12a73fb5e345
Author: Gülşah Köse 
AuthorDate: Fri Jul 8 14:48:27 2022 +0300
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat Jul 30 10:53:34 2022 +0200

tdf#149915 Proper creation of vnd.sun.star.pkg:// URL

Using different methods of creation (one using DecodeMechanism::NONE,
another using DecodeMechanism::WithCharset) gave differently encoded
end results, comparing unequal.

The proper way is using DecodeMechanism::NONE on the document's URL,
as implemented in commit 06756e412b2a02030ce3355b3fe4e2ecc71d2301
  Author Mike Kaganski 
  Date   Sat Nov 18 22:41:40 2017 +0300
One more proper construction of vnd.sun.star.pkg URL

Co-authored-by: Mike Kaganski 

Change-Id: I272f277ef8b4bd23e6cb7884e68f3c79f742683a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136901
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
(cherry picked from commit 9790585a62cb55e0e0024819596592193a6de269)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137428
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 9323c52770b2..aa9937065325 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -136,6 +136,21 @@ void lcl_emitEvent(SfxEventHintId nEventId, sal_Int32 
nStrId, SfxObjectShell* pD
pDocShell));
 }
 
+// Construct vnd.sun.star.pkg:// URL
+OUString ConstructVndSunStarPkgUrl(const OUString& rMainURL, 
std::u16string_view rStreamRelPath)
+{
+auto xContext(comphelper::getProcessComponentContext());
+auto xUri = 
css::uri::UriReferenceFactory::create(xContext)->parse(rMainURL);
+assert(xUri.is());
+xUri = css::uri::VndSunStarPkgUrlReferenceFactory::create(xContext)
+->createVndSunStarPkgUrlReference(xUri);
+assert(xUri.is());
+return xUri->getUriReference() + "/"
++ INetURLObject::encode(
+rStreamRelPath, INetURLObject::PART_FPATH,
+INetURLObject::EncodeMechanism::All);
+}
+
 }
 
 std::vector> 
SwDBManager::s_aUncommittedRegistrations;
@@ -256,10 +271,9 @@ void SAL_CALL 
SwDataSourceRemovedListener::revokedDatabaseLocation(const sdb::Da
 if (!pDocShell)
 return;
 
-OUString aOwnURL = 
pDocShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::WithCharset);
-OUString sTmpName = "vnd.sun.star.pkg://" +
-INetURLObject::encode(aOwnURL, INetURLObject::PART_AUTHORITY, 
INetURLObject::EncodeMechanism::All);
-sTmpName += "/" + m_pDBManager->getEmbeddedName();
+const OUString sTmpName = ConstructVndSunStarPkgUrl(
+
pDocShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::NONE),
+m_pDBManager->getEmbeddedName());
 
 if (sTmpName != rEvent.OldLocation)
 return;
@@ -2760,21 +2774,6 @@ OUString LoadAndRegisterDataSource_Impl(DBConnURIType 
type, const uno::Reference
 }
 return sFind;
 }
-
-// Construct vnd.sun.star.pkg:// URL
-OUString ConstructVndSunStarPkgUrl(const OUString& rMainURL, 
std::u16string_view rStreamRelPath)
-{
-auto xContext(comphelper::getProcessComponentContext());
-auto xUri = 
css::uri::UriReferenceFactory::create(xContext)->parse(rMainURL);
-assert(xUri.is());
-xUri = css::uri::VndSunStarPkgUrlReferenceFactory::create(xContext)
-->createVndSunStarPkgUrlReference(xUri);
-assert(xUri.is());
-return xUri->getUriReference() + "/"
-+ INetURLObject::encode(
-rStreamRelPath, INetURLObject::PART_FPATH,
-INetURLObject::EncodeMechanism::All);
-}
 }
 
 OUString SwDBManager::LoadAndRegisterDataSource(weld::Window* pParent, 
SwDocShell* pDocShell)


[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sw/source

2022-07-30 Thread Gülşah Köse (via logerrit)
 sw/source/uibase/dbui/dbmgr.cxx |   37 ++---
 1 file changed, 18 insertions(+), 19 deletions(-)

New commits:
commit 7369cef79ba7580bc30e48cec4d1a6fdcc8444f6
Author: Gülşah Köse 
AuthorDate: Fri Jul 8 14:48:27 2022 +0300
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat Jul 30 10:53:17 2022 +0200

tdf#149915 Proper creation of vnd.sun.star.pkg:// URL

Using different methods of creation (one using DecodeMechanism::NONE,
another using DecodeMechanism::WithCharset) gave differently encoded
end results, comparing unequal.

The proper way is using DecodeMechanism::NONE on the document's URL,
as implemented in commit 06756e412b2a02030ce3355b3fe4e2ecc71d2301
  Author Mike Kaganski 
  Date   Sat Nov 18 22:41:40 2017 +0300
One more proper construction of vnd.sun.star.pkg URL

Co-authored-by: Mike Kaganski 

Change-Id: I272f277ef8b4bd23e6cb7884e68f3c79f742683a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136901
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
(cherry picked from commit 9790585a62cb55e0e0024819596592193a6de269)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137427
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 0d526bab42c3..c5aa73a0a2f4 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -136,6 +136,21 @@ void lcl_emitEvent(SfxEventHintId nEventId, sal_Int32 
nStrId, SfxObjectShell* pD
pDocShell));
 }
 
+// Construct vnd.sun.star.pkg:// URL
+OUString ConstructVndSunStarPkgUrl(const OUString& rMainURL, 
std::u16string_view rStreamRelPath)
+{
+auto xContext(comphelper::getProcessComponentContext());
+auto xUri = 
css::uri::UriReferenceFactory::create(xContext)->parse(rMainURL);
+assert(xUri.is());
+xUri = css::uri::VndSunStarPkgUrlReferenceFactory::create(xContext)
+->createVndSunStarPkgUrlReference(xUri);
+assert(xUri.is());
+return xUri->getUriReference() + "/"
++ INetURLObject::encode(
+rStreamRelPath, INetURLObject::PART_FPATH,
+INetURLObject::EncodeMechanism::All);
+}
+
 }
 
 std::vector> 
SwDBManager::s_aUncommittedRegistrations;
@@ -256,10 +271,9 @@ void SAL_CALL 
SwDataSourceRemovedListener::revokedDatabaseLocation(const sdb::Da
 if (!pDocShell)
 return;
 
-OUString aOwnURL = 
pDocShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::WithCharset);
-OUString sTmpName = "vnd.sun.star.pkg://" +
-INetURLObject::encode(aOwnURL, INetURLObject::PART_AUTHORITY, 
INetURLObject::EncodeMechanism::All);
-sTmpName += "/" + m_pDBManager->getEmbeddedName();
+const OUString sTmpName = ConstructVndSunStarPkgUrl(
+
pDocShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::NONE),
+m_pDBManager->getEmbeddedName());
 
 if (sTmpName != rEvent.OldLocation)
 return;
@@ -2759,21 +2773,6 @@ OUString LoadAndRegisterDataSource_Impl(DBConnURIType 
type, const uno::Reference
 }
 return sFind;
 }
-
-// Construct vnd.sun.star.pkg:// URL
-OUString ConstructVndSunStarPkgUrl(const OUString& rMainURL, 
std::u16string_view rStreamRelPath)
-{
-auto xContext(comphelper::getProcessComponentContext());
-auto xUri = 
css::uri::UriReferenceFactory::create(xContext)->parse(rMainURL);
-assert(xUri.is());
-xUri = css::uri::VndSunStarPkgUrlReferenceFactory::create(xContext)
-->createVndSunStarPkgUrlReference(xUri);
-assert(xUri.is());
-return xUri->getUriReference() + "/"
-+ INetURLObject::encode(
-rStreamRelPath, INetURLObject::PART_FPATH,
-INetURLObject::EncodeMechanism::All);
-}
 }
 
 OUString SwDBManager::LoadAndRegisterDataSource(weld::Window* pParent, 
SwDocShell* pDocShell)


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - sw/source

2022-07-26 Thread Gülşah Köse (via logerrit)
 sw/source/uibase/dbui/dbmgr.cxx |   37 ++---
 1 file changed, 18 insertions(+), 19 deletions(-)

New commits:
commit cd38c23ed291e52fbb3cf0ce6070081e6aecff22
Author: Gülşah Köse 
AuthorDate: Fri Jul 8 14:48:27 2022 +0300
Commit: Andras Timar 
CommitDate: Tue Jul 26 14:55:53 2022 +0200

tdf#149915 Proper creation of vnd.sun.star.pkg:// URL

Using different methods of creation (one using DecodeMechanism::NONE,
another using DecodeMechanism::WithCharset) gave differently encoded
end results, comparing unequal.

The proper way is using DecodeMechanism::NONE on the document's URL,
as implemented in commit 06756e412b2a02030ce3355b3fe4e2ecc71d2301
  Author Mike Kaganski 
  Date   Sat Nov 18 22:41:40 2017 +0300
One more proper construction of vnd.sun.star.pkg URL

Co-authored-by: Mike Kaganski 

Change-Id: I272f277ef8b4bd23e6cb7884e68f3c79f742683a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136901
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
(cherry picked from commit 9790585a62cb55e0e0024819596592193a6de269)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137429
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 9323c52770b2..aa9937065325 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -136,6 +136,21 @@ void lcl_emitEvent(SfxEventHintId nEventId, sal_Int32 
nStrId, SfxObjectShell* pD
pDocShell));
 }
 
+// Construct vnd.sun.star.pkg:// URL
+OUString ConstructVndSunStarPkgUrl(const OUString& rMainURL, 
std::u16string_view rStreamRelPath)
+{
+auto xContext(comphelper::getProcessComponentContext());
+auto xUri = 
css::uri::UriReferenceFactory::create(xContext)->parse(rMainURL);
+assert(xUri.is());
+xUri = css::uri::VndSunStarPkgUrlReferenceFactory::create(xContext)
+->createVndSunStarPkgUrlReference(xUri);
+assert(xUri.is());
+return xUri->getUriReference() + "/"
++ INetURLObject::encode(
+rStreamRelPath, INetURLObject::PART_FPATH,
+INetURLObject::EncodeMechanism::All);
+}
+
 }
 
 std::vector> 
SwDBManager::s_aUncommittedRegistrations;
@@ -256,10 +271,9 @@ void SAL_CALL 
SwDataSourceRemovedListener::revokedDatabaseLocation(const sdb::Da
 if (!pDocShell)
 return;
 
-OUString aOwnURL = 
pDocShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::WithCharset);
-OUString sTmpName = "vnd.sun.star.pkg://" +
-INetURLObject::encode(aOwnURL, INetURLObject::PART_AUTHORITY, 
INetURLObject::EncodeMechanism::All);
-sTmpName += "/" + m_pDBManager->getEmbeddedName();
+const OUString sTmpName = ConstructVndSunStarPkgUrl(
+
pDocShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::NONE),
+m_pDBManager->getEmbeddedName());
 
 if (sTmpName != rEvent.OldLocation)
 return;
@@ -2760,21 +2774,6 @@ OUString LoadAndRegisterDataSource_Impl(DBConnURIType 
type, const uno::Reference
 }
 return sFind;
 }
-
-// Construct vnd.sun.star.pkg:// URL
-OUString ConstructVndSunStarPkgUrl(const OUString& rMainURL, 
std::u16string_view rStreamRelPath)
-{
-auto xContext(comphelper::getProcessComponentContext());
-auto xUri = 
css::uri::UriReferenceFactory::create(xContext)->parse(rMainURL);
-assert(xUri.is());
-xUri = css::uri::VndSunStarPkgUrlReferenceFactory::create(xContext)
-->createVndSunStarPkgUrlReference(xUri);
-assert(xUri.is());
-return xUri->getUriReference() + "/"
-+ INetURLObject::encode(
-rStreamRelPath, INetURLObject::PART_FPATH,
-INetURLObject::EncodeMechanism::All);
-}
 }
 
 OUString SwDBManager::LoadAndRegisterDataSource(weld::Window* pParent, 
SwDocShell* pDocShell)


[Libreoffice-commits] core.git: Branch 'distro/mimo/mimo-7-2' - sw/source

2022-07-22 Thread Gülşah Köse (via logerrit)
 sw/source/uibase/dbui/dbmgr.cxx |   37 ++---
 1 file changed, 18 insertions(+), 19 deletions(-)

New commits:
commit e954b945536fdf0fd4aa3d56aec5c1e2ce4c6196
Author: Gülşah Köse 
AuthorDate: Fri Jul 8 14:48:27 2022 +0300
Commit: Aron Budea 
CommitDate: Fri Jul 22 19:06:37 2022 +0200

tdf#149915 Proper creation of vnd.sun.star.pkg:// URL

Using different methods of creation (one using DecodeMechanism::NONE,
another using DecodeMechanism::WithCharset) gave differently encoded
end results, comparing unequal.

The proper way is using DecodeMechanism::NONE on the document's URL,
as implemented in commit 06756e412b2a02030ce3355b3fe4e2ecc71d2301
  Author Mike Kaganski 
  Date   Sat Nov 18 22:41:40 2017 +0300
One more proper construction of vnd.sun.star.pkg URL

Co-authored-by: Mike Kaganski 

Change-Id: I272f277ef8b4bd23e6cb7884e68f3c79f742683a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136901
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
(cherry picked from commit 9790585a62cb55e0e0024819596592193a6de269)

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 475388d2134e..9ad6184de3ac 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -134,6 +134,21 @@ void lcl_emitEvent(SfxEventHintId nEventId, sal_Int32 
nStrId, SfxObjectShell* pD
pDocShell));
 }
 
+// Construct vnd.sun.star.pkg:// URL
+OUString ConstructVndSunStarPkgUrl(const OUString& rMainURL, 
std::u16string_view rStreamRelPath)
+{
+auto xContext(comphelper::getProcessComponentContext());
+auto xUri = 
css::uri::UriReferenceFactory::create(xContext)->parse(rMainURL);
+assert(xUri.is());
+xUri = css::uri::VndSunStarPkgUrlReferenceFactory::create(xContext)
+->createVndSunStarPkgUrlReference(xUri);
+assert(xUri.is());
+return xUri->getUriReference() + "/"
++ INetURLObject::encode(
+rStreamRelPath, INetURLObject::PART_FPATH,
+INetURLObject::EncodeMechanism::All);
+}
+
 }
 
 std::vector> 
SwDBManager::m_aUncommittedRegistrations;
@@ -254,10 +269,9 @@ void SAL_CALL 
SwDataSourceRemovedListener::revokedDatabaseLocation(const sdb::Da
 if (!pDocShell)
 return;
 
-OUString aOwnURL = 
pDocShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::WithCharset);
-OUString sTmpName = "vnd.sun.star.pkg://" +
-INetURLObject::encode(aOwnURL, INetURLObject::PART_AUTHORITY, 
INetURLObject::EncodeMechanism::All);
-sTmpName += "/" + m_pDBManager->getEmbeddedName();
+const OUString sTmpName = ConstructVndSunStarPkgUrl(
+
pDocShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::NONE),
+m_pDBManager->getEmbeddedName());
 
 if (sTmpName != rEvent.OldLocation)
 return;
@@ -2760,21 +2774,6 @@ OUString LoadAndRegisterDataSource_Impl(DBConnURIType 
type, const uno::Reference
 }
 return sFind;
 }
-
-// Construct vnd.sun.star.pkg:// URL
-OUString ConstructVndSunStarPkgUrl(const OUString& rMainURL, 
std::u16string_view rStreamRelPath)
-{
-auto xContext(comphelper::getProcessComponentContext());
-auto xUri = 
css::uri::UriReferenceFactory::create(xContext)->parse(rMainURL);
-assert(xUri.is());
-xUri = css::uri::VndSunStarPkgUrlReferenceFactory::create(xContext)
-->createVndSunStarPkgUrlReference(xUri);
-assert(xUri.is());
-return xUri->getUriReference() + "/"
-+ INetURLObject::encode(
-rStreamRelPath, INetURLObject::PART_FPATH,
-INetURLObject::EncodeMechanism::All);
-}
 }
 
 OUString SwDBManager::LoadAndRegisterDataSource(weld::Window* pParent, 
SwDocShell* pDocShell)


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

2022-07-20 Thread Gülşah Köse (via logerrit)
 sw/source/uibase/dbui/dbmgr.cxx |   37 ++---
 1 file changed, 18 insertions(+), 19 deletions(-)

New commits:
commit 9790585a62cb55e0e0024819596592193a6de269
Author: Gülşah Köse 
AuthorDate: Fri Jul 8 14:48:27 2022 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jul 20 19:20:33 2022 +0200

tdf#149915 Proper creation of vnd.sun.star.pkg:// URL

Using different methods of creation (one using DecodeMechanism::NONE,
another using DecodeMechanism::WithCharset) gave differently encoded
end results, comparing unequal.

The proper way is using DecodeMechanism::NONE on the document's URL,
as implemented in commit 06756e412b2a02030ce3355b3fe4e2ecc71d2301
  Author Mike Kaganski 
  Date   Sat Nov 18 22:41:40 2017 +0300
One more proper construction of vnd.sun.star.pkg URL

Co-authored-by: Mike Kaganski 

Change-Id: I272f277ef8b4bd23e6cb7884e68f3c79f742683a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136901
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 15a1105e47b5..52a689ac8bc8 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -136,6 +136,21 @@ void lcl_emitEvent(SfxEventHintId nEventId, sal_Int32 
nStrId, SfxObjectShell* pD
pDocShell));
 }
 
+// Construct vnd.sun.star.pkg:// URL
+OUString ConstructVndSunStarPkgUrl(const OUString& rMainURL, 
std::u16string_view rStreamRelPath)
+{
+auto xContext(comphelper::getProcessComponentContext());
+auto xUri = 
css::uri::UriReferenceFactory::create(xContext)->parse(rMainURL);
+assert(xUri.is());
+xUri = css::uri::VndSunStarPkgUrlReferenceFactory::create(xContext)
+->createVndSunStarPkgUrlReference(xUri);
+assert(xUri.is());
+return xUri->getUriReference() + "/"
++ INetURLObject::encode(
+rStreamRelPath, INetURLObject::PART_FPATH,
+INetURLObject::EncodeMechanism::All);
+}
+
 }
 
 std::vector> 
SwDBManager::s_aUncommittedRegistrations;
@@ -256,10 +271,9 @@ void SAL_CALL 
SwDataSourceRemovedListener::revokedDatabaseLocation(const sdb::Da
 if (!pDocShell)
 return;
 
-OUString aOwnURL = 
pDocShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::WithCharset);
-OUString sTmpName = "vnd.sun.star.pkg://" +
-INetURLObject::encode(aOwnURL, INetURLObject::PART_AUTHORITY, 
INetURLObject::EncodeMechanism::All);
-sTmpName += "/" + m_pDBManager->getEmbeddedName();
+const OUString sTmpName = ConstructVndSunStarPkgUrl(
+
pDocShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::NONE),
+m_pDBManager->getEmbeddedName());
 
 if (sTmpName != rEvent.OldLocation)
 return;
@@ -2759,21 +2773,6 @@ OUString LoadAndRegisterDataSource_Impl(DBConnURIType 
type, const uno::Reference
 }
 return sFind;
 }
-
-// Construct vnd.sun.star.pkg:// URL
-OUString ConstructVndSunStarPkgUrl(const OUString& rMainURL, 
std::u16string_view rStreamRelPath)
-{
-auto xContext(comphelper::getProcessComponentContext());
-auto xUri = 
css::uri::UriReferenceFactory::create(xContext)->parse(rMainURL);
-assert(xUri.is());
-xUri = css::uri::VndSunStarPkgUrlReferenceFactory::create(xContext)
-->createVndSunStarPkgUrlReference(xUri);
-assert(xUri.is());
-return xUri->getUriReference() + "/"
-+ INetURLObject::encode(
-rStreamRelPath, INetURLObject::PART_FPATH,
-INetURLObject::EncodeMechanism::All);
-}
 }
 
 OUString SwDBManager::LoadAndRegisterDataSource(weld::Window* pParent, 
SwDocShell* pDocShell)


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - drawinglayer/source

2022-06-06 Thread Gülşah Köse (via logerrit)
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 7eb4f92ed90e13ce5cbf7286fae623770e71324c
Author: Gülşah Köse 
AuthorDate: Thu May 26 11:03:41 2022 +0300
Commit: Gülşah Köse 
CommitDate: Mon Jun 6 09:38:32 2022 +0200

tdf#136787 Add control to create 1-bit B bitmap while creating mask.

Glow effect creates half transparent pixels on shadow. Creating 1-bit
B bitmap mask treates that half transparent pixels as black.
We control 1-bit B bitmap creation when we have half transparent
pixels.

Change-Id: Iaf298a0e5ffeeb6637fe5d3f56cf4f8e30a203e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134981
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
(cherry picked from commit a658129012f1d183f95f8bf5dd6d7ff6926cd495)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135269

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 139bb0ba080a..53e75ac37d55 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -982,11 +982,12 @@ namespace
nTransparency defines minimal transparency level.
 */
 AlphaMask ProcessAndBlurAlphaMask(const Bitmap& rMask, double 
fErodeDilateRadius,
-  double fBlurRadius, sal_uInt8 nTransparency)
+  double fBlurRadius, sal_uInt8 nTransparency,
+  bool bConvertTo1Bit = true)
 {
 // Only completely white pixels on the initial mask must be considered for 
transparency. Any
 // other color must be treated as black. This creates 1-bit B bitmap.
-BitmapEx mask(rMask.CreateMask(COL_WHITE));
+BitmapEx mask(bConvertTo1Bit ? rMask.CreateMask(COL_WHITE) : rMask);
 
 // Scaling down increases performance without noticeable quality loss. 
Additionally,
 // current blur implementation can only handle blur radius between 2 and 
254.
@@ -1178,7 +1179,7 @@ void VclPixelProcessor2D::processShadowPrimitive2D(const 
primitive2d::ShadowPrim
 
 BitmapEx bitmapEx = mpOutputDevice->GetBitmapEx(aRect.TopLeft(), 
aRect.GetSize());
 
-AlphaMask mask = ProcessAndBlurAlphaMask(bitmapEx.GetAlpha(), 0, 
fBlurRadius, 0);
+AlphaMask mask = ProcessAndBlurAlphaMask(bitmapEx.GetAlpha(), 0, 
fBlurRadius, 0, false);
 
 const basegfx::BColor aShadowColor(
 
maBColorModifierStack.getModifiedColor(rCandidate.getShadowColor()));


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

2022-06-03 Thread Gülşah Köse (via logerrit)
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit a658129012f1d183f95f8bf5dd6d7ff6926cd495
Author: Gülşah Köse 
AuthorDate: Thu May 26 11:03:41 2022 +0300
Commit: Gülşah Köse 
CommitDate: Fri Jun 3 10:15:56 2022 +0200

tdf#136787 Add control to create 1-bit B bitmap while creating mask.

Glow effect creates half transparent pixels on shadow. Creating 1-bit
B bitmap mask treates that half transparent pixels as black.
We control 1-bit B bitmap creation when we have half transparent
pixels.

Change-Id: Iaf298a0e5ffeeb6637fe5d3f56cf4f8e30a203e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134981
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx 
b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 70b5331f1f79..362d0ddf9cab 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -981,11 +981,12 @@ namespace
nTransparency defines minimal transparency level.
 */
 AlphaMask ProcessAndBlurAlphaMask(const Bitmap& rMask, double 
fErodeDilateRadius,
-  double fBlurRadius, sal_uInt8 nTransparency)
+  double fBlurRadius, sal_uInt8 nTransparency,
+  bool bConvertTo1Bit = true)
 {
 // Only completely white pixels on the initial mask must be considered for 
transparency. Any
 // other color must be treated as black. This creates 1-bit B bitmap.
-BitmapEx mask(rMask.CreateMask(COL_WHITE));
+BitmapEx mask(bConvertTo1Bit ? rMask.CreateMask(COL_WHITE) : rMask);
 
 // Scaling down increases performance without noticeable quality loss. 
Additionally,
 // current blur implementation can only handle blur radius between 2 and 
254.
@@ -1177,7 +1178,7 @@ void VclPixelProcessor2D::processShadowPrimitive2D(const 
primitive2d::ShadowPrim
 
 BitmapEx bitmapEx = mpOutputDevice->GetBitmapEx(aRect.TopLeft(), 
aRect.GetSize());
 
-AlphaMask mask = ProcessAndBlurAlphaMask(bitmapEx.GetAlpha(), 0, 
fBlurRadius, 0);
+AlphaMask mask = ProcessAndBlurAlphaMask(bitmapEx.GetAlpha(), 0, 
fBlurRadius, 0, false);
 
 const basegfx::BColor aShadowColor(
 
maBColorModifierStack.getModifiedColor(rCandidate.getShadowColor()));


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - oox/source sd/qa

2022-04-13 Thread Gülşah Köse (via logerrit)
 oox/source/drawingml/table/tablecell.cxx |   10 +-
 oox/source/export/shapes.cxx |6 ++
 sd/qa/unit/export-tests.cxx  |3 ++-
 sd/qa/unit/import-tests.cxx  |2 +-
 4 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 6bf805ffb62a13f2f44a26f47f732f05c954ef49
Author: Gülşah Köse 
AuthorDate: Mon Mar 14 14:52:59 2022 +0300
Commit: Gülşah Köse 
CommitDate: Wed Apr 13 08:26:30 2022 +0200

tdf#147766 Export empty lines as line with noFill

We have a case that 0 width line but has auto color. If that case
exported there is no line over there, LO handles normally but MSO draws
back borders as default. To prevent this we have to export them as line
with noFill.

testTableBorderLineStyle change reverts a workaround for
3faf005a367cbd28077403bf93810bbaf4805851

testBnc480256 Cell(1,0) still invisible. We are just checking
this with another way.

Change-Id: If5f6d2dbdba5c295d58307fcfe3b37629ede8a8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131532
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Gülşah Köse 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132886

diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index 15ab06303e3b..fdf7950dcf2c 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -73,20 +73,12 @@ static void applyLineAttributes( const 
::oox::core::XmlFilterBase& rFilterBase,
 aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 2 );
 aBorderLine.LineDistance = 0;
 }
-else if ( rLineProperties.moLineWidth.get(0)!=0 )
-{
-aBorderLine.Color = sal_Int32( COL_AUTO );
-aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 4 );
-aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 4 );
-aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 2 );
-aBorderLine.LineDistance = 0;
-}
 else
 {
 aBorderLine.Color = sal_Int32( COL_AUTO );
 aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 4 );
 aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 4 );
-aBorderLine.LineWidth = 12700;
+aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 2 );
 aBorderLine.LineDistance = 0;
 }
 
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 138106938ee2..97d09ca1be2e 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1975,6 +1975,12 @@ void ShapeExport::WriteBorderLine(const sal_Int32 
XML_line, const BorderLine2& r
 DrawingML::WriteSolidFill( ::Color(ColorTransparency, 
rBorderLine.Color) );
 mpFS->endElementNS( XML_a, XML_line );
 }
+else if( nBorderWidth == 0)
+{
+mpFS->startElementNS(XML_a, XML_line);
+mpFS->singleElementNS(XML_a, XML_noFill);
+mpFS->endElementNS( XML_a, XML_line );
+}
 }
 
 void ShapeExport::WriteTableCellBorders(const Reference< XPropertySet>& 
xCellPropSet)
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index f1d0281aab0d..729d9f154b12 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -602,9 +602,10 @@ void SdExportTest::testBnc480256()
 xCell->getPropertyValue("FillColor") >>= nColor;
 CPPUNIT_ASSERT_EQUAL(Color(0x4697e0), nColor);
 
+// This border should be invisible.
 xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW);
 xCell->getPropertyValue("BottomBorder") >>= aBorderLine;
-CPPUNIT_ASSERT_EQUAL(COL_AUTO, Color(ColorTransparency, 
aBorderLine.Color));
+CPPUNIT_ASSERT_EQUAL(sal_Int32(0), sal_Int32(aBorderLine.LineWidth));
 
 xDocShRef->DoClose();
 }
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index c7b508de5dc3..e49892d3a738 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -1474,7 +1474,7 @@ void SdImportTest::testTableBorderLineStyle()
 xTable.set(pTableObj->getTable(), uno::UNO_QUERY_THROW);
 xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
 xCell->getPropertyValue("TopBorder") >>= aBorderLine;
-if (aBorderLine.Color != -1) {
+if (aBorderLine.LineWidth > 0) {
 CPPUNIT_ASSERT_EQUAL(nObjBorderLineStyles[i], 
aBorderLine.LineStyle);
 }
 }


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - oox/inc oox/source sd/qa

2022-04-13 Thread Gülşah Köse (via logerrit)
 oox/inc/drawingml/table/tablecell.hxx  |2 
 oox/source/drawingml/table/tablecell.cxx   |  112 +++--
 oox/source/drawingml/table/tableproperties.cxx |   16 ++-
 sd/qa/unit/data/pptx/bnc480256-2.pptx  |binary
 sd/qa/unit/data/pptx/tdf135843_insideH.pptx|binary
 sd/qa/unit/import-tests.cxx|2 
 sd/qa/unit/layout-tests.cxx|   38 
 7 files changed, 158 insertions(+), 12 deletions(-)

New commits:
commit d2a2d16b4836bf62db7c32faffa0c5b6d0d30a5e
Author: Gülşah Köse 
AuthorDate: Mon Apr 11 18:33:30 2022 +0300
Commit: Gülşah Köse 
CommitDate: Wed Apr 13 08:25:46 2022 +0200

Revert "Revert "tdf#135843 Implement inside horizontal vertical borders.""

This reverts commit ea5a3e0247b1230c1fe7e2cb0afc597e56d0b4c2.

Change-Id: Ibd333c1e7b1530a2b6d9b8c5efbf4d9c822fa058
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132885
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/oox/inc/drawingml/table/tablecell.hxx 
b/oox/inc/drawingml/table/tablecell.hxx
index d6e91da042f7..988b0d057a13 100644
--- a/oox/inc/drawingml/table/tablecell.hxx
+++ b/oox/inc/drawingml/table/tablecell.hxx
@@ -82,6 +82,8 @@ private:
 oox::drawingml::LineProperties  maLinePropertiesRight;
 oox::drawingml::LineProperties  maLinePropertiesTop;
 oox::drawingml::LineProperties  maLinePropertiesBottom;
+oox::drawingml::LineProperties  maLinePropertiesInsideH;
+oox::drawingml::LineProperties  maLinePropertiesInsideV;
 oox::drawingml::LineProperties  maLinePropertiesTopLeftToBottomRight;
 oox::drawingml::LineProperties  maLinePropertiesBottomLeftToTopRight;
 
diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index e5ab3372d42e..15ab06303e3b 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -81,6 +81,14 @@ static void applyLineAttributes( const 
::oox::core::XmlFilterBase& rFilterBase,
 aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 2 );
 aBorderLine.LineDistance = 0;
 }
+else
+{
+aBorderLine.Color = sal_Int32( COL_AUTO );
+aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 4 );
+aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 4 );
+aBorderLine.LineWidth = 12700;
+aBorderLine.LineDistance = 0;
+}
 
 if ( rLineProperties.moPresetDash.has() )
 {
@@ -150,9 +158,16 @@ static void applyTableStylePart( const 
::oox::core::XmlFilterBase& rFilterBase,
   oox::drawingml::LineProperties& rRightBorder,
   oox::drawingml::LineProperties& rTopBorder,
   oox::drawingml::LineProperties& rBottomBorder,
+  oox::drawingml::LineProperties& rInsideHBorder,
+  oox::drawingml::LineProperties& rInsideVBorder,
   oox::drawingml::LineProperties& 
rTopLeftToBottomRightBorder,
   oox::drawingml::LineProperties& 
rBottomLeftToTopRightBorder,
-  TableStylePart& rTableStylePart )
+  TableStylePart& rTableStylePart,
+  bool bIsWholeTable = false,
+  sal_Int32 nCol = 0,
+  sal_Int32 nMaxCol = 0,
+  sal_Int32 nRow = 0,
+  sal_Int32 nMaxRow = 0)
 {
 ::oox::drawingml::FillPropertiesPtr& rPartFillPropertiesPtr( 
rTableStylePart.getFillProperties() );
 if ( rPartFillPropertiesPtr )
@@ -169,12 +184,35 @@ static void applyTableStylePart( const 
::oox::core::XmlFilterBase& rFilterBase,
 }
 }
 
-applyBorder( rFilterBase, rTableStylePart, XML_left, rLeftBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_right, rRightBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_top, rTopBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_bottom, rBottomBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_tl2br, 
rTopLeftToBottomRightBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_tr2bl, 
rBottomLeftToTopRightBorder );
+// Left, right, top and bottom side of the whole table should be mean 
outer frame of the whole table.
+// Without this check it means left top right and bottom of whole cells of 
whole table.
+if (bIsWholeTable)
+{
+if (nCol == 0)
+applyBorder( rFilterBase, rTableStylePart, XML_left, rLeftBorder );
+if (nCol == nMaxCol)
+applyBorder( rFilterBase, rTableStylePart, XML_right, rRightBorder 
);
+if (nRow == 0)
+applyBorder( rFilterBase, rTableStylePart, XML_top, rTopBorder );
+  

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sd/qa sd/source

2022-03-25 Thread Gülşah Köse (via logerrit)
 sd/qa/unit/data/pptx/deftabstop.pptx |binary
 sd/qa/unit/import-tests2.cxx |   14 ++
 sd/source/ui/docshell/docshel4.cxx   |   12 
 3 files changed, 26 insertions(+)

New commits:
commit 0d65d4c6b7272f4ca8e413e025db234e5c8c7722
Author: Gülşah Köse 
AuthorDate: Thu Mar 24 11:19:03 2022 +0300
Commit: Gülşah Köse 
CommitDate: Fri Mar 25 12:57:46 2022 +0100

tdf#96389 Use default tab stop value of MSO for pptx import.

Change-Id: Ib3dde68c672b44d8b60f121fb0e637942b5986b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131698
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132103

diff --git a/sd/qa/unit/data/pptx/deftabstop.pptx 
b/sd/qa/unit/data/pptx/deftabstop.pptx
new file mode 100644
index ..5cfe71794446
Binary files /dev/null and b/sd/qa/unit/data/pptx/deftabstop.pptx differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index b62573ec354b..3ecbec200c6e 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -172,6 +172,7 @@ public:
 void testTdf103347();
 void testHyperlinksOnShapes();
 void testTdf112209();
+void testDefaultTabStop();
 
 CPPUNIT_TEST_SUITE(SdImportTest2);
 
@@ -236,6 +237,7 @@ public:
 CPPUNIT_TEST(testTdf103347);
 CPPUNIT_TEST(testHyperlinksOnShapes);
 CPPUNIT_TEST(testTdf112209);
+CPPUNIT_TEST(testDefaultTabStop);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -1934,6 +1936,18 @@ void SdImportTest2::testTdf112209()
 xDocShRef->DoClose();
 }
 
+void SdImportTest2::testDefaultTabStop()
+{
+sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/deftabstop.pptx"), 
PPTX);
+SdDrawDocument* pDoc = xDocShRef->GetDoc();
+sal_Int32 nDefTab = pDoc->GetDefaultTabulator();
+
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2540), nDefTab);
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/ui/docshell/docshel4.cxx 
b/sd/source/ui/docshell/docshel4.cxx
index 622d35c7f1eb..b57b06bce617 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -399,6 +399,18 @@ bool DrawDocShell::ImportFrom(SfxMedium ,
 mpDoc->SetSummationOfParagraphs();
 }
 
+if (aFilterName == "Impress MS PowerPoint 2007 XML" ||
+aFilterName == "Impress MS PowerPoint 2007 XML AutoPlay" ||
+aFilterName == "Impress MS PowerPoint 2007 XML VBA" ||
+aFilterName == "Impress Office Open XML")
+{
+// We need to be able to set the default tab size for each text object.
+// This is possible at the moment only for the whole document. See
+// TextParagraphPropertiesContext constructor. So default tab width
+// of the LibreOffice is 1270 but MSO is 2540 on general settings.
+mpDoc->SetDefaultTabulator( 2540 );
+}
+
 const bool bRet = SfxObjectShell::ImportFrom(rMedium, xInsertPosition);
 
 SfxItemSet* pSet = rMedium.GetItemSet();


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

2022-03-25 Thread Gülşah Köse (via logerrit)
 sd/qa/unit/data/pptx/deftabstop.pptx |binary
 sd/qa/unit/import-tests2.cxx |   14 ++
 sd/source/ui/docshell/docshel4.cxx   |   12 
 3 files changed, 26 insertions(+)

New commits:
commit 362fb6c7b13d5506c6bd9d1b7f113ec45544809d
Author: Gülşah Köse 
AuthorDate: Thu Mar 24 11:19:03 2022 +0300
Commit: Gülşah Köse 
CommitDate: Fri Mar 25 08:25:49 2022 +0100

tdf#96389 Use default tab stop value of MSO for pptx import.

Change-Id: Ib3dde68c672b44d8b60f121fb0e637942b5986b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131698
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/sd/qa/unit/data/pptx/deftabstop.pptx 
b/sd/qa/unit/data/pptx/deftabstop.pptx
new file mode 100644
index ..5cfe71794446
Binary files /dev/null and b/sd/qa/unit/data/pptx/deftabstop.pptx differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 2654e6f6290e..7a67debd38d9 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -129,6 +129,7 @@ public:
 void testHyperlinksOnShapes();
 void testTdf112209();
 void testTdf128596();
+void testDefaultTabStop();
 
 CPPUNIT_TEST_SUITE(SdImportTest2);
 
@@ -194,6 +195,7 @@ public:
 CPPUNIT_TEST(testHyperlinksOnShapes);
 CPPUNIT_TEST(testTdf112209);
 CPPUNIT_TEST(testTdf128596);
+CPPUNIT_TEST(testDefaultTabStop);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -1907,6 +1909,18 @@ void SdImportTest2::testTdf128596()
 xDocShRef->DoClose();
 }
 
+void SdImportTest2::testDefaultTabStop()
+{
+sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/deftabstop.pptx"), 
PPTX);
+SdDrawDocument* pDoc = xDocShRef->GetDoc();
+sal_Int32 nDefTab = pDoc->GetDefaultTabulator();
+
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2540), nDefTab);
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/ui/docshell/docshel4.cxx 
b/sd/source/ui/docshell/docshel4.cxx
index bed18cbddf70..6150321ca33a 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -399,6 +399,18 @@ bool DrawDocShell::ImportFrom(SfxMedium ,
 mpDoc->SetSummationOfParagraphs();
 }
 
+if (aFilterName == "Impress MS PowerPoint 2007 XML" ||
+aFilterName == "Impress MS PowerPoint 2007 XML AutoPlay" ||
+aFilterName == "Impress MS PowerPoint 2007 XML VBA" ||
+aFilterName == "Impress Office Open XML")
+{
+// We need to be able to set the default tab size for each text object.
+// This is possible at the moment only for the whole document. See
+// TextParagraphPropertiesContext constructor. So default tab width
+// of the LibreOffice is 1270 but MSO is 2540 on general settings.
+mpDoc->SetDefaultTabulator( 2540 );
+}
+
 const bool bRet = SfxObjectShell::ImportFrom(rMedium, xInsertPosition);
 
 SfxItemSet* pSet = rMedium.GetItemSet();


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

2022-03-17 Thread Gülşah Köse (via logerrit)
 oox/source/drawingml/table/tablecell.cxx |   10 +-
 oox/source/export/shapes.cxx |6 ++
 sd/qa/unit/export-tests.cxx  |3 ++-
 sd/qa/unit/import-tests.cxx  |2 +-
 4 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit f8ac4be066b9277cf2f893b581adc33de841bb9e
Author: Gülşah Köse 
AuthorDate: Mon Mar 14 14:52:59 2022 +0300
Commit: Gülşah Köse 
CommitDate: Thu Mar 17 08:05:06 2022 +0100

tdf#147766 Export empty lines as line with noFill

We have a case that 0 width line but has auto color. If that case
exported there is no line over there, LO handles normally but MSO draws
back borders as default. To prevent this we have to export them as line
with noFill.

testTableBorderLineStyle change reverts a workaround for
3faf005a367cbd28077403bf93810bbaf4805851

testBnc480256 Cell(1,0) still invisible. We are just checking
this with another way.

Change-Id: If5f6d2dbdba5c295d58307fcfe3b37629ede8a8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131532
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Gülşah Köse 

diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index 15ab06303e3b..fdf7950dcf2c 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -73,20 +73,12 @@ static void applyLineAttributes( const 
::oox::core::XmlFilterBase& rFilterBase,
 aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 2 );
 aBorderLine.LineDistance = 0;
 }
-else if ( rLineProperties.moLineWidth.get(0)!=0 )
-{
-aBorderLine.Color = sal_Int32( COL_AUTO );
-aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 4 );
-aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 4 );
-aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 2 );
-aBorderLine.LineDistance = 0;
-}
 else
 {
 aBorderLine.Color = sal_Int32( COL_AUTO );
 aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 4 );
 aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 4 );
-aBorderLine.LineWidth = 12700;
+aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 2 );
 aBorderLine.LineDistance = 0;
 }
 
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 719836e77b70..04e65e013608 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1995,6 +1995,12 @@ void ShapeExport::WriteBorderLine(const sal_Int32 
XML_line, const BorderLine2& r
 DrawingML::WriteSolidFill( ::Color(ColorTransparency, 
rBorderLine.Color) );
 mpFS->endElementNS( XML_a, XML_line );
 }
+else if( nBorderWidth == 0)
+{
+mpFS->startElementNS(XML_a, XML_line);
+mpFS->singleElementNS(XML_a, XML_noFill);
+mpFS->endElementNS( XML_a, XML_line );
+}
 }
 
 void ShapeExport::WriteTableCellBorders(const Reference< XPropertySet>& 
xCellPropSet)
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index fd2380af5cf9..be1b2d08c6ab 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -602,9 +602,10 @@ void SdExportTest::testBnc480256()
 xCell->getPropertyValue("FillColor") >>= nColor;
 CPPUNIT_ASSERT_EQUAL(Color(0x4697e0), nColor);
 
+// This border should be invisible.
 xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW);
 xCell->getPropertyValue("BottomBorder") >>= aBorderLine;
-CPPUNIT_ASSERT_EQUAL(COL_AUTO, Color(ColorTransparency, 
aBorderLine.Color));
+CPPUNIT_ASSERT_EQUAL(sal_Int32(0), sal_Int32(aBorderLine.LineWidth));
 
 xDocShRef->DoClose();
 }
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 26abc2ece38c..215d668b2f3f 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -1456,7 +1456,7 @@ void SdImportTest::testTableBorderLineStyle()
 xTable.set(pTableObj->getTable(), uno::UNO_QUERY_THROW);
 xCell.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW);
 xCell->getPropertyValue("TopBorder") >>= aBorderLine;
-if (aBorderLine.Color != -1) {
+if (aBorderLine.LineWidth > 0) {
 CPPUNIT_ASSERT_EQUAL(nObjBorderLineStyles[i], 
aBorderLine.LineStyle);
 }
 }


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - oox/inc oox/source sd/qa

2022-03-03 Thread Gülşah Köse (via logerrit)
 oox/inc/drawingml/table/tablecell.hxx  |2 
 oox/source/drawingml/table/tablecell.cxx   |  112 +++--
 oox/source/drawingml/table/tableproperties.cxx |   16 ++-
 sd/qa/unit/data/pptx/bnc480256-2.pptx  |binary
 sd/qa/unit/data/pptx/tdf135843_insideH.pptx|binary
 sd/qa/unit/import-tests.cxx|2 
 sd/qa/unit/layout-tests.cxx|   38 
 7 files changed, 158 insertions(+), 12 deletions(-)

New commits:
commit 90f19b66d81b0a4958cacc40d2be0516f281d702
Author: Gülşah Köse 
AuthorDate: Tue Feb 1 16:03:14 2022 +0300
Commit: Gülşah Köse 
CommitDate: Fri Mar 4 08:28:14 2022 +0100

tdf#135843 Implement inside horizontal vertical borders.

wholeTbl as TableStylePart should be handled in different way. Before
left border of the whole table was handling like all cells left
border but it should be left border of the first column.

insideV and and insideH properties are imported but never handled. I
added the inside vertical and horizontal borders handling.

Change-Id: I5aea5cbefc746db637eac6c1438fa70a7d741bc0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128971
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
(cherry picked from commit 3faf005a367cbd28077403bf93810bbaf4805851)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130860

diff --git a/oox/inc/drawingml/table/tablecell.hxx 
b/oox/inc/drawingml/table/tablecell.hxx
index d6e91da042f7..988b0d057a13 100644
--- a/oox/inc/drawingml/table/tablecell.hxx
+++ b/oox/inc/drawingml/table/tablecell.hxx
@@ -82,6 +82,8 @@ private:
 oox::drawingml::LineProperties  maLinePropertiesRight;
 oox::drawingml::LineProperties  maLinePropertiesTop;
 oox::drawingml::LineProperties  maLinePropertiesBottom;
+oox::drawingml::LineProperties  maLinePropertiesInsideH;
+oox::drawingml::LineProperties  maLinePropertiesInsideV;
 oox::drawingml::LineProperties  maLinePropertiesTopLeftToBottomRight;
 oox::drawingml::LineProperties  maLinePropertiesBottomLeftToTopRight;
 
diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index e5ab3372d42e..15ab06303e3b 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -81,6 +81,14 @@ static void applyLineAttributes( const 
::oox::core::XmlFilterBase& rFilterBase,
 aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 2 );
 aBorderLine.LineDistance = 0;
 }
+else
+{
+aBorderLine.Color = sal_Int32( COL_AUTO );
+aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 4 );
+aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 4 );
+aBorderLine.LineWidth = 12700;
+aBorderLine.LineDistance = 0;
+}
 
 if ( rLineProperties.moPresetDash.has() )
 {
@@ -150,9 +158,16 @@ static void applyTableStylePart( const 
::oox::core::XmlFilterBase& rFilterBase,
   oox::drawingml::LineProperties& rRightBorder,
   oox::drawingml::LineProperties& rTopBorder,
   oox::drawingml::LineProperties& rBottomBorder,
+  oox::drawingml::LineProperties& rInsideHBorder,
+  oox::drawingml::LineProperties& rInsideVBorder,
   oox::drawingml::LineProperties& 
rTopLeftToBottomRightBorder,
   oox::drawingml::LineProperties& 
rBottomLeftToTopRightBorder,
-  TableStylePart& rTableStylePart )
+  TableStylePart& rTableStylePart,
+  bool bIsWholeTable = false,
+  sal_Int32 nCol = 0,
+  sal_Int32 nMaxCol = 0,
+  sal_Int32 nRow = 0,
+  sal_Int32 nMaxRow = 0)
 {
 ::oox::drawingml::FillPropertiesPtr& rPartFillPropertiesPtr( 
rTableStylePart.getFillProperties() );
 if ( rPartFillPropertiesPtr )
@@ -169,12 +184,35 @@ static void applyTableStylePart( const 
::oox::core::XmlFilterBase& rFilterBase,
 }
 }
 
-applyBorder( rFilterBase, rTableStylePart, XML_left, rLeftBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_right, rRightBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_top, rTopBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_bottom, rBottomBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_tl2br, 
rTopLeftToBottomRightBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_tr2bl, 
rBottomLeftToTopRightBorder );
+// Left, right, top and bottom side of the whole table should be mean 
outer frame of the whole table.
+// Without this check it means left top right and 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - oox/source

2022-03-03 Thread Gülşah Köse (via logerrit)
 oox/source/drawingml/table/predefined-table-styles.cxx |  378 +++--
 1 file changed, 176 insertions(+), 202 deletions(-)

New commits:
commit 96694528f3f4212070c90e8d61366bbbe35e991a
Author: Gülşah Köse 
AuthorDate: Mon Jan 31 18:34:30 2022 +0300
Commit: Gülşah Köse 
CommitDate: Fri Mar 4 08:27:39 2022 +0100

tdf#135843 Do not export unused border lines.

Setting as XML_solidFill all borders caused wrong exported borders.
All table parts aren't used for all table styles. We should set borderline
if only they had used.

Change-Id: I35b247f520c7d7862599ade2c6fdfb0d7efcd5c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129227
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
(cherry picked from commit 48575b3eb856406d9de406cb1d2de23866b0178f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130859

diff --git a/oox/source/drawingml/table/predefined-table-styles.cxx 
b/oox/source/drawingml/table/predefined-table-styles.cxx
index 75435eb40303..273cf7d68a5a 100644
--- a/oox/source/drawingml/table/predefined-table-styles.cxx
+++ b/oox/source/drawingml/table/predefined-table-styles.cxx
@@ -202,6 +202,21 @@ static std::map tokens = { { "", 
XML_dk1 },
 { "Accent5", XML_accent5 },
 { "Accent6", XML_accent6 } };
 
+void setBorderLineType(oox::drawingml::LinePropertiesPtr& pLineProp, sal_Int32 
nToken)
+{
+pLineProp->maLineFill.moFillType.set(nToken);
+}
+
+void insertBorderLine(TableStylePart& aTableStylePart, sal_Int32 nToken,
+  oox::drawingml::LinePropertiesPtr pLineProp)
+{
+if (pLineProp->maLineFill.moFillType.has())
+{
+aTableStylePart.getLineBorders().insert(
+std::pair(nToken, 
pLineProp));
+}
+}
+
 std::unique_ptr CreateTableStyle(const OUString& styleId)
 {
 createStyleIdMap();
@@ -377,69 +392,6 @@ std::unique_ptr CreateTableStyle(const 
OUString& styleId)
 pBand2HFillProperties->moFillType.set(XML_solidFill);
 pBand2VFillProperties->moFillType.set(XML_solidFill);
 
-pWholeTblLeftBorder->maLineFill.moFillType.set(XML_solidFill);
-pWholeTblRightBorder->maLineFill.moFillType.set(XML_solidFill);
-pWholeTblTopBorder->maLineFill.moFillType.set(XML_solidFill);
-pWholeTblBottomBorder->maLineFill.moFillType.set(XML_solidFill);
-pWholeTblInsideHBorder->maLineFill.moFillType.set(XML_solidFill);
-pWholeTblInsideVBorder->maLineFill.moFillType.set(XML_solidFill);
-
-pFirstRowLeftBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstRowRightBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstRowTopBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstRowBottomBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstRowInsideHBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstRowInsideVBorder->maLineFill.moFillType.set(XML_solidFill);
-
-pFirstColLeftBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstColRightBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstColTopBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstColBottomBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstColInsideHBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstColInsideVBorder->maLineFill.moFillType.set(XML_solidFill);
-
-pLastRowLeftBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastRowRightBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastRowTopBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastRowBottomBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastRowInsideHBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastRowInsideVBorder->maLineFill.moFillType.set(XML_solidFill);
-
-pLastColLeftBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastColRightBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastColTopBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastColBottomBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastColInsideHBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastColInsideVBorder->maLineFill.moFillType.set(XML_solidFill);
-
-pBand1HLeftBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1HRightBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1HTopBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1HBottomBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1HInsideHBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1HInsideVBorder->maLineFill.moFillType.set(XML_solidFill);
-
-pBand1VLeftBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1VRightBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1VTopBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1VBottomBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1VInsideHBorder->maLineFill.moFillType.set(XML_solidFill);
-

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

2022-03-02 Thread Gülşah Köse (via logerrit)
 oox/inc/drawingml/table/tablecell.hxx  |2 
 oox/source/drawingml/table/tablecell.cxx   |  112 +++--
 oox/source/drawingml/table/tableproperties.cxx |   16 ++-
 sd/qa/unit/data/pptx/bnc480256-2.pptx  |binary
 sd/qa/unit/data/pptx/tdf135843_insideH.pptx|binary
 sd/qa/unit/import-tests.cxx|2 
 sd/qa/unit/layout-tests.cxx|   38 
 7 files changed, 158 insertions(+), 12 deletions(-)

New commits:
commit 3faf005a367cbd28077403bf93810bbaf4805851
Author: Gülşah Köse 
AuthorDate: Tue Feb 1 16:03:14 2022 +0300
Commit: Gülşah Köse 
CommitDate: Wed Mar 2 11:57:25 2022 +0100

tdf#135843 Implement inside horizontal vertical borders.

wholeTbl as TableStylePart should be handled in different way. Before
left border of the whole table was handling like all cells left
border but it should be left border of the first column.

insideV and and insideH properties are imported but never handled. I
added the inside vertical and horizontal borders handling.

Change-Id: I5aea5cbefc746db637eac6c1438fa70a7d741bc0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128971
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/oox/inc/drawingml/table/tablecell.hxx 
b/oox/inc/drawingml/table/tablecell.hxx
index d6e91da042f7..988b0d057a13 100644
--- a/oox/inc/drawingml/table/tablecell.hxx
+++ b/oox/inc/drawingml/table/tablecell.hxx
@@ -82,6 +82,8 @@ private:
 oox::drawingml::LineProperties  maLinePropertiesRight;
 oox::drawingml::LineProperties  maLinePropertiesTop;
 oox::drawingml::LineProperties  maLinePropertiesBottom;
+oox::drawingml::LineProperties  maLinePropertiesInsideH;
+oox::drawingml::LineProperties  maLinePropertiesInsideV;
 oox::drawingml::LineProperties  maLinePropertiesTopLeftToBottomRight;
 oox::drawingml::LineProperties  maLinePropertiesBottomLeftToTopRight;
 
diff --git a/oox/source/drawingml/table/tablecell.cxx 
b/oox/source/drawingml/table/tablecell.cxx
index e5ab3372d42e..15ab06303e3b 100644
--- a/oox/source/drawingml/table/tablecell.cxx
+++ b/oox/source/drawingml/table/tablecell.cxx
@@ -81,6 +81,14 @@ static void applyLineAttributes( const 
::oox::core::XmlFilterBase& rFilterBase,
 aBorderLine.LineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 2 );
 aBorderLine.LineDistance = 0;
 }
+else
+{
+aBorderLine.Color = sal_Int32( COL_AUTO );
+aBorderLine.OuterLineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 4 );
+aBorderLine.InnerLineWidth = static_cast< sal_Int16 >( GetCoordinate( 
rLineProperties.moLineWidth.get( 0 ) ) / 4 );
+aBorderLine.LineWidth = 12700;
+aBorderLine.LineDistance = 0;
+}
 
 if ( rLineProperties.moPresetDash.has() )
 {
@@ -150,9 +158,16 @@ static void applyTableStylePart( const 
::oox::core::XmlFilterBase& rFilterBase,
   oox::drawingml::LineProperties& rRightBorder,
   oox::drawingml::LineProperties& rTopBorder,
   oox::drawingml::LineProperties& rBottomBorder,
+  oox::drawingml::LineProperties& rInsideHBorder,
+  oox::drawingml::LineProperties& rInsideVBorder,
   oox::drawingml::LineProperties& 
rTopLeftToBottomRightBorder,
   oox::drawingml::LineProperties& 
rBottomLeftToTopRightBorder,
-  TableStylePart& rTableStylePart )
+  TableStylePart& rTableStylePart,
+  bool bIsWholeTable = false,
+  sal_Int32 nCol = 0,
+  sal_Int32 nMaxCol = 0,
+  sal_Int32 nRow = 0,
+  sal_Int32 nMaxRow = 0)
 {
 ::oox::drawingml::FillPropertiesPtr& rPartFillPropertiesPtr( 
rTableStylePart.getFillProperties() );
 if ( rPartFillPropertiesPtr )
@@ -169,12 +184,35 @@ static void applyTableStylePart( const 
::oox::core::XmlFilterBase& rFilterBase,
 }
 }
 
-applyBorder( rFilterBase, rTableStylePart, XML_left, rLeftBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_right, rRightBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_top, rTopBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_bottom, rBottomBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_tl2br, 
rTopLeftToBottomRightBorder );
-applyBorder( rFilterBase, rTableStylePart, XML_tr2bl, 
rBottomLeftToTopRightBorder );
+// Left, right, top and bottom side of the whole table should be mean 
outer frame of the whole table.
+// Without this check it means left top right and bottom of whole cells of 
whole table.
+if (bIsWholeTable)
+{
+if (nCol == 0)
+applyBorder( rFilterBase, 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - 6 commits - officecfg/registry readlicense_oo/docs readlicense_oo/license readlicense_oo/Package_files.mk sfx2/source sfx2/uiconfig

2022-02-13 Thread Gülşah Köse (via logerrit)
 officecfg/registry/data/org/openoffice/Office/Accelerators.xcu   |
6 
 officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu |
2 
 officecfg/registry/schema/org/openoffice/Office/Common.xcs   |
2 
 readlicense_oo/Package_files.mk  |
4 
 readlicense_oo/docs/readme.xrm   |  
196 --
 readlicense_oo/license/EULA.odt  
|binary
 readlicense_oo/license/EULA_en-US.rtf|  
105 +
 sfx2/source/appl/appserv.cxx |   
26 +
 sfx2/uiconfig/ui/licensedialog.ui|   
49 ++
 solenv/bin/modules/installer/environment.pm  |
2 
 solenv/bin/modules/installer/windows/idtglobal.pm|
2 
 11 files changed, 186 insertions(+), 208 deletions(-)

New commits:
commit d064ea3659198fcd914b6939ec1f31880ebe9809
Author: Gülşah Köse 
AuthorDate: Wed Sep 18 23:07:09 2019 +0300
Commit: Andras Timar 
CommitDate: Sun Feb 13 11:50:27 2022 +0100

[cp] add EULA button to Help - License Information... dialog

Forward port of acd8acfa89d9 from distro/collabora/cp-6.0
Rewritten for weld API

Change-Id: I62b9293c68059389a63e523ea5747fdb267b1a99
28a21f5831e0b2e99eb11f1c1ac2b8845c462669
Reviewed-on: https://gerrit.libreoffice.org/79110
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 107b8c1f749a..ccb93bfc4c6b 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -254,21 +254,43 @@ namespace
 
 class LicenseDialog : public weld::GenericDialogController
 {
+private:
+std::unique_ptr m_xBtnLicense;
+std::unique_ptr m_xBtnEula;
+
+DECL_LINK(EulaHdl, weld::Button&, void);
+DECL_LINK(LicenseHdl, weld::Button&, void);
+
 public:
 LicenseDialog(weld::Window* pParent)
 : GenericDialogController(pParent, "sfx/ui/licensedialog.ui",  
"LicenseDialog")
+, m_xBtnLicense(m_xBuilder->weld_button("license"))
+, m_xBtnEula(m_xBuilder->weld_button("eula"))
 {
+m_xBtnLicense->connect_clicked( LINK(this, LicenseDialog, 
LicenseHdl) );
+m_xBtnEula->connect_clicked( LINK(this, LicenseDialog, EulaHdl) );
 }
 
 virtual short run() override
 {
 short nRet = GenericDialogController::run();
-if (nRet == RET_OK)
-showDocument("LICENSE");
 return nRet;
 }
 };
 
+IMPL_LINK_NOARG(LicenseDialog, EulaHdl, weld::Button&, void)
+{
+response(RET_OK);
+showDocument("EULA.odt");
+}
+
+IMPL_LINK_NOARG(LicenseDialog, LicenseHdl, weld::Button&, void)
+{
+response(RET_OK);
+showDocument("LICENSE");
+}
+
+
 class SafeModeQueryDialog : public weld::MessageDialogController
 {
 public:
diff --git a/sfx2/uiconfig/ui/licensedialog.ui 
b/sfx2/uiconfig/ui/licensedialog.ui
index 71d504f9300d..a1d42e05dc7a 100644
--- a/sfx2/uiconfig/ui/licensedialog.ui
+++ b/sfx2/uiconfig/ui/licensedialog.ui
@@ -1,5 +1,5 @@
 
-
+
 
   
   
@@ -11,6 +11,9 @@
 0
 0
 dialog
+
+  
+
 
   
 False
@@ -21,7 +24,7 @@
 False
 end
 
-  
+  
 _Show License
 True
 True
@@ -36,6 +39,23 @@
 True
   
 
+
+  
+_EULA
+True
+True
+True
+True
+True
+True
+  
+  
+False
+True
+1
+True
+  
+
 
   
 _Close
@@ -50,7 +70,7 @@
   
 False
 True
-1
+2
   
 
   
@@ -61,6 +81,24 @@
 0
   
 
+
+  
+True
+False
+%PRODUCTNAME binary package is made available 
subject to the terms of the End User License and Subscription Agreement; choose 
EULA to see exact details in English.
+True
+True
+eula
+80
+0
+0
+  
+  
+False
+True
+0
+  
+
 
   
 True
@@ -88,11 +126,8 @@ This product was created by %OOOVENDOR, based on 
OpenOffice.org, which is Copyri
   
 
 
-  ok
+  license
   close
 
-
-  
-
   
 
commit 

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

2022-01-31 Thread Gülşah Köse (via logerrit)
 oox/source/drawingml/table/predefined-table-styles.cxx |  378 +++--
 1 file changed, 176 insertions(+), 202 deletions(-)

New commits:
commit 48575b3eb856406d9de406cb1d2de23866b0178f
Author: Gülşah Köse 
AuthorDate: Mon Jan 31 18:34:30 2022 +0300
Commit: Gülşah Köse 
CommitDate: Tue Feb 1 06:22:12 2022 +0100

tdf#135843 Do not export unused border lines.

Setting as XML_solidFill all borders caused wrong exported borders.
All table parts aren't used for all table styles. We should set borderline
if only they had used.

Change-Id: I35b247f520c7d7862599ade2c6fdfb0d7efcd5c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129227
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/oox/source/drawingml/table/predefined-table-styles.cxx 
b/oox/source/drawingml/table/predefined-table-styles.cxx
index 75435eb40303..273cf7d68a5a 100644
--- a/oox/source/drawingml/table/predefined-table-styles.cxx
+++ b/oox/source/drawingml/table/predefined-table-styles.cxx
@@ -202,6 +202,21 @@ static std::map tokens = { { "", 
XML_dk1 },
 { "Accent5", XML_accent5 },
 { "Accent6", XML_accent6 } };
 
+void setBorderLineType(oox::drawingml::LinePropertiesPtr& pLineProp, sal_Int32 
nToken)
+{
+pLineProp->maLineFill.moFillType.set(nToken);
+}
+
+void insertBorderLine(TableStylePart& aTableStylePart, sal_Int32 nToken,
+  oox::drawingml::LinePropertiesPtr pLineProp)
+{
+if (pLineProp->maLineFill.moFillType.has())
+{
+aTableStylePart.getLineBorders().insert(
+std::pair(nToken, 
pLineProp));
+}
+}
+
 std::unique_ptr CreateTableStyle(const OUString& styleId)
 {
 createStyleIdMap();
@@ -377,69 +392,6 @@ std::unique_ptr CreateTableStyle(const 
OUString& styleId)
 pBand2HFillProperties->moFillType.set(XML_solidFill);
 pBand2VFillProperties->moFillType.set(XML_solidFill);
 
-pWholeTblLeftBorder->maLineFill.moFillType.set(XML_solidFill);
-pWholeTblRightBorder->maLineFill.moFillType.set(XML_solidFill);
-pWholeTblTopBorder->maLineFill.moFillType.set(XML_solidFill);
-pWholeTblBottomBorder->maLineFill.moFillType.set(XML_solidFill);
-pWholeTblInsideHBorder->maLineFill.moFillType.set(XML_solidFill);
-pWholeTblInsideVBorder->maLineFill.moFillType.set(XML_solidFill);
-
-pFirstRowLeftBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstRowRightBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstRowTopBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstRowBottomBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstRowInsideHBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstRowInsideVBorder->maLineFill.moFillType.set(XML_solidFill);
-
-pFirstColLeftBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstColRightBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstColTopBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstColBottomBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstColInsideHBorder->maLineFill.moFillType.set(XML_solidFill);
-pFirstColInsideVBorder->maLineFill.moFillType.set(XML_solidFill);
-
-pLastRowLeftBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastRowRightBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastRowTopBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastRowBottomBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastRowInsideHBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastRowInsideVBorder->maLineFill.moFillType.set(XML_solidFill);
-
-pLastColLeftBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastColRightBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastColTopBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastColBottomBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastColInsideHBorder->maLineFill.moFillType.set(XML_solidFill);
-pLastColInsideVBorder->maLineFill.moFillType.set(XML_solidFill);
-
-pBand1HLeftBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1HRightBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1HTopBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1HBottomBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1HInsideHBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1HInsideVBorder->maLineFill.moFillType.set(XML_solidFill);
-
-pBand1VLeftBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1VRightBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1VTopBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1VBottomBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1VInsideHBorder->maLineFill.moFillType.set(XML_solidFill);
-pBand1VInsideVBorder->maLineFill.moFillType.set(XML_solidFill);
-
-pBand2HLeftBorder->maLineFill.moFillType.set(XML_solidFill);
-

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3-0' - svx/source

2022-01-20 Thread Gülşah Köse (via logerrit)
 svx/source/dialog/framelinkarray.cxx   |   12 ++--
 svx/source/table/viewcontactoftableobj.cxx |4 ++--
 2 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 2b819b95f52fa324dff335130f2693ca2327
Author: Gülşah Köse 
AuthorDate: Mon Jan 17 10:17:42 2022 +0300
Commit: Michael Stahl 
CommitDate: Thu Jan 20 11:18:16 2022 +0100

tdf#135843 tdf#146731 Fix the missing border handling

Reverts fa5ab8aa5d88e7128015127af75980a65f945cbb inside. And fix the
missing border problem with better way. Reason of the problem is using
ORIGCELL cell style for bottom and right of merged ranges is wrong.

Eg: We have Row X Col 3X3 table. (0,1) and (0,2) merged. The right side
of right border style should be same with (0,2). But ORIGCELL points (0,1)
instead. In case we should use LASTCELL. Same reason is valid for bottom 
case.

Change-Id: I5282083541f0bd02f3765943da4f34cabe05ef13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128493
Reviewed-by: Gülşah Köse 
Tested-by: Gülşah Köse 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128498
Tested-by: Jenkins
(cherry picked from commit 58c1afd0590463177de83a90a848a83d0cfcc058)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128532
Reviewed-by: Adolfo Jayme Barrientos 
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/svx/source/dialog/framelinkarray.cxx 
b/svx/source/dialog/framelinkarray.cxx
index 16f6c09e8d91..62967b620387 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ b/svx/source/dialog/framelinkarray.cxx
@@ -260,6 +260,7 @@ struct ArrayImpl
 size_t  GetMergedLastRow( size_t nCol, size_t nRow ) const;
 
 const Cell& GetMergedOriginCell( size_t nCol, size_t nRow ) const;
+const Cell& GetMergedLastCell( size_t nCol, size_t nRow ) const;
 
 boolIsMergedOverlappedLeft( size_t nCol, size_t nRow ) 
const;
 boolIsMergedOverlappedRight( size_t nCol, size_t nRow ) 
const;
@@ -343,6 +344,11 @@ const Cell& ArrayImpl::GetMergedOriginCell( size_t nCol, 
size_t nRow ) const
 return GetCell( GetMergedFirstCol( nCol, nRow ), GetMergedFirstRow( nCol, 
nRow ) );
 }
 
+const Cell& ArrayImpl::GetMergedLastCell( size_t nCol, size_t nRow ) const
+{
+return GetCell( GetMergedLastCol( nCol, nRow ), GetMergedLastRow( nCol, 
nRow ) );
+}
+
 bool ArrayImpl::IsMergedOverlappedLeft( size_t nCol, size_t nRow ) const
 {
 const Cell& rCell = GetCell( nCol, nRow );
@@ -486,6 +492,7 @@ MergedCellIterator& MergedCellIterator::operator++()
 #define CELL( col, row )mxImpl->GetCell( col, row )
 #define CELLACC( col, row ) mxImpl->GetCellAcc( col, row )
 #define ORIGCELL( col, row )mxImpl->GetMergedOriginCell( col, row )
+#define LASTCELL( col, row )mxImpl->GetMergedLastCell( col, row )
 
 
 Array::Array()
@@ -653,7 +660,7 @@ const Style& Array::GetCellStyleRight( size_t nCol, size_t 
nRow ) const
 return ORIGCELL( nCol + 1, nRow ).GetStyleLeft();
 // right clipping border: always own right style
 if( nCol == mxImpl->mnLastClipCol )
-return ORIGCELL( nCol, nRow ).GetStyleRight();
+return LASTCELL( nCol, nRow ).GetStyleRight();
 // outside clipping columns: invisible
 if( !mxImpl->IsColInClipRange( nCol ) )
 return OBJ_STYLE_NONE;
@@ -689,7 +696,7 @@ const Style& Array::GetCellStyleBottom( size_t nCol, size_t 
nRow ) const
 return ORIGCELL( nCol, nRow + 1 ).GetStyleTop();
 // bottom clipping border: always own bottom style
 if( nRow == mxImpl->mnLastClipRow )
-return ORIGCELL( nCol, nRow ).GetStyleBottom();
+return LASTCELL( nCol, nRow ).GetStyleBottom();
 // outside clipping rows: invisible
 if( !mxImpl->IsRowInClipRange( nRow ) )
 return OBJ_STYLE_NONE;
@@ -1519,6 +1526,7 @@ drawinglayer::primitive2d::Primitive2DContainer 
Array::CreateB2DPrimitiveArray()
 }
 
 #undef ORIGCELL
+#undef LASTCELL
 #undef CELLACC
 #undef CELL
 #undef DBG_FRAME_CHECK_ROW_1
diff --git a/svx/source/table/viewcontactoftableobj.cxx 
b/svx/source/table/viewcontactoftableobj.cxx
index cb2398585c63..a79882e03a52 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -259,9 +259,9 @@ namespace sdr::contact
 {
 // copy styles for current cell to 
CellBorderArray for primitive creation
 aArray.SetCellStyleLeft(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, 
false, nColCount, nRowCount, bIsRTL));
-aArray.SetCellStyleRight(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, 
false, nColCount, nRowCount, bIsRTL));
+

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - svx/source

2022-01-18 Thread Gülşah Köse (via logerrit)
 svx/source/dialog/framelinkarray.cxx   |   12 ++--
 svx/source/table/viewcontactoftableobj.cxx |4 ++--
 2 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 58c1afd0590463177de83a90a848a83d0cfcc058
Author: Gülşah Köse 
AuthorDate: Mon Jan 17 10:17:42 2022 +0300
Commit: Xisco Fauli 
CommitDate: Tue Jan 18 10:13:23 2022 +0100

tdf#135843 tdf#146731 Fix the missing border handling

Reverts fa5ab8aa5d88e7128015127af75980a65f945cbb inside. And fix the
missing border problem with better way. Reason of the problem is using
ORIGCELL cell style for bottom and right of merged ranges is wrong.

Eg: We have Row X Col 3X3 table. (0,1) and (0,2) merged. The right side
of right border style should be same with (0,2). But ORIGCELL points (0,1)
instead. In case we should use LASTCELL. Same reason is valid for bottom 
case.

Change-Id: I5282083541f0bd02f3765943da4f34cabe05ef13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128493
Reviewed-by: Gülşah Köse 
Tested-by: Gülşah Köse 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128498
Tested-by: Jenkins

diff --git a/svx/source/dialog/framelinkarray.cxx 
b/svx/source/dialog/framelinkarray.cxx
index 16f6c09e8d91..62967b620387 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ b/svx/source/dialog/framelinkarray.cxx
@@ -260,6 +260,7 @@ struct ArrayImpl
 size_t  GetMergedLastRow( size_t nCol, size_t nRow ) const;
 
 const Cell& GetMergedOriginCell( size_t nCol, size_t nRow ) const;
+const Cell& GetMergedLastCell( size_t nCol, size_t nRow ) const;
 
 boolIsMergedOverlappedLeft( size_t nCol, size_t nRow ) 
const;
 boolIsMergedOverlappedRight( size_t nCol, size_t nRow ) 
const;
@@ -343,6 +344,11 @@ const Cell& ArrayImpl::GetMergedOriginCell( size_t nCol, 
size_t nRow ) const
 return GetCell( GetMergedFirstCol( nCol, nRow ), GetMergedFirstRow( nCol, 
nRow ) );
 }
 
+const Cell& ArrayImpl::GetMergedLastCell( size_t nCol, size_t nRow ) const
+{
+return GetCell( GetMergedLastCol( nCol, nRow ), GetMergedLastRow( nCol, 
nRow ) );
+}
+
 bool ArrayImpl::IsMergedOverlappedLeft( size_t nCol, size_t nRow ) const
 {
 const Cell& rCell = GetCell( nCol, nRow );
@@ -486,6 +492,7 @@ MergedCellIterator& MergedCellIterator::operator++()
 #define CELL( col, row )mxImpl->GetCell( col, row )
 #define CELLACC( col, row ) mxImpl->GetCellAcc( col, row )
 #define ORIGCELL( col, row )mxImpl->GetMergedOriginCell( col, row )
+#define LASTCELL( col, row )mxImpl->GetMergedLastCell( col, row )
 
 
 Array::Array()
@@ -653,7 +660,7 @@ const Style& Array::GetCellStyleRight( size_t nCol, size_t 
nRow ) const
 return ORIGCELL( nCol + 1, nRow ).GetStyleLeft();
 // right clipping border: always own right style
 if( nCol == mxImpl->mnLastClipCol )
-return ORIGCELL( nCol, nRow ).GetStyleRight();
+return LASTCELL( nCol, nRow ).GetStyleRight();
 // outside clipping columns: invisible
 if( !mxImpl->IsColInClipRange( nCol ) )
 return OBJ_STYLE_NONE;
@@ -689,7 +696,7 @@ const Style& Array::GetCellStyleBottom( size_t nCol, size_t 
nRow ) const
 return ORIGCELL( nCol, nRow + 1 ).GetStyleTop();
 // bottom clipping border: always own bottom style
 if( nRow == mxImpl->mnLastClipRow )
-return ORIGCELL( nCol, nRow ).GetStyleBottom();
+return LASTCELL( nCol, nRow ).GetStyleBottom();
 // outside clipping rows: invisible
 if( !mxImpl->IsRowInClipRange( nRow ) )
 return OBJ_STYLE_NONE;
@@ -1519,6 +1526,7 @@ drawinglayer::primitive2d::Primitive2DContainer 
Array::CreateB2DPrimitiveArray()
 }
 
 #undef ORIGCELL
+#undef LASTCELL
 #undef CELLACC
 #undef CELL
 #undef DBG_FRAME_CHECK_ROW_1
diff --git a/svx/source/table/viewcontactoftableobj.cxx 
b/svx/source/table/viewcontactoftableobj.cxx
index cb2398585c63..a79882e03a52 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -259,9 +259,9 @@ namespace sdr::contact
 {
 // copy styles for current cell to 
CellBorderArray for primitive creation
 aArray.SetCellStyleLeft(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, 
false, nColCount, nRowCount, bIsRTL));
-aArray.SetCellStyleRight(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, 
false, nColCount, nRowCount, bIsRTL));
+aArray.SetCellStyleRight(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol + 1, 
aCellPos.mnRow, false, nColCount, nRowCount, bIsRTL));
 aArray.SetCellStyleTop(aCellPos.mnCol, 
aCellPos.mnRow, 

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

2022-01-17 Thread Gülşah Köse (via logerrit)
 svx/source/dialog/framelinkarray.cxx   |   12 ++--
 svx/source/table/viewcontactoftableobj.cxx |4 ++--
 2 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 586a0f149f332c0b0e53c0bb30568d4bd411b0e3
Author: Gülşah Köse 
AuthorDate: Mon Jan 17 10:17:42 2022 +0300
Commit: Gülşah Köse 
CommitDate: Mon Jan 17 13:14:42 2022 +0100

tdf#135843 tdf#146731 Fix the missing border handling

Reverts fa5ab8aa5d88e7128015127af75980a65f945cbb inside. And fix the
missing border problem with better way. Reason of the problem is using
ORIGCELL cell style for bottom and right of merged ranges is wrong.

Eg: We have Row X Col 3X3 table. (0,1) and (0,2) merged. The right side
of right border style should be same with (0,2). But ORIGCELL points (0,1)
instead. In case we should use LASTCELL. Same reason is valid for bottom 
case.

Change-Id: I5282083541f0bd02f3765943da4f34cabe05ef13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128493
Reviewed-by: Gülşah Köse 
Tested-by: Gülşah Köse 

diff --git a/svx/source/dialog/framelinkarray.cxx 
b/svx/source/dialog/framelinkarray.cxx
index 568043c7a8f8..27e227c678ad 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ b/svx/source/dialog/framelinkarray.cxx
@@ -260,6 +260,7 @@ struct ArrayImpl
 sal_Int32  GetMergedLastRow( sal_Int32 nCol, sal_Int32 nRow ) 
const;
 
 const Cell& GetMergedOriginCell( sal_Int32 nCol, sal_Int32 nRow ) 
const;
+const Cell& GetMergedLastCell( sal_Int32 nCol, sal_Int32 nRow ) 
const;
 
 boolIsMergedOverlappedLeft( sal_Int32 nCol, sal_Int32 nRow 
) const;
 boolIsMergedOverlappedRight( sal_Int32 nCol, sal_Int32 
nRow ) const;
@@ -343,6 +344,11 @@ const Cell& ArrayImpl::GetMergedOriginCell( sal_Int32 
nCol, sal_Int32 nRow ) con
 return GetCell( GetMergedFirstCol( nCol, nRow ), GetMergedFirstRow( nCol, 
nRow ) );
 }
 
+const Cell& ArrayImpl::GetMergedLastCell( sal_Int32 nCol, sal_Int32 nRow ) 
const
+{
+return GetCell( GetMergedLastCol( nCol, nRow ), GetMergedLastRow( nCol, 
nRow ) );
+}
+
 bool ArrayImpl::IsMergedOverlappedLeft( sal_Int32 nCol, sal_Int32 nRow ) const
 {
 const Cell& rCell = GetCell( nCol, nRow );
@@ -486,6 +492,7 @@ MergedCellIterator& MergedCellIterator::operator++()
 #define CELL( col, row )mxImpl->GetCell( col, row )
 #define CELLACC( col, row ) mxImpl->GetCellAcc( col, row )
 #define ORIGCELL( col, row )mxImpl->GetMergedOriginCell( col, row )
+#define LASTCELL( col, row )mxImpl->GetMergedLastCell( col, row )
 
 
 Array::Array()
@@ -653,7 +660,7 @@ const Style& Array::GetCellStyleRight( sal_Int32 nCol, 
sal_Int32 nRow ) const
 return ORIGCELL( nCol + 1, nRow ).GetStyleLeft();
 // right clipping border: always own right style
 if( nCol == mxImpl->mnLastClipCol )
-return ORIGCELL( nCol, nRow ).GetStyleRight();
+return LASTCELL( nCol, nRow ).GetStyleRight();
 // outside clipping columns: invisible
 if( !mxImpl->IsColInClipRange( nCol ) )
 return OBJ_STYLE_NONE;
@@ -689,7 +696,7 @@ const Style& Array::GetCellStyleBottom( sal_Int32 nCol, 
sal_Int32 nRow ) const
 return ORIGCELL( nCol, nRow + 1 ).GetStyleTop();
 // bottom clipping border: always own bottom style
 if( nRow == mxImpl->mnLastClipRow )
-return ORIGCELL( nCol, nRow ).GetStyleBottom();
+return LASTCELL( nCol, nRow ).GetStyleBottom();
 // outside clipping rows: invisible
 if( !mxImpl->IsRowInClipRange( nRow ) )
 return OBJ_STYLE_NONE;
@@ -1519,6 +1526,7 @@ drawinglayer::primitive2d::Primitive2DContainer 
Array::CreateB2DPrimitiveArray()
 }
 
 #undef ORIGCELL
+#undef LASTCELL
 #undef CELLACC
 #undef CELL
 #undef DBG_FRAME_CHECK_ROW_1
diff --git a/svx/source/table/viewcontactoftableobj.cxx 
b/svx/source/table/viewcontactoftableobj.cxx
index 932844fe98d7..6419c5057dab 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -259,9 +259,9 @@ namespace sdr::contact
 {
 // copy styles for current cell to 
CellBorderArray for primitive creation
 aArray.SetCellStyleLeft(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, 
false, nColCount, nRowCount, bIsRTL));
-aArray.SetCellStyleRight(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, 
false, nColCount, nRowCount, bIsRTL));
+aArray.SetCellStyleRight(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol + 1, 
aCellPos.mnRow, false, nColCount, nRowCount, bIsRTL));
 aArray.SetCellStyleTop(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, 
true, 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sd/qa svx/source

2022-01-11 Thread Gülşah Köse (via logerrit)
 sd/qa/unit/data/pptx/tdf135843.pptx|binary
 sd/qa/unit/import-tests.cxx|   27 ++-
 svx/source/table/viewcontactoftableobj.cxx |4 ++--
 3 files changed, 28 insertions(+), 3 deletions(-)

New commits:
commit 35b179b88330e1e94980192c598f23661e2757f9
Author: Gülşah Köse 
AuthorDate: Wed Jan 5 13:03:14 2022 +0300
Commit: Xisco Fauli 
CommitDate: Tue Jan 11 09:56:07 2022 +0100

tdf#135843 Fix the missing border handling

Adding +1 at that stage causes indexoutofbounds.
But never throws that exception and tries to pull
empty cell style instead. As a result we can not
see the border. Actually no idea why +1 used here.

Change-Id: Id54ba6445d022540173af3bbf5d679b7edefc55b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127990
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
(cherry picked from commit fa5ab8aa5d88e7128015127af75980a65f945cbb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128163
Reviewed-by: Xisco Fauli 

diff --git a/sd/qa/unit/data/pptx/tdf135843.pptx 
b/sd/qa/unit/data/pptx/tdf135843.pptx
new file mode 100644
index ..0a5dcb334b0c
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf135843.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 303ab76bed7b..5035fa6cedb8 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -101,6 +101,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -117,7 +118,7 @@ static std::ostream& operator<<(std::ostream& rStrm, const 
uno::Reference& xR
 
 
 /// Impress import filters tests.
-class SdImportTest : public SdModelTestBase
+class SdImportTest : public SdModelTestBaseXML
 {
 public:
 virtual void setUp() override;
@@ -187,6 +188,7 @@ public:
 void testTdf93124();
 void testTdf99729();
 void testTdf89927();
+void testTdf135843();
 
 CPPUNIT_TEST_SUITE(SdImportTest);
 
@@ -255,6 +257,7 @@ public:
 CPPUNIT_TEST(testTdf93124);
 CPPUNIT_TEST(testTdf99729);
 CPPUNIT_TEST(testTdf89927);
+CPPUNIT_TEST(testTdf135843);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -1958,6 +1961,28 @@ void SdImportTest::testTdf89927()
 xDocShRef->DoClose();
 }
 
+void SdImportTest::testTdf135843()
+{
+sd::DrawDocShellRef xDocShRef = loadURL( 
m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf135843.pptx"), PPTX );
+
+std::shared_ptr xMetaFile = xDocShRef->GetPreviewMetaFile();
+MetafileXmlDump dumper;
+
+xmlDocUniquePtr pXmlDoc = XmlTestTools::dumpAndParse(dumper, *xMetaFile);
+CPPUNIT_ASSERT(pXmlDoc);
+
+// Without the fix, the test fails with:
+// - Expected: 21165
+// - Actual  : 4218
+assertXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[5]/polyline[1]/point[1]", "x", "21165");
+assertXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[5]/polyline[1]/point[1]", "y", "3866");
+
+assertXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[5]/polyline[1]/point[2]", "x", "21165");
+assertXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[5]/polyline[1]/point[2]", "y", "5956");
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/svx/source/table/viewcontactoftableobj.cxx 
b/svx/source/table/viewcontactoftableobj.cxx
index a79882e03a52..cb2398585c63 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -259,9 +259,9 @@ namespace sdr::contact
 {
 // copy styles for current cell to 
CellBorderArray for primitive creation
 aArray.SetCellStyleLeft(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, 
false, nColCount, nRowCount, bIsRTL));
-aArray.SetCellStyleRight(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol + 1, 
aCellPos.mnRow, false, nColCount, nRowCount, bIsRTL));
+aArray.SetCellStyleRight(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, 
false, nColCount, nRowCount, bIsRTL));
 aArray.SetCellStyleTop(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, 
true, nColCount, nRowCount, bIsRTL));
-aArray.SetCellStyleBottom(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow 
+ 1, true, nColCount, nRowCount, bIsRTL));
+aArray.SetCellStyleBottom(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, 
true, nColCount, nRowCount, bIsRTL));
 
 // ignore merged cells (all except the 
top-left of a merged cell)
 

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

2022-01-06 Thread Gülşah Köse (via logerrit)
 sd/qa/unit/data/pptx/tdf135843.pptx|binary
 sd/qa/unit/import-tests.cxx|   27 ++-
 svx/source/table/viewcontactoftableobj.cxx |4 ++--
 3 files changed, 28 insertions(+), 3 deletions(-)

New commits:
commit fa5ab8aa5d88e7128015127af75980a65f945cbb
Author: Gülşah Köse 
AuthorDate: Wed Jan 5 13:03:14 2022 +0300
Commit: Gülşah Köse 
CommitDate: Thu Jan 6 15:16:28 2022 +0100

tdf#135843 Fix the missing border handling

Adding +1 at that stage causes indexoutofbounds.
But never throws that exception and tries to pull
empty cell style instead. As a result we can not
see the border. Actually no idea why +1 used here.

Change-Id: Id54ba6445d022540173af3bbf5d679b7edefc55b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127990
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/sd/qa/unit/data/pptx/tdf135843.pptx 
b/sd/qa/unit/data/pptx/tdf135843.pptx
new file mode 100644
index ..0a5dcb334b0c
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf135843.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 303ab76bed7b..5035fa6cedb8 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -101,6 +101,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -117,7 +118,7 @@ static std::ostream& operator<<(std::ostream& rStrm, const 
uno::Reference& xR
 
 
 /// Impress import filters tests.
-class SdImportTest : public SdModelTestBase
+class SdImportTest : public SdModelTestBaseXML
 {
 public:
 virtual void setUp() override;
@@ -187,6 +188,7 @@ public:
 void testTdf93124();
 void testTdf99729();
 void testTdf89927();
+void testTdf135843();
 
 CPPUNIT_TEST_SUITE(SdImportTest);
 
@@ -255,6 +257,7 @@ public:
 CPPUNIT_TEST(testTdf93124);
 CPPUNIT_TEST(testTdf99729);
 CPPUNIT_TEST(testTdf89927);
+CPPUNIT_TEST(testTdf135843);
 
 CPPUNIT_TEST_SUITE_END();
 };
@@ -1958,6 +1961,28 @@ void SdImportTest::testTdf89927()
 xDocShRef->DoClose();
 }
 
+void SdImportTest::testTdf135843()
+{
+sd::DrawDocShellRef xDocShRef = loadURL( 
m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf135843.pptx"), PPTX );
+
+std::shared_ptr xMetaFile = xDocShRef->GetPreviewMetaFile();
+MetafileXmlDump dumper;
+
+xmlDocUniquePtr pXmlDoc = XmlTestTools::dumpAndParse(dumper, *xMetaFile);
+CPPUNIT_ASSERT(pXmlDoc);
+
+// Without the fix, the test fails with:
+// - Expected: 21165
+// - Actual  : 4218
+assertXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[5]/polyline[1]/point[1]", "x", "21165");
+assertXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[5]/polyline[1]/point[1]", "y", "3866");
+
+assertXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[5]/polyline[1]/point[2]", "x", "21165");
+assertXPath(pXmlDoc, 
"/metafile/push[1]/push[1]/push[5]/polyline[1]/point[2]", "y", "5956");
+
+xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/svx/source/table/viewcontactoftableobj.cxx 
b/svx/source/table/viewcontactoftableobj.cxx
index 6419c5057dab..932844fe98d7 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -259,9 +259,9 @@ namespace sdr::contact
 {
 // copy styles for current cell to 
CellBorderArray for primitive creation
 aArray.SetCellStyleLeft(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, 
false, nColCount, nRowCount, bIsRTL));
-aArray.SetCellStyleRight(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol + 1, 
aCellPos.mnRow, false, nColCount, nRowCount, bIsRTL));
+aArray.SetCellStyleRight(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, 
false, nColCount, nRowCount, bIsRTL));
 aArray.SetCellStyleTop(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, 
true, nColCount, nRowCount, bIsRTL));
-aArray.SetCellStyleBottom(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow 
+ 1, true, nColCount, nRowCount, bIsRTL));
+aArray.SetCellStyleBottom(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol, aCellPos.mnRow, 
true, nColCount, nRowCount, bIsRTL));
 
 // ignore merged cells (all except the 
top-left of a merged cell)
 if(!xCurrentCell->isMerged())


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py test-bugzilla-files/zip.sh

2021-10-18 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |7 ---
 test-bugzilla-files/zip.sh |2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 5f98759d3b424308c5688c30ec87110fbab0faf7
Author: Gülşah Köse 
AuthorDate: Mon Oct 18 17:08:29 2021 +0300
Commit: Miklos Vajna 
CommitDate: Mon Oct 18 16:31:00 2021 +0200

Create odfundifflog.csv in a simple way.

Remove import_csv and export_csv functions and just write the data to a
file directly.

Change-Id: Ia28f15984e630647f2097516c3da2c8f61257034
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/123751
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 6dec0e0..ac219ac 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -34,7 +34,6 @@ import time
 import uuid
 import datetime
 import re
-from analyze_logs import import_csv, export_csv
 
 import signal
 import threading
@@ -340,8 +339,10 @@ def handleODFunDiff(file, odfundifflog):
 result["total-diff-count"] = len(odfundifflog.splitlines()) - 1 # Last 
line of log is not a real difference
 result["attr-diff-count"]  = getDifferencesByType("Attribute" , 
odfundifflog)
 result["node-diff-count"] = getDifferencesByType("Node", odfundifflog)
-reader = import_csv("odfundifflog.csv")
-export_csv("odfundifflog.csv", result, reader, header=False)
+
+odfundifflog_f = open("odfundifflog.csv", "a")
+odfundifflog_f.write(file + "," + str(result["total-diff-count"]) + "," + 
str(result["attr-diff-count"]) + "," + str(result["node-diff-count"]) + "\n")
+odfundifflog_f.close()
 
 def getDifferencesByType(type, odfundifflog):
 difflist = odfundifflog.splitlines()
diff --git a/test-bugzilla-files/zip.sh b/test-bugzilla-files/zip.sh
index a923cb5..b35117f 100755
--- a/test-bugzilla-files/zip.sh
+++ b/test-bugzilla-files/zip.sh
@@ -9,7 +9,7 @@ mkdir -p /srv/crashtestdata/logs/$SHA/backtraces
 for a in */core*; do gdb ~/build/instdir/program/soffice.bin $a -ex "thread 
apply all backtrace full" --batch > 
/srv/crashtestdata/logs/$SHA/backtraces/`dirname "$a"`-`basename 
"$a"`.backtrace.txt; done
 cat */crashlog.txt > /srv/crashtestdata/logs/$SHA/crashlog.txt
 cat */exportCrash.txt > /srv/crashtestdata/logs/$SHA/exportCrash.txt
-echo "attr-diff-count,filename,node-diff-count,total-diff-count" > 
/srv/crashtestdata/logs/$SHA/odfundifflog.csv
+echo "filename,total-diff-count,attr-diff-count,node-diff-count" > 
/srv/crashtestdata/logs/$SHA/odfundifflog.csv
 cat */odfundifflog.csv >> /srv/crashtestdata/logs/$SHA/odfundifflog.csv
 # Ignore the header.
 num_of_odf_diffs=$(($(< "/srv/crashtestdata/logs/$SHA/odfundifflog.csv" wc 
-l)-1))


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2021-10-13 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit c5ee461480f3872defa4d3b2374d9fd078f66366
Author: Gülşah Köse 
AuthorDate: Wed Oct 13 10:17:40 2021 +0300
Commit: Miklos Vajna 
CommitDate: Wed Oct 13 09:25:03 2021 +0200

Add warning if input file list changed but previous not updated.

Change-Id: If22c0c9ded77d428abde5fedd7f0b8d1eb65c624
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/123545
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 45b1613..6dec0e0 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -693,8 +693,13 @@ if __name__ == "__main__":
 print(odfundiffCommandWithURL)
 try:
 output = 
str(subprocess.check_output(odfundiffCommandWithURL, shell=True, timeout=600), 
encoding='utf-8')
-if not "Diff finished, number of differences found: 0" 
in output and \
-   not filename in exclude_list:
+if "IOException" in output:
+print("Previous state doesn't include %s. It seems 
input file list is changed.\
+   Previous state needs to be updated. If you 
are doing now, please ignore \
+   this warning." % (filename))
+continue
+elif not "Diff finished, number of differences found: 
0" in output and \
+ not filename in exclude_list:
 validLog = open("/srv/crashtestdata/current" + 
filename + ".log.odfundiff", "w")
 validLog.write(output)
 validLog.close()


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py test-bugzilla-files/zip.sh

2021-10-08 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/new-control.py |6 ++
 test-bugzilla-files/zip.sh |2 ++
 2 files changed, 8 insertions(+)

New commits:
commit 53866cbb747772cfbad8f39bac7fb94a1fa9fbee
Author: Gülşah Köse 
AuthorDate: Fri Oct 8 12:08:02 2021 +0300
Commit: Miklos Vajna 
CommitDate: Fri Oct 8 13:28:43 2021 +0200

Give info about about previous state of version.

We add info into the mail about which version of the LibreOffice is
created the previous state.

Change-Id: I8b05e27ed61c198eee54003ad8e1c01c2c8377b6
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/123252
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/new-control.py 
b/test-bugzilla-files/new-control.py
index 6635db6..e8cc89f 100644
--- a/test-bugzilla-files/new-control.py
+++ b/test-bugzilla-files/new-control.py
@@ -69,6 +69,12 @@ def saveAsPreviousState(exported_files):
 
os.makedirs(os.path.dirname("/srv/crashtestdata/previous"+file[len(prefix):]), 
exist_ok=True)
 copyfile(file, "/srv/crashtestdata/previous"+file[len(prefix):])
 
+SHAcmd = "cd ~/source/libo-core/ && git rev-parse HEAD"
+previous_SHA = str(subprocess.check_output(SHAcmd, shell=True), 
encoding='utf-8')
+previous_SHA_file = open("/srv/crashtestdata/previous/hash.txt", "w")
+previous_SHA_file.write(previous_SHA)
+previous_SHA_file.close()
+
 def get_list_of_files(directory_name):
 list_of_file = os.listdir(directory_name)
 all_files = list()
diff --git a/test-bugzilla-files/zip.sh b/test-bugzilla-files/zip.sh
index 7a1acad..2c4faf4 100755
--- a/test-bugzilla-files/zip.sh
+++ b/test-bugzilla-files/zip.sh
@@ -14,6 +14,7 @@ num_of_odf_diffs=$(< 
"/srv/crashtestdata/logs/$SHA/odfundifflog.txt" wc -l)
 num_of_import_crashes=$(< "/srv/crashtestdata/logs/$SHA/crashlog.txt" wc -l)
 num_of_export_crashes=$(< "/srv/crashtestdata/logs/$SHA/exportCrash.txt" wc -l)
 num_of_excluded_file=$(< "/srv/crashtestdata/odfundiff_exclude_list.txt" wc -l)
+previous_hash="$(cat /srv/crashtestdata/previous/hash.txt)"
 rm -rf /srv/crashtestdata/logs/$SHA/odfundiff
 cd /srv/crashtestdata/current/srv/crashtestdata/files/
 zip -r -q odfundiff.zip */*.odfundiff
@@ -63,6 +64,7 @@ $num_of_import_crashes files have crashed during import.
 $num_of_export_crashes files have crashed during export.
 
 $num_of_odf_diffs files have differences compared to the previous run. 
($num_of_excluded_file files are excluded.)
+Please note that previous state is saved with $previous_hash
 
 EOF
 


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py

2021-10-08 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/new-control.py |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 09ee4776096e3f86360664aa7bf2783f4c7ba3fb
Author: Gülşah Köse 
AuthorDate: Fri Oct 8 11:29:08 2021 +0300
Commit: Miklos Vajna 
CommitDate: Fri Oct 8 13:18:57 2021 +0200

Control the saving previous state.

If SAVEPREVIOUSSTATE env is exist, tool will
save the previous state

Change-Id: If055e758d76798af50d94493e268deda7ca333cc
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/123251
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/new-control.py 
b/test-bugzilla-files/new-control.py
index ee8befe..6635db6 100644
--- a/test-bugzilla-files/new-control.py
+++ b/test-bugzilla-files/new-control.py
@@ -164,5 +164,7 @@ if __name__ == "__main__":
 
 exported_files = 
get_list_of_files("/srv/crashtestdata/current/srv/crashtestdata/files/")
 checkDiskSpace()
-saveAsPreviousState(exported_files)
-checkDiskSpace()
+
+if os.getenv('SAVEPREVIOUSSTATE'):
+saveAsPreviousState(exported_files)
+checkDiskSpace()


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/config test-bugzilla-files/new-control.py

2021-10-08 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/config |5 +
 test-bugzilla-files/new-control.py |   11 ++-
 2 files changed, 11 insertions(+), 5 deletions(-)

New commits:
commit fefe99d83597e44f994c95aeaa36609cbda79400
Author: Gülşah Köse 
AuthorDate: Fri Oct 8 10:29:17 2021 +0300
Commit: Miklos Vajna 
CommitDate: Fri Oct 8 13:16:30 2021 +0200

Read limit values from config file.

Remaining disk space, memory usage and CPU load limit values are moved
to config file.

Change-Id: Ia5a416d24dfa23a5c20f57eca6104f91f5388f64
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/123248
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/config b/test-bugzilla-files/config
index 3605bed..9622054 100644
--- a/test-bugzilla-files/config
+++ b/test-bugzilla-files/config
@@ -3,6 +3,11 @@ export SRCDIR=/home/$USER/source/libo-core
 export INSTDIR=/home/$USER/build/instdir
 export USERDIR=/home/$USER/.config
 
+# Warning limits
+export DISKSPACELIMIT=5  # Remaining disk space warning limit in GiB.
+export MEMORYLIMIT=90# Memory usage warning limit in percent.
+export CPULOADAVGLIMIT=0.9   # CPU load average limit for per core in last 
minute. min 0, max 1.
+
 # For development purposes:
 # Don't touch the core.git source/build directory:
 # export CRASHTEST_READONLY_CORE=1
diff --git a/test-bugzilla-files/new-control.py 
b/test-bugzilla-files/new-control.py
index ab82a08..ee8befe 100644
--- a/test-bugzilla-files/new-control.py
+++ b/test-bugzilla-files/new-control.py
@@ -83,7 +83,8 @@ def get_list_of_files(directory_name):
 def checkDiskSpace():
 total, used, free = disk_usage(os.environ["CRASHTESTDATA"])
 freeGiB = free // (2**30)
-if freeGiB <= 5:
+disk_space_limit = int(os.environ["DISKSPACELIMIT"])
+if freeGiB <= disk_space_limit:
 diskusagefile = open("/srv/crashtestdata/diskusageinfo.txt", "w")
 diskusagefile.write(str(freeGiB))
 diskusagefile.close()
@@ -91,9 +92,9 @@ def checkDiskSpace():
 def checkCPULoadAverage():
 cpuload, _, _ = os.getloadavg()
 cpuload /= float(os.cpu_count())
-limit = 0.9
+cpu_loadavg_limit = float(os.environ["CPULOADAVGLIMIT"])
 
-if cpuload > limit:
+if cpuload > cpu_loadavg_limit:
 cpuusagefile = open("/srv/crashtestdata/cpuusageinfo.txt", "w")
 cpuusagefile.write(str(cpuload))
 cpuusagefile.close()
@@ -106,9 +107,9 @@ def checkMemoryUsage():
 
 usage = used_memory / total_memory
 usage_in_percent = round(round(usage, 2)*100)
-limit = 90
+memory_limit = int(os.environ["MEMORYLIMIT"])
 
-if usage_in_percent > limit:
+if usage_in_percent > memory_limit:
 memoryusagefile = 
open(os.environ["CRASHTESTDATA"]+"/memoryusageinfo.txt", "w")
 memoryusagefile.write(str(usage_in_percent)+'%')
 memoryusagefile.close()


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/zip.sh

2021-09-21 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/zip.sh |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ea335495f8a6a762b24797a48ffa61e23c775e57
Author: Gülşah Köse 
AuthorDate: Fri Sep 17 15:10:18 2021 +0300
Commit: Miklos Vajna 
CommitDate: Tue Sep 21 09:34:44 2021 +0200

Give info about excluded files number in mail body.

Change-Id: I5dad3b7a6f064a3a508a094e4f5c83d0081d7d66
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/122244
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/zip.sh b/test-bugzilla-files/zip.sh
index 1e5026e..7a1acad 100755
--- a/test-bugzilla-files/zip.sh
+++ b/test-bugzilla-files/zip.sh
@@ -13,6 +13,7 @@ cat */odfundifflog.txt > 
/srv/crashtestdata/logs/$SHA/odfundifflog.txt
 num_of_odf_diffs=$(< "/srv/crashtestdata/logs/$SHA/odfundifflog.txt" wc -l)
 num_of_import_crashes=$(< "/srv/crashtestdata/logs/$SHA/crashlog.txt" wc -l)
 num_of_export_crashes=$(< "/srv/crashtestdata/logs/$SHA/exportCrash.txt" wc -l)
+num_of_excluded_file=$(< "/srv/crashtestdata/odfundiff_exclude_list.txt" wc -l)
 rm -rf /srv/crashtestdata/logs/$SHA/odfundiff
 cd /srv/crashtestdata/current/srv/crashtestdata/files/
 zip -r -q odfundiff.zip */*.odfundiff
@@ -61,7 +62,7 @@ $num_of_import_crashes files have crashed during import.
 
 $num_of_export_crashes files have crashed during export.
 
-$num_of_odf_diffs files have differences compared to the previous run.
+$num_of_odf_diffs files have differences compared to the previous run. 
($num_of_excluded_file files are excluded.)
 
 EOF
 


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py test-bugzilla-files/zip.sh

2021-09-21 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/new-control.py |   16 
 test-bugzilla-files/zip.sh |7 +++
 2 files changed, 23 insertions(+)

New commits:
commit d26dac1442083ce330c17546d468f042cd90eee8
Author: Gülşah Köse 
AuthorDate: Fri Sep 17 14:31:55 2021 +0300
Commit: Miklos Vajna 
CommitDate: Tue Sep 21 09:26:46 2021 +0200

Show a warning if memory usage is higher than limit.

If memory usage is higher than limit, we will add a
warning line to mail body.

Change-Id: Id18b391aad825f61dff0ba2c86f6cab6e4faf8f7
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/122243
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/new-control.py 
b/test-bugzilla-files/new-control.py
index a83c65a..ab82a08 100644
--- a/test-bugzilla-files/new-control.py
+++ b/test-bugzilla-files/new-control.py
@@ -98,6 +98,21 @@ def checkCPULoadAverage():
 cpuusagefile.write(str(cpuload))
 cpuusagefile.close()
 
+def checkMemoryUsage():
+memory_info = dict((i.split()[0].rstrip(':'),int(i.split()[1])) for i in 
open('/proc/meminfo').readlines())
+total_memory = memory_info['MemTotal']
+# Not Total - Free, as that would include caches as well, which is not 
interesting for us.
+used_memory = total_memory - memory_info['MemAvailable']
+
+usage = used_memory / total_memory
+usage_in_percent = round(round(usage, 2)*100)
+limit = 90
+
+if usage_in_percent > limit:
+memoryusagefile = 
open(os.environ["CRASHTESTDATA"]+"/memoryusageinfo.txt", "w")
+memoryusagefile.write(str(usage_in_percent)+'%')
+memoryusagefile.close()
+
 def usage():
 message = """usage: {program} [option] dir"
  - h | --help: print usage information
@@ -134,6 +149,7 @@ if __name__ == "__main__":
 
 checkCPULoadAverage()
 checkDiskSpace()
+checkMemoryUsage()
 with concurrent.futures.ThreadPoolExecutor(max_workers=workers) as 
executor:
 future_to_task = {executor.submit(execute_task, task_file, asan): 
task_file for task_file in get_tasks(directory, task_size)}
 for future in concurrent.futures.as_completed(future_to_task):
diff --git a/test-bugzilla-files/zip.sh b/test-bugzilla-files/zip.sh
index a0c2202..1e5026e 100755
--- a/test-bugzilla-files/zip.sh
+++ b/test-bugzilla-files/zip.sh
@@ -46,6 +46,12 @@ if [ -e $cpuusagefile ]; then
 rm $cpuusagefile
 fi
 
+memoryusagefile=$CRASHTESTDATA/memoryusageinfo.txt
+if [ -e $memoryusagefile ]; then
+memory_usage="$(cat $memoryusagefile)"
+rm $memoryusagefile
+fi
+
 cat << EOF > mail.txt
 Hi,
 
@@ -61,6 +67,7 @@ EOF
 
 [ ! -z "${free_disk_space}" ] && echo "Warning! Remaining disk space is 
${free_disk_space} GiB." >> mail.txt && echo "" >> mail.txt
 [ ! -z "${cpu_usage}" ] && echo "Warning! CPU load average is ${cpu_usage}." 
>> mail.txt && echo "" >> mail.txt
+[ ! -z "${memory_usage}" ] && echo "Warning! Memory usage is ${memory_usage}." 
>> mail.txt && echo "" >> mail.txt
 
 cat << EOF >> mail.txt
 - Your friendly crashtest bot


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py test-bugzilla-files/zip.sh

2021-09-17 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/new-control.py |   11 +++
 test-bugzilla-files/zip.sh |8 
 2 files changed, 19 insertions(+)

New commits:
commit 6b7fd54d6da91b4253df19692a2ead2d22943f5c
Author: Gülşah Köse 
AuthorDate: Thu Sep 16 19:03:46 2021 +0300
Commit: Miklos Vajna 
CommitDate: Fri Sep 17 10:11:34 2021 +0200

Show a warning if CPU load average is higher than limit.

If CPU load average is higher than limit, we will add
a warning line to mail body.

Change-Id: If73f82e868639ca02bf224bf07bf0c37fcf1ec3a
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/122200
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/new-control.py 
b/test-bugzilla-files/new-control.py
index 10479a4..a83c65a 100644
--- a/test-bugzilla-files/new-control.py
+++ b/test-bugzilla-files/new-control.py
@@ -88,6 +88,16 @@ def checkDiskSpace():
 diskusagefile.write(str(freeGiB))
 diskusagefile.close()
 
+def checkCPULoadAverage():
+cpuload, _, _ = os.getloadavg()
+cpuload /= float(os.cpu_count())
+limit = 0.9
+
+if cpuload > limit:
+cpuusagefile = open("/srv/crashtestdata/cpuusageinfo.txt", "w")
+cpuusagefile.write(str(cpuload))
+cpuusagefile.close()
+
 def usage():
 message = """usage: {program} [option] dir"
  - h | --help: print usage information
@@ -122,6 +132,7 @@ if __name__ == "__main__":
 if asan == 1:
 workers = 64
 
+checkCPULoadAverage()
 checkDiskSpace()
 with concurrent.futures.ThreadPoolExecutor(max_workers=workers) as 
executor:
 future_to_task = {executor.submit(execute_task, task_file, asan): 
task_file for task_file in get_tasks(directory, task_size)}
diff --git a/test-bugzilla-files/zip.sh b/test-bugzilla-files/zip.sh
index 0ad6f11..a0c2202 100755
--- a/test-bugzilla-files/zip.sh
+++ b/test-bugzilla-files/zip.sh
@@ -39,6 +39,13 @@ if [ -e $diskusagefile ]; then
 free_disk_space="$(cat $diskusagefile)"
 rm $diskusagefile
 fi
+
+cpuusagefile=$CRASHTESTDATA/cpuusageinfo.txt
+if [ -e $cpuusagefile ]; then
+cpu_usage="$(cat $cpuusagefile)"
+rm $cpuusagefile
+fi
+
 cat << EOF > mail.txt
 Hi,
 
@@ -53,6 +60,7 @@ $num_of_odf_diffs files have differences compared to the 
previous run.
 EOF
 
 [ ! -z "${free_disk_space}" ] && echo "Warning! Remaining disk space is 
${free_disk_space} GiB." >> mail.txt && echo "" >> mail.txt
+[ ! -z "${cpu_usage}" ] && echo "Warning! CPU load average is ${cpu_usage}." 
>> mail.txt && echo "" >> mail.txt
 
 cat << EOF >> mail.txt
 - Your friendly crashtest bot


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py test-bugzilla-files/zip.sh

2021-09-17 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/new-control.py |   13 -
 test-bugzilla-files/zip.sh |   11 +++
 2 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 4f337cfd71a0047e134f4f80476efe3db16a96f5
Author: Gülşah Köse 
AuthorDate: Wed Sep 15 17:31:32 2021 +0300
Commit: Miklos Vajna 
CommitDate: Fri Sep 17 08:41:24 2021 +0200

Show a warning if remaining disk space less than 5 GiB

We show a warning at the output of the command.sh. Then we added that
warning to mail body.

Change-Id: I87efd38dc7e370ed497c0f56ebb8e09a1dc26aa3
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/122111
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/new-control.py 
b/test-bugzilla-files/new-control.py
index f5faa0a..10479a4 100644
--- a/test-bugzilla-files/new-control.py
+++ b/test-bugzilla-files/new-control.py
@@ -23,7 +23,7 @@ import time
 import subprocess
 import getopt
 import sys
-from shutil import copyfile, rmtree
+from shutil import copyfile, rmtree, disk_usage
 
 def partition(l, n):
 for i in range(0, len(l), n):
@@ -80,6 +80,14 @@ def get_list_of_files(directory_name):
 all_files.append(full_path)
 return all_files
 
+def checkDiskSpace():
+total, used, free = disk_usage(os.environ["CRASHTESTDATA"])
+freeGiB = free // (2**30)
+if freeGiB <= 5:
+diskusagefile = open("/srv/crashtestdata/diskusageinfo.txt", "w")
+diskusagefile.write(str(freeGiB))
+diskusagefile.close()
+
 def usage():
 message = """usage: {program} [option] dir"
  - h | --help: print usage information
@@ -114,6 +122,7 @@ if __name__ == "__main__":
 if asan == 1:
 workers = 64
 
+checkDiskSpace()
 with concurrent.futures.ThreadPoolExecutor(max_workers=workers) as 
executor:
 future_to_task = {executor.submit(execute_task, task_file, asan): 
task_file for task_file in get_tasks(directory, task_size)}
 for future in concurrent.futures.as_completed(future_to_task):
@@ -126,4 +135,6 @@ if __name__ == "__main__":
 print('%r successfully passed' % (task))
 
 exported_files = 
get_list_of_files("/srv/crashtestdata/current/srv/crashtestdata/files/")
+checkDiskSpace()
 saveAsPreviousState(exported_files)
+checkDiskSpace()
diff --git a/test-bugzilla-files/zip.sh b/test-bugzilla-files/zip.sh
index b9bb808..92b9801 100755
--- a/test-bugzilla-files/zip.sh
+++ b/test-bugzilla-files/zip.sh
@@ -34,6 +34,11 @@ if [ -z "$CRASHTEST_NO_UPLOAD" ]; then
 ssh upl...@gimli.documentfoundation.org unzip -n 
/srv/www/dev-builds.libreoffice.org/crashtest/current.zip -d 
/srv/www/dev-builds.libreoffice.org/crashtest
 fi
 cd /srv/crashtestdata/
+diskusagefile=/srv/crashtestdata/diskusageinfo.txt
+if [ -e $diskusagefile ]; then
+free_disk_space="$(cat $diskusagefile)"
+rm $diskusagefile
+fi
 cat << EOF > mail.txt
 Hi,
 
@@ -45,8 +50,14 @@ $num_of_import_crashes files have crashed during import.
 
 $num_of_export_crashes files have crashed during export.
 
+EOF
+
+[ ! -z "${free_disk_space}" ] && echo "Warning! Remaining disk space is 
${free_disk_space} GiB." >> mail.txt && echo "" >> mail.txt
+
+cat << EOF >> mail.txt
 - Your friendly crashtest bot
 EOF
+
 if [ -z "$CRASHTEST_NO_EMAIL" ]; then
 /srv/crashtestdata/sendEmail -t libreoffice@lists.freedesktop.org -u 
"Crash test update" -m "$(cat /srv/crashtestdata/mail.txt)" -a logs/*.csv
 fi


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/zip.sh

2021-09-15 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/zip.sh |   18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

New commits:
commit fdae1595ab45aac688e83e199328829a0e39bc49
Author: Gülşah Köse 
AuthorDate: Tue Sep 14 13:47:19 2021 +0300
Commit: Miklos Vajna 
CommitDate: Wed Sep 15 14:09:14 2021 +0200

Read the body of the mail from an external file.

In order to keep the mail to be sent more organized,
the body of the mail will be read from a file.

We add summary info to mail body about import export
crashes and ODF differences.

Change-Id: I31c8ad3b865ebf2527c34fe2d4f35acb11d03e26
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/122083
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/zip.sh b/test-bugzilla-files/zip.sh
index 3a6b991..b9bb808 100755
--- a/test-bugzilla-files/zip.sh
+++ b/test-bugzilla-files/zip.sh
@@ -10,6 +10,9 @@ for a in */core*; do gdb ~/build/instdir/program/soffice.bin 
$a -ex "thread appl
 cat */crashlog.txt > /srv/crashtestdata/logs/$SHA/crashlog.txt
 cat */exportCrash.txt > /srv/crashtestdata/logs/$SHA/exportCrash.txt
 cat */odfundifflog.txt > /srv/crashtestdata/logs/$SHA/odfundifflog.txt
+num_of_odf_diffs=$(< "/srv/crashtestdata/logs/$SHA/odfundifflog.txt" wc -l)
+num_of_import_crashes=$(< "/srv/crashtestdata/logs/$SHA/crashlog.txt" wc -l)
+num_of_export_crashes=$(< "/srv/crashtestdata/logs/$SHA/exportCrash.txt" wc -l)
 rm -rf /srv/crashtestdata/logs/$SHA/odfundiff
 cd /srv/crashtestdata/current/srv/crashtestdata/files/
 zip -r -q odfundiff.zip */*.odfundiff
@@ -31,6 +34,19 @@ if [ -z "$CRASHTEST_NO_UPLOAD" ]; then
 ssh upl...@gimli.documentfoundation.org unzip -n 
/srv/www/dev-builds.libreoffice.org/crashtest/current.zip -d 
/srv/www/dev-builds.libreoffice.org/crashtest
 fi
 cd /srv/crashtestdata/
+cat << EOF > mail.txt
+Hi,
+
+New crashtest update available at 
.
+
+$num_of_odf_diffs files have differences compared to the previous run.
+
+$num_of_import_crashes files have crashed during import.
+
+$num_of_export_crashes files have crashed during export.
+
+- Your friendly crashtest bot
+EOF
 if [ -z "$CRASHTEST_NO_EMAIL" ]; then
-/srv/crashtestdata/sendEmail -t libreoffice@lists.freedesktop.org -u 
"Crash test update" -m "New crashtest update available at 
https://dev-builds.libreoffice.org/crashtest/$SHA/; -a logs/*.csv
+/srv/crashtestdata/sendEmail -t libreoffice@lists.freedesktop.org -u 
"Crash test update" -m "$(cat /srv/crashtestdata/mail.txt)" -a logs/*.csv
 fi


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/analyze-logs.py test-bugzilla-files/test-bugzilla-files.py

2021-09-14 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/analyze-logs.py|   20 
 test-bugzilla-files/test-bugzilla-files.py |2 +-
 2 files changed, 21 insertions(+), 1 deletion(-)

New commits:
commit 1369b051e6de093c496fbdb4bd932f872053d52a
Author: Gülşah Köse 
AuthorDate: Mon Sep 13 10:04:14 2021 +0300
Commit: Miklos Vajna 
CommitDate: Tue Sep 14 09:49:10 2021 +0200

Create csv file from odfundiff log.

Change-Id: Ida77283c7537d56eca13e7cf2d4b35961b406a66
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/122019
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/analyze-logs.py 
b/test-bugzilla-files/analyze-logs.py
index c27230b..3c74d0c 100644
--- a/test-bugzilla-files/analyze-logs.py
+++ b/test-bugzilla-files/analyze-logs.py
@@ -35,6 +35,19 @@ def analyze_import_crash(crashtest_file, crashes):
 crashes[format] = 1 + crashes[format]
 return crashes
 
+def analyze_odfundifflog(odfundifflog_file, differences):
+if not os.path.exists(odfundifflog_file):
+return 0
+
+regex = re.compile("Difference in :/srv/crashtestdata/files/(\w*)")
+for line in open(odfundifflog_file):
+r = regex.search(line)
+format = r.groups()[0]
+if format not in differences:
+differences[format] = 0
+differences[format] = 1 + differences[format]
+return differences
+
 def analyze_export_crash(crashtest_file, crashes):
 if not os.path.exists(crashtest_file):
 return 0
@@ -99,6 +112,13 @@ def update_validation():
 reader = import_csv("validationErrors.csv")
 export_csv("validationErrors.csv", validation_errors, reader)
 
+def update_odfundiff():
+differences = dict()
+analyze_odfundifflog("odfundifflog.txt", differences)
+reader = import_csv("odfundiff.csv")
+export_csv("odfundiff.csv", differences, reader)
+
 update_import()
 update_export()
 update_validation()
+update_odfundiff()
diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 0f2d7d3..de6bb26 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -335,7 +335,7 @@ def handleCrash(file, disposed):
 def handleODFunDiff(file):
 print("File: " + file + " has differences")
 diffLog = open("odfundifflog.txt", "a")
-diffLog.write(file + ' has differences after saving')
+diffLog.write('Difference in :' + file)
 diffLog.write('\n')
 diffLog.close()
 


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py test-bugzilla-files/test-bugzilla-files.py

2021-09-08 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/new-control.py |7 +--
 test-bugzilla-files/test-bugzilla-files.py |3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit d07ab8251361bdfa3d0e6cf2ccaf88dfbd5dfdb9
Author: Gülşah Köse 
AuthorDate: Wed Sep 8 11:09:00 2021 +0300
Commit: Miklos Vajna 
CommitDate: Wed Sep 8 11:53:28 2021 +0200

Extend file formats to compare with odfundiff.

Before we were comparing only odt files. Now we can compare ods,
odb, odg and odp files too.

Change-Id: Id10280b67989b8c8cc919f181b205e322a1d1670
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/121803
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/new-control.py 
b/test-bugzilla-files/new-control.py
index 9a56fa3..f5faa0a 100644
--- a/test-bugzilla-files/new-control.py
+++ b/test-bugzilla-files/new-control.py
@@ -54,10 +54,13 @@ def execute_task(task_file, asan):
 time.sleep(1)
 
 def saveAsPreviousState(exported_files):
-odf_file_ext = ['odt']
+odf_file_ext = ['odt', 'odp', 'odb', 'ods', 'odg']
 previous_path = "/srv/crashtestdata/previous"
 if os.path.exists(previous_path):
-rmtree("/srv/crashtestdata/previous")
+rmtree(previous_path)
+
+for ext in odf_file_ext:
+os.makedirs(previous_path + "/srv/crashtestdata/files/"+ ext)
 
 prefix = "/srv/crashtestdata/current"
 for file in exported_files:
diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 710364d..0f2d7d3 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -668,8 +668,9 @@ if __name__ == "__main__":
 exclude_list = [line.rstrip() for line in exclude_list]
 
 if  isPreviousExist():
+odf_file_ext = ['odt', 'odp', 'odb', 'ods', 'odg']
 for filename in exportedFiles:
-if filename[-3:] == 'odt':
+if filename[-3:] in odf_file_ext:
 odfundiffCommandWithURL = getODFunDiffCommand() + " 
/srv/crashtestdata/previous" + filename + " /srv/crashtestdata/current" + 
filename
 print(odfundiffCommandWithURL)
 try:


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/zip.sh

2021-09-08 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/zip.sh |5 +
 1 file changed, 5 insertions(+)

New commits:
commit e689a8be15a2006bbb404330d1727d3dd8919f08
Author: Gülşah Köse 
AuthorDate: Tue Sep 7 11:16:57 2021 +0300
Commit: Miklos Vajna 
CommitDate: Wed Sep 8 10:08:59 2021 +0200

Create odfundiff log under logs directory

Change-Id: Iaf7831418c270d07979de6d650fb5f7ebc9a8be6
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/121749
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/zip.sh b/test-bugzilla-files/zip.sh
index e5df220..3a6b991 100755
--- a/test-bugzilla-files/zip.sh
+++ b/test-bugzilla-files/zip.sh
@@ -9,11 +9,16 @@ mkdir -p /srv/crashtestdata/logs/$SHA/backtraces
 for a in */core*; do gdb ~/build/instdir/program/soffice.bin $a -ex "thread 
apply all backtrace full" --batch > 
/srv/crashtestdata/logs/$SHA/backtraces/`dirname "$a"`-`basename 
"$a"`.backtrace.txt; done
 cat */crashlog.txt > /srv/crashtestdata/logs/$SHA/crashlog.txt
 cat */exportCrash.txt > /srv/crashtestdata/logs/$SHA/exportCrash.txt
+cat */odfundifflog.txt > /srv/crashtestdata/logs/$SHA/odfundifflog.txt
+rm -rf /srv/crashtestdata/logs/$SHA/odfundiff
 cd /srv/crashtestdata/current/srv/crashtestdata/files/
+zip -r -q odfundiff.zip */*.odfundiff
+mv odfundiff.zip /srv/crashtestdata/logs/$SHA/.
 zip -r -q validation.zip */*.log
 mv validation.zip /srv/crashtestdata/logs/$SHA/.
 cd /srv/crashtestdata/logs/$SHA
 unzip validation.zip -d validation
+unzip odfundiff.zip -d odfundiff
 rm *.zip
 cp ~/source/dev-tools/test-bugzilla-files/analyze-logs.py .
 cp ../*.csv .


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2021-09-07 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit dc01a975a1066b54bb1712cfa5071175633a7238
Author: Gülşah Köse 
AuthorDate: Tue Sep 7 10:19:10 2021 +0300
Commit: Miklos Vajna 
CommitDate: Tue Sep 7 12:15:44 2021 +0200

Ignore some diffs if file is in exclude list.

/srv/crashtestdata/odfundiff_exclude_list.txt is manuel exclude
list. If the file has difference but file name  in exclude list it
will be ignored.

Example entry for odfundiff_exclude_list.txt
/srv/crashtestdata/files/odt/test.odt

Change-Id: Ibfb568e49d492458b824704cfb5a8734f59de850
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/121744
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 0ade4eb..710364d 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -661,6 +661,12 @@ if __name__ == "__main__":
 # Check the roundtripped files doesn't crash at import time
 runLoadFileTests(opts, exportedFiles, False)
 
+exclude_list = []
+if os.path.exists("/srv/crashtestdata/odfundiff_exclude_list.txt"):
+with open('/srv/crashtestdata/odfundiff_exclude_list.txt') as file:
+exclude_list = file.readlines()
+exclude_list = [line.rstrip() for line in exclude_list]
+
 if  isPreviousExist():
 for filename in exportedFiles:
 if filename[-3:] == 'odt':
@@ -668,7 +674,8 @@ if __name__ == "__main__":
 print(odfundiffCommandWithURL)
 try:
 output = 
str(subprocess.check_output(odfundiffCommandWithURL, shell=True, timeout=600), 
encoding='utf-8')
-if not "Diff finished, number of differences found: 0" 
in output:
+if not "Diff finished, number of differences found: 0" 
in output and \
+   not filename in exclude_list:
 validLog = open("/srv/crashtestdata/current" + 
filename + ".log.odfundiff", "w")
 validLog.write(output)
 validLog.close()


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/new-control.py test-bugzilla-files/test-bugzilla-files.py

2021-09-07 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/new-control.py |   28 
 test-bugzilla-files/test-bugzilla-files.py |   25 -
 2 files changed, 32 insertions(+), 21 deletions(-)

New commits:
commit d7224055ba764836a6984afabd21853a6eed8fa4
Author: Gülşah Köse 
AuthorDate: Mon Sep 6 18:46:39 2021 +0300
Commit: Miklos Vajna 
CommitDate: Tue Sep 7 08:23:09 2021 +0200

Move previous dir handling out of the thread.

Change-Id: I6fcd7f9e160975eb7730d87a9a667916ec934d5a
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/121582
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/new-control.py 
b/test-bugzilla-files/new-control.py
index 79913bc..6807d8e 100644
--- a/test-bugzilla-files/new-control.py
+++ b/test-bugzilla-files/new-control.py
@@ -23,6 +23,7 @@ import time
 import subprocess
 import getopt
 import sys
+from shutil import copyfile, rmtree
 
 def partition(l, n):
 for i in range(0, len(l), n):
@@ -52,6 +53,30 @@ def execute_task(task_file, asan):
 subprocess.call("./execute.sh " + task_file, shell=True)
 time.sleep(1)
 
+def saveAsPreviousState(exported_files):
+odf_file_ext = ['odt']
+previous_path = "/srv/crashtestdata/previous/srv/crashtestdata/files/odt"
+if os.path.exists(previous_path):
+rmtree("/srv/crashtestdata/previous")
+os.makedirs(previous_path)
+
+for file in exported_files:
+ext = file[-3:]
+if ext in odf_file_ext and os.path.exists(file):
+
os.makedirs(os.path.dirname("/srv/crashtestdata/previous"+file[26:]), 
exist_ok=True)
+copyfile(file, "/srv/crashtestdata/previous"+file[26:])
+
+def get_list_of_files(directory_name):
+list_of_file = os.listdir(directory_name)
+all_files = list()
+for filename in list_of_file:
+full_path = os.path.join(directory_name, filename)
+if os.path.isdir(full_path):
+all_files = all_files + get_list_of_files(full_path)
+else:
+all_files.append(full_path)
+return all_files
+
 def usage():
 message = """usage: {program} [option] dir"
  - h | --help: print usage information
@@ -96,3 +121,6 @@ if __name__ == "__main__":
 print('%r generated an exception: %s' % (task, exc))
 else:
 print('%r successfully passed' % (task))
+
+exported_files = 
get_list_of_files("/srv/crashtestdata/current/srv/crashtestdata/files/odt/")
+saveAsPreviousState(exported_files)
diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 82fba62..0ade4eb 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -33,7 +33,6 @@ import sys
 import time
 import uuid
 import datetime
-from shutil import copyfile, rmtree
 
 import signal
 import threading
@@ -394,28 +393,15 @@ def exportDoc(xDoc, filterName, validationCommand, 
filename, connection, timer):
 except subprocess.CalledProcessError:
 pass # ignore that exception
 
+def getODFunDiffCommand():
+return os.environ["HOME"] + "/source/bin/odfundiff-exe"
+
 def isPreviousExist():
 previous_path = "/srv/crashtestdata/previous"
 if os.path.exists(previous_path):
 return True
 return False
 
-def saveAsPreviousState(exported_files):
-odf_file_ext = ['odt']
-previous_path = "/srv/crashtestdata/previous/srv/crashtestdata/files/odt"
-if os.path.exists(previous_path):
-rmtree("/srv/crashtestdata/previous")
-os.makedirs(previous_path)
-
-for file in exportedFiles:
-ext = file[-3:]
-if ext in odf_file_ext and 
os.path.exists("/srv/crashtestdata/current"+file):
-os.makedirs(os.path.dirname("/srv/crashtestdata/previous"+file), 
exist_ok=True)
-copyfile("/srv/crashtestdata/current"+file, 
"/srv/crashtestdata/previous"+file)
-
-def getODFunDiffCommand():
-return os.environ["HOME"] + "/source/bin/odfundiff-exe"
-
 class ExportFileTest:
 def __init__(self, xDoc, filename, enable_validation, timer):
 self.xDoc = xDoc
@@ -675,9 +661,7 @@ if __name__ == "__main__":
 # Check the roundtripped files doesn't crash at import time
 runLoadFileTests(opts, exportedFiles, False)
 
-if not isPreviousExist():
-saveAsPreviousState(exportedFiles)
-else:
+if  isPreviousExist():
 for filename in exportedFiles:
 if filename[-3:] == 'odt':
 odfundiffCommandWithURL = getODFunDiffCommand() + " 
/srv/crashtestdata/previous" + filename + " /srv/crashtestdata/current" + 
filename
@@ -691,7 +675,6 @@ if __name__ == "__main__":
 handleODFunDiff(filename)
 except subprocess.CalledProcessError:
 pass
-saveAsPreviousState(exportedFiles)
 else:
 usage()
 

[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2021-08-27 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 1788875b6a2cbe30b3398dc358a96d8e1bed13f8
Author: Gülşah Köse 
AuthorDate: Fri Aug 27 14:09:01 2021 +0300
Commit: Miklos Vajna 
CommitDate: Fri Aug 27 16:36:42 2021 +0200

Check if source file and destination dir exist.

Before creating 'previous' directory, check if
source file and destination dir exist.

Change-Id: I77f70fff388d704717766799e278d0e7693368e3
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/121140
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 9d712c6..82fba62 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -401,7 +401,7 @@ def isPreviousExist():
 return False
 
 def saveAsPreviousState(exported_files):
-odf_file_ext = ['odt', 'ods', 'odp', 'odb']
+odf_file_ext = ['odt']
 previous_path = "/srv/crashtestdata/previous/srv/crashtestdata/files/odt"
 if os.path.exists(previous_path):
 rmtree("/srv/crashtestdata/previous")
@@ -409,7 +409,8 @@ def saveAsPreviousState(exported_files):
 
 for file in exportedFiles:
 ext = file[-3:]
-if ext in odf_file_ext:
+if ext in odf_file_ext and 
os.path.exists("/srv/crashtestdata/current"+file):
+os.makedirs(os.path.dirname("/srv/crashtestdata/previous"+file), 
exist_ok=True)
 copyfile("/srv/crashtestdata/current"+file, 
"/srv/crashtestdata/previous"+file)
 
 def getODFunDiffCommand():


[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2021-08-26 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |   63 +++--
 1 file changed, 43 insertions(+), 20 deletions(-)

New commits:
commit cd10db7159587868ff0bf9a63d9f22020a8c92a2
Author: Gülşah Köse 
AuthorDate: Wed Aug 25 10:50:49 2021 +0300
Commit: Miklos Vajna 
CommitDate: Thu Aug 26 11:30:54 2021 +0200

Create previous directory to compare

Change-Id: Iae9d9e7e24f262a05ddbfc7ec0180784e311efae
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/121011
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 5a05878..9d712c6 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -33,6 +33,7 @@ import sys
 import time
 import uuid
 import datetime
+from shutil import copyfile, rmtree
 
 import signal
 import threading
@@ -347,7 +348,7 @@ def writeExportCrash(fileName):
 exportCrash.write(fileName + '\n')
 exportCrash.close()
 
-def exportDoc(xDoc, filterName, validationCommand, odfundiffCommand, filename, 
connection, timer):
+def exportDoc(xDoc, filterName, validationCommand, filename, connection, 
timer):
 props = [ ("FilterName", filterName) ]
 saveProps = tuple([mkPropertyValue(name, value) for (name, value) in 
props])
 # note: avoid empty path segments in the url!
@@ -356,7 +357,7 @@ def exportDoc(xDoc, filterName, validationCommand, 
odfundiffCommand, filename, c
 try:
 args = [connection]
 t = threading.Timer(timer.getExportTime(), alarm_handler, args)
-t.start()  
+t.start()
 xDoc.storeToURL(fileURL, saveProps)
 except pyuno.getClass("com.sun.star.beans.UnknownPropertyException"):
 print("caught UnknownPropertyException " + filename + " timedOut: " + 
str(connection.suicided()))
@@ -393,18 +394,26 @@ def exportDoc(xDoc, filterName, validationCommand, 
odfundiffCommand, filename, c
 except subprocess.CalledProcessError:
 pass # ignore that exception
 
-if odfundiffCommand:
-odfundiffCommandWithURL = odfundiffCommand + " " + filename + " 
/srv/crashtestdata/current" + filename
-print(odfundiffCommandWithURL)
-try:
-output = str(subprocess.check_output(odfundiffCommandWithURL, 
shell=True, timeout=600), encoding='utf-8')
-if "number of differences found" in output:
-validLog = open(fileURL[7:]+".log.odfundiff", "w")
-validLog.write(output)
-validLog.close()
-handleODFunDiff(filename)
-except subprocess.CalledProcessError:
-pass
+def isPreviousExist():
+previous_path = "/srv/crashtestdata/previous"
+if os.path.exists(previous_path):
+return True
+return False
+
+def saveAsPreviousState(exported_files):
+odf_file_ext = ['odt', 'ods', 'odp', 'odb']
+previous_path = "/srv/crashtestdata/previous/srv/crashtestdata/files/odt"
+if os.path.exists(previous_path):
+rmtree("/srv/crashtestdata/previous")
+os.makedirs(previous_path)
+
+for file in exportedFiles:
+ext = file[-3:]
+if ext in odf_file_ext:
+copyfile("/srv/crashtestdata/current"+file, 
"/srv/crashtestdata/previous"+file)
+
+def getODFunDiffCommand():
+return os.environ["HOME"] + "/source/bin/odfundiff-exe"
 
 class ExportFileTest:
 def __init__(self, xDoc, filename, enable_validation, timer):
@@ -434,7 +443,6 @@ class ExportFileTest:
 for format in formats:
 filterName = self.getFilterName(format)
 validation = self.getValidationCommand(filterName)
-odfundiff = self.getODFunDiffCommand(filterName)
 print(format)
 print(filterName)
 if filterName:
@@ -442,7 +450,8 @@ class ExportFileTest:
 filename = base + extensions[filterName]
 self.exportedFiles.append(filename)
 
-xExportedDoc = exportDoc(self.xDoc, filterName, validation, 
odfundiff, filename, connection, self.timer)
+xExportedDoc = exportDoc(self.xDoc, filterName, validation, 
filename, connection, self.timer)
+
 if xExportedDoc:
 xExportedDoc.close(True)
 
@@ -493,10 +502,6 @@ class ExportFileTest:
 return None
 return validationCommand[filterName]
 
-def getODFunDiffCommand(self, filterName):
-if filterName == "writer8":
-return os.environ["HOME"] + "/source/bin/odfundiff-exe"
-return None
 
 def getFilterName(self, format):
 filterNames = { "ods": "calc8",
@@ -668,6 +673,24 @@ if __name__ == "__main__":
 
 # Check the roundtripped files doesn't crash at import time
 runLoadFileTests(opts, exportedFiles, False)
+
+if not isPreviousExist():
+saveAsPreviousState(exportedFiles)
+else:
+   

[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

2021-08-12 Thread Gülşah Köse (via logerrit)
 test-bugzilla-files/test-bugzilla-files.py |   31 ++---
 1 file changed, 28 insertions(+), 3 deletions(-)

New commits:
commit 71d3bfc24a3385351903e1b399e6050150ea5038
Author: Gülşah Köse 
AuthorDate: Tue Aug 10 16:40:06 2021 +0300
Commit: Miklos Vajna 
CommitDate: Thu Aug 12 13:28:17 2021 +0200

Initial ODFunDiff integration to crash report tool.

Change-Id: I05729cc4abe9d87e549933c9db63133b666cedfb
Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/120273
Tested-by: Miklos Vajna 
Reviewed-by: Miklos Vajna 

diff --git a/test-bugzilla-files/test-bugzilla-files.py 
b/test-bugzilla-files/test-bugzilla-files.py
index 0d1121c..1b2ade0 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -332,6 +332,13 @@ def handleCrash(file, disposed):
 #crashed_files.append(file)
 # add here the remaining handling code for crashed files
 
+def handleODFunDiff(file):
+print("File: " + file + " has differences")
+diffLog = open("odfundifflog.txt", "a")
+diffLog.write(file + ' has differences after saving')
+diffLog.write('\n')
+diffLog.close()
+
 def alarm_handler(args):
 args.kill()
 
@@ -340,7 +347,7 @@ def writeExportCrash(fileName):
 exportCrash.write(fileName + '\n')
 exportCrash.close()
 
-def exportDoc(xDoc, filterName, validationCommand, filename, connection, 
timer):
+def exportDoc(xDoc, filterName, validationCommand, odfundiffCommand, filename, 
connection, timer):
 props = [ ("FilterName", filterName) ]
 saveProps = tuple([mkPropertyValue(name, value) for (name, value) in 
props])
 # note: avoid empty path segments in the url!
@@ -385,7 +392,19 @@ def exportDoc(xDoc, filterName, validationCommand, 
filename, connection, timer):
 validLog.close()
 except subprocess.CalledProcessError:
 pass # ignore that exception
-
+
+if odfundiffCommand:
+odfundiffCommandWithURL = odfundiffCommand + " " + filename + " 
/srv/crashtestdata/current" + filename
+print(odfundiffCommandWithURL)
+try:
+output = str(subprocess.check_output(odfundiffCommandWithURL, 
shell=True, timeout=600), encoding='utf-8')
+if "number of differences found" in output:
+validLog = open(fileURL[7:]+".log.odfundiff", "w")
+validLog.write(output)
+validLog.close()
+handleODFunDiff(filename)
+except subprocess.CalledProcessError:
+pass
 
 class ExportFileTest:
 def __init__(self, xDoc, filename, enable_validation, timer):
@@ -415,6 +434,7 @@ class ExportFileTest:
 for format in formats:
 filterName = self.getFilterName(format)
 validation = self.getValidationCommand(filterName)
+odfundiff = self.getODFunDiffCommand(filterName)
 print(format)
 print(filterName)
 if filterName:
@@ -422,7 +442,7 @@ class ExportFileTest:
 filename = base + extensions[filterName]
 self.exportedFiles.append(filename)
 
-xExportedDoc = exportDoc(self.xDoc, filterName, validation, 
filename, connection, self.timer)
+xExportedDoc = exportDoc(self.xDoc, filterName, validation, 
odfundiff, filename, connection, self.timer)
 if xExportedDoc:
 xExportedDoc.close(True)
 
@@ -473,6 +493,11 @@ class ExportFileTest:
 return None
 return validationCommand[filterName]
 
+def getODFunDiffCommand(self, filterName):
+if filterName == "writer8":
+return "/home/buildslave/source/bin/odfundiff-exe"
+return None
+
 def getFilterName(self, format):
 filterNames = { "ods": "calc8",
 "xls": "MS Excel 97",


[Libreoffice-commits] core.git: Branch 'feature/ooxml-analyze' - bin/ooxml-analyze.py

2021-07-20 Thread Gülşah Köse (via logerrit)
 bin/ooxml-analyze.py |  100 +--
 1 file changed, 42 insertions(+), 58 deletions(-)

New commits:
commit 18e89687fde3b3cfac00ead00cbefbb98262cdfe
Author: Gülşah Köse 
AuthorDate: Tue Jul 20 14:15:42 2021 +0300
Commit: Gülşah Köse 
CommitDate: Tue Jul 20 14:20:55 2021 +0300

remove namespace replacing and some small updates

Change-Id: I2d56668186c8745fca683025710646ae505a0d6b

diff --git a/bin/ooxml-analyze.py b/bin/ooxml-analyze.py
index 87acd377c854..cc7a7a036980 100755
--- a/bin/ooxml-analyze.py
+++ b/bin/ooxml-analyze.py
@@ -80,21 +80,22 @@ def extract_files(inputdir, extracted_files_dir):
 shutil.rmtree(extracted_files_dir)
 
 # unzip files into the extracted files directory
-for filename in os.listdir(inputdir):
-if (filename.endswith(".pptx") or   \
-filename.endswith(".docx") or   \
-filename.endswith(".xlsx")) and not \
-filename.startswith("~"):
-filepath = os.path.join(inputdir, filename)
-extracted_file_path = os.path.join(extracted_files_dir, filename)
-
-try:
-with ZipFile(filepath) as zipObj:
-zipObj.extractall(extracted_file_path)
-except:
-print("%s is problematic" % filename)
-else:
-continue
+for filetype in get_list_of_subdir(inputdir):
+for filename in os.listdir(filetype):
+if (filename.endswith(".pptx") or   \
+filename.endswith(".docx") or   \
+filename.endswith(".xlsx")) and not \
+filename.startswith("~"):
+filepath = os.path.join(filetype, filename)
+extracted_file_path = os.path.join(extracted_files_dir, 
filename)
+
+try:
+with ZipFile(filepath) as zipObj:
+zipObj.extractall(extracted_file_path)
+except:
+print("%s is problematic" % filename)
+else:
+continue
 
 # get key of value in dictionary
 def get_key(val, dict):
@@ -116,34 +117,17 @@ def replace_namespace_with_alias(filename, element):
 element = element.replace("{" + element_ns + "}", "")
 return element
 
-# decides which files shouldn't be analyzed.
+# decides which files should/shouldn't be analyzed.
 def is_file_in_accepted_files(filename):
-if(filename.endswith("[Content_Types].xml") or \
-   filename.endswith("docProps/custom.xml") or \
-   filename.endswith("docProps/app.xml") or\
-   filename.endswith("presentation.xml") or \
-   filename.endswith("viewProps.xml") or \
-   filename.endswith("tableStyles.xml") or \
-   filename.endswith("presProps.xml") or \
-   "ppt/slideLayouts" in filename or \
-   "ppt/slideMasters" in filename or \
-   "ppt/theme" in filename or \
-   "ppt/notesMasters" in filename or \
-   "ppt/notesSlides" in filename or \
-   "ppt/handoutMasters" in filename or \
-   "ppt/tags" in filename or \
-   "pptx/customXml" in filename or \
-   "ppt/diagrams" in filename or \
-   filename.endswith("docProps/core.xml") or not \
-   filename.endswith(".xml")):
-   return False
-
-return True
+if(filename.endswith(".xml") and "ppt/slides/" in filename):
+   return True
+
+return False
 
 # counts tags, attribute names and values of xmls
 def count_elements(extracted_files_dir, result_list, concanated_texts_list):
 
-# make sure if extracted files directory exist
+# make sure if extracted files directory not exist
 if not (os.path.exists(extracted_files_dir)):
 print("Extracted files directory is not exist")
 return
@@ -160,7 +144,7 @@ def count_elements(extracted_files_dir, result_list, 
concanated_texts_list):
 try:
 # start to count
 for event, child in etree.iterparse(xmlfile, events=('start', 
'end')):
-tag = replace_namespace_with_alias(xmlfile, child.tag)
+tag = child.tag #replace_namespace_with_alias(xmlfile, 
child.tag)
 tag_idx = get_index_of_tag(tag, result_list)
 
 if event == "start":
@@ -171,30 +155,29 @@ def count_elements(extracted_files_dir, result_list, 
concanated_texts_list):
 else:
 result_list[tag_idx][0][tag] += 1
 
-# count attribute names and values of current tag
-for attr_name, attr_value in child.attrib.items():
-attr_name = replace_namespace_with_alias(xmlfile, 
attr_name)
-if not attr_name in result_list[tag_idx][1].keys():
-result_list[tag_idx][1][attr_name] = 1
-else:
-result_list[tag_idx][1][attr_name] +=1
-
-if not 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/oox oox/source sc/source sd/qa

2021-07-12 Thread Gülşah Köse (via logerrit)
 include/oox/core/contexthandler2.hxx  |   19 +
 include/oox/core/fragmenthandler2.hxx |   11 ---
 include/oox/drawingml/graphicshapecontext.hxx |1 
 include/oox/ole/oleobjecthelper.hxx   |1 
 oox/source/core/contexthandler2.cxx   |   85 +-
 oox/source/core/fragmenthandler2.cxx  |   70 -
 oox/source/drawingml/graphicshapecontext.cxx  |   11 +++
 sc/source/filter/oox/worksheetfragment.cxx|6 -
 sd/qa/unit/data/pptx/tdf143222.pptx   |binary
 sd/qa/unit/export-tests-ooxml2.cxx|   30 +
 10 files changed, 148 insertions(+), 86 deletions(-)

New commits:
commit 4151286957e28f915a254468aa692bc7e8d3ab8e
Author: Gülşah Köse 
AuthorDate: Wed Jul 7 00:27:58 2021 +0300
Commit: Gülşah Köse 
CommitDate: Mon Jul 12 15:46:23 2021 +0200

tdf143222 Handle alternate content of graphicData element.

Handle alternate content and make true choice.

According to ooxml spec ole object requires exactly one pic
element. (ECMA-376 Part 1, Annex A, CT_OleObject). In the
current case first choice has not pic element and we should
allow fallback processing.

Change-Id: I30b7de703b8c2f00d6bf286e05eea505ac3627f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118539
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118678
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mike Kaganski 

diff --git a/include/oox/core/contexthandler2.hxx 
b/include/oox/core/contexthandler2.hxx
index 678aed1380c2..279459075980 100644
--- a/include/oox/core/contexthandler2.hxx
+++ b/include/oox/core/contexthandler2.hxx
@@ -73,7 +73,7 @@ struct ElementInfo;
 class OOX_DLLPUBLIC ContextHandler2Helper
 {
 public:
-explicitContextHandler2Helper( bool bEnableTrimSpace );
+explicitContextHandler2Helper( bool bEnableTrimSpace, 
XmlFilterBase& rFilter );
 explicitContextHandler2Helper( const ContextHandler2Helper& 
rParent );
 virtual ~ContextHandler2Helper();
 
@@ -202,6 +202,21 @@ protected:
 /** Must be called from endRecord() in derived classes. */
 voidimplEndRecord( sal_Int32 nRecId );
 
+boolprepareMceContext( sal_Int32 nElement, const 
AttributeList& rAttribs );
+XmlFilterBase&  getDocFilter() const { return mrFilter; }
+
+enum class MCE_STATE
+{
+Started,
+FoundChoice
+};
+
+MCE_STATE   getMCEState() const { return aMceState.back(); }
+voidsetMCEState( MCE_STATE aState ) { aMceState.back() = 
aState; }
+voidaddMCEState( MCE_STATE aState ) { aMceState.push_back( 
aState ); }
+voidremoveMCEState() { aMceState.pop_back(); }
+boolisMCEStateEmpty() { return aMceState.empty(); }
+
 private:
 ContextHandler2Helper& operator=( const ContextHandler2Helper& ) = delete;
 
@@ -215,9 +230,11 @@ private:
 
 ContextStackRef mxContextStack; ///< Stack of all processed 
elements.
 size_t constmnRootStackSize;///< Stack size on construction 
time.
+std::vector aMceState;
 
 protected:
 boolmbEnableTrimSpace;  ///< True = trim whitespace in 
characters().
+XmlFilterBase&  mrFilter;
 };
 
 class OOX_DLLPUBLIC ContextHandler2 : public ContextHandler, public 
ContextHandler2Helper
diff --git a/include/oox/core/fragmenthandler2.hxx 
b/include/oox/core/fragmenthandler2.hxx
index 7c64c200041d..162ec8565fdb 100644
--- a/include/oox/core/fragmenthandler2.hxx
+++ b/include/oox/core/fragmenthandler2.hxx
@@ -48,17 +48,6 @@ class XmlFilterBase;
 
 class OOX_DLLPUBLIC FragmentHandler2 : public FragmentHandler, public 
ContextHandler2Helper
 {
-protected:
-enum class MCE_STATE
-{
-Started,
-FoundChoice
-};
-::std::vector   aMceState;
-
-boolprepareMceContext( sal_Int32 nElement, const 
AttributeList& rAttribs );
-
-
 public:
 explicitFragmentHandler2(
 XmlFilterBase& rFilter,
diff --git a/include/oox/drawingml/graphicshapecontext.hxx 
b/include/oox/drawingml/graphicshapecontext.hxx
index 14b49f23615c..c27a8e6cfa8d 100644
--- a/include/oox/drawingml/graphicshapecontext.hxx
+++ b/include/oox/drawingml/graphicshapecontext.hxx
@@ -62,6 +62,7 @@ public:
 OleObjectGraphicDataContext( ::oox::core::ContextHandler2Helper const & 
rParent, const ShapePtr& pShapePtr );
 virtual ~OleObjectGraphicDataContext() override;
 virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 
Element, const ::oox::AttributeList& rAttribs ) override;
+virtual void onEndElement() override;
 
 private:
 ::oox::vml::OleObjectInfo& mrOleObjectInfo;
diff --git a/include/oox/ole/oleobjecthelper.hxx 
b/include/oox/ole/oleobjecthelper.hxx
index 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - include/oox oox/source sc/source sd/qa

2021-07-12 Thread Gülşah Köse (via logerrit)
 include/oox/core/contexthandler2.hxx  |   19 +
 include/oox/core/fragmenthandler2.hxx |   11 ---
 include/oox/drawingml/graphicshapecontext.hxx |1 
 include/oox/ole/oleobjecthelper.hxx   |1 
 oox/source/core/contexthandler2.cxx   |   85 +-
 oox/source/core/fragmenthandler2.cxx  |   70 -
 oox/source/drawingml/graphicshapecontext.cxx  |   11 +++
 sc/source/filter/oox/worksheetfragment.cxx|6 -
 sd/qa/unit/data/pptx/tdf143222.pptx   |binary
 sd/qa/unit/export-tests-ooxml2.cxx|   30 +
 10 files changed, 148 insertions(+), 86 deletions(-)

New commits:
commit 876b0ae4b50ed85ab0975215efda805248a46993
Author: Gülşah Köse 
AuthorDate: Wed Jul 7 00:27:58 2021 +0300
Commit: Gülşah Köse 
CommitDate: Mon Jul 12 15:46:03 2021 +0200

tdf143222 Handle alternate content of graphicData element.

Handle alternate content and make true choice.

According to ooxml spec ole object requires exactly one pic
element. (ECMA-376 Part 1, Annex A, CT_OleObject). In the
current case first choice has not pic element and we should
allow fallback processing.

Change-Id: I30b7de703b8c2f00d6bf286e05eea505ac3627f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118539
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118676
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mike Kaganski 

diff --git a/include/oox/core/contexthandler2.hxx 
b/include/oox/core/contexthandler2.hxx
index 872a50697ca1..3e6b34ad4be6 100644
--- a/include/oox/core/contexthandler2.hxx
+++ b/include/oox/core/contexthandler2.hxx
@@ -72,7 +72,7 @@ struct ElementInfo;
 class OOX_DLLPUBLIC ContextHandler2Helper
 {
 public:
-explicitContextHandler2Helper( bool bEnableTrimSpace );
+explicitContextHandler2Helper( bool bEnableTrimSpace, 
XmlFilterBase& rFilter );
 explicitContextHandler2Helper( const ContextHandler2Helper& 
rParent );
 virtual ~ContextHandler2Helper();
 
@@ -201,6 +201,21 @@ protected:
 /** Must be called from endRecord() in derived classes. */
 voidimplEndRecord( sal_Int32 nRecId );
 
+boolprepareMceContext( sal_Int32 nElement, const 
AttributeList& rAttribs );
+XmlFilterBase&  getDocFilter() const { return mrFilter; }
+
+enum class MCE_STATE
+{
+Started,
+FoundChoice
+};
+
+MCE_STATE   getMCEState() const { return aMceState.back(); }
+voidsetMCEState( MCE_STATE aState ) { aMceState.back() = 
aState; }
+voidaddMCEState( MCE_STATE aState ) { aMceState.push_back( 
aState ); }
+voidremoveMCEState() { aMceState.pop_back(); }
+boolisMCEStateEmpty() { return aMceState.empty(); }
+
 private:
 ContextHandler2Helper& operator=( const ContextHandler2Helper& ) = delete;
 
@@ -214,9 +229,11 @@ private:
 
 ContextStackRef mxContextStack; ///< Stack of all processed 
elements.
 size_t  mnRootStackSize;///< Stack size on construction 
time.
+std::vector aMceState;
 
 protected:
 boolmbEnableTrimSpace;  ///< True = trim whitespace in 
characters().
+XmlFilterBase&  mrFilter;
 };
 
 class OOX_DLLPUBLIC ContextHandler2 : public ContextHandler, public 
ContextHandler2Helper
diff --git a/include/oox/core/fragmenthandler2.hxx 
b/include/oox/core/fragmenthandler2.hxx
index d5d449847c17..d7950a0b6230 100644
--- a/include/oox/core/fragmenthandler2.hxx
+++ b/include/oox/core/fragmenthandler2.hxx
@@ -47,17 +47,6 @@ class XmlFilterBase;
 
 class OOX_DLLPUBLIC FragmentHandler2 : public FragmentHandler, public 
ContextHandler2Helper
 {
-protected:
-enum class MCE_STATE
-{
-Started,
-FoundChoice
-};
-::std::vector   aMceState;
-
-boolprepareMceContext( sal_Int32 nElement, const 
AttributeList& rAttribs );
-
-
 public:
 explicitFragmentHandler2(
 XmlFilterBase& rFilter,
diff --git a/include/oox/drawingml/graphicshapecontext.hxx 
b/include/oox/drawingml/graphicshapecontext.hxx
index 4813d5fc9aed..ffd579f00bb1 100644
--- a/include/oox/drawingml/graphicshapecontext.hxx
+++ b/include/oox/drawingml/graphicshapecontext.hxx
@@ -62,6 +62,7 @@ public:
 OleObjectGraphicDataContext( ::oox::core::ContextHandler2Helper const & 
rParent, const ShapePtr& pShapePtr );
 virtual ~OleObjectGraphicDataContext() override;
 virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 
Element, const ::oox::AttributeList& rAttribs ) override;
+virtual void onEndElement() override;
 
 private:
 ::oox::vml::OleObjectInfo& mrOleObjectInfo;
diff --git a/include/oox/ole/oleobjecthelper.hxx 
b/include/oox/ole/oleobjecthelper.hxx
index 

[Libreoffice-commits] core.git: include/oox oox/source sc/source sd/qa

2021-07-08 Thread Gülşah Köse (via logerrit)
 include/oox/core/contexthandler2.hxx  |   19 +
 include/oox/core/fragmenthandler2.hxx |   11 ---
 include/oox/drawingml/graphicshapecontext.hxx |1 
 include/oox/ole/oleobjecthelper.hxx   |1 
 oox/source/core/contexthandler2.cxx   |   85 +-
 oox/source/core/fragmenthandler2.cxx  |   70 -
 oox/source/drawingml/graphicshapecontext.cxx  |   11 +++
 sc/source/filter/oox/worksheetfragment.cxx|6 -
 sd/qa/unit/data/pptx/tdf143222.pptx   |binary
 sd/qa/unit/export-tests-ooxml3.cxx|   30 +
 10 files changed, 148 insertions(+), 86 deletions(-)

New commits:
commit 92a407b7f90a98704a238c5ffa3a3491eaf3263a
Author: Gülşah Köse 
AuthorDate: Wed Jul 7 00:27:58 2021 +0300
Commit: Gülşah Köse 
CommitDate: Thu Jul 8 23:12:07 2021 +0200

tdf143222 Handle alternate content of graphicData element.

Handle alternate content and make true choice.

According to ooxml spec ole object requires exactly one pic
element. (ECMA-376 Part 1, Annex A, CT_OleObject). In the
current case first choice has not pic element and we should
allow fallback processing.

Change-Id: I30b7de703b8c2f00d6bf286e05eea505ac3627f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118539
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/include/oox/core/contexthandler2.hxx 
b/include/oox/core/contexthandler2.hxx
index 4e256089ac8e..3a75aff5706a 100644
--- a/include/oox/core/contexthandler2.hxx
+++ b/include/oox/core/contexthandler2.hxx
@@ -72,7 +72,7 @@ struct ElementInfo;
 class OOX_DLLPUBLIC ContextHandler2Helper
 {
 public:
-explicitContextHandler2Helper( bool bEnableTrimSpace );
+explicitContextHandler2Helper( bool bEnableTrimSpace, 
XmlFilterBase& rFilter );
 explicitContextHandler2Helper( const ContextHandler2Helper& 
rParent );
 virtual ~ContextHandler2Helper();
 
@@ -201,6 +201,21 @@ protected:
 /** Must be called from endRecord() in derived classes. */
 voidimplEndRecord( sal_Int32 nRecId );
 
+boolprepareMceContext( sal_Int32 nElement, const 
AttributeList& rAttribs );
+XmlFilterBase&  getDocFilter() const { return mrFilter; }
+
+enum class MCE_STATE
+{
+Started,
+FoundChoice
+};
+
+MCE_STATE   getMCEState() const { return aMceState.back(); }
+voidsetMCEState( MCE_STATE aState ) { aMceState.back() = 
aState; }
+voidaddMCEState( MCE_STATE aState ) { aMceState.push_back( 
aState ); }
+voidremoveMCEState() { aMceState.pop_back(); }
+boolisMCEStateEmpty() { return aMceState.empty(); }
+
 private:
 ContextHandler2Helper& operator=( const ContextHandler2Helper& ) = delete;
 
@@ -214,9 +229,11 @@ private:
 
 ContextStackRef mxContextStack; ///< Stack of all processed 
elements.
 size_t  mnRootStackSize;///< Stack size on construction 
time.
+std::vector aMceState;
 
 protected:
 boolmbEnableTrimSpace;  ///< True = trim whitespace in 
characters().
+XmlFilterBase&  mrFilter;
 };
 
 class OOX_DLLPUBLIC ContextHandler2 : public ContextHandler, public 
ContextHandler2Helper
diff --git a/include/oox/core/fragmenthandler2.hxx 
b/include/oox/core/fragmenthandler2.hxx
index 86d1453f13a1..598426ee681e 100644
--- a/include/oox/core/fragmenthandler2.hxx
+++ b/include/oox/core/fragmenthandler2.hxx
@@ -47,17 +47,6 @@ class XmlFilterBase;
 
 class OOX_DLLPUBLIC FragmentHandler2 : public FragmentHandler, public 
ContextHandler2Helper
 {
-protected:
-enum class MCE_STATE
-{
-Started,
-FoundChoice
-};
-::std::vector   aMceState;
-
-boolprepareMceContext( sal_Int32 nElement, const 
AttributeList& rAttribs );
-
-
 public:
 explicitFragmentHandler2(
 XmlFilterBase& rFilter,
diff --git a/include/oox/drawingml/graphicshapecontext.hxx 
b/include/oox/drawingml/graphicshapecontext.hxx
index 4813d5fc9aed..ffd579f00bb1 100644
--- a/include/oox/drawingml/graphicshapecontext.hxx
+++ b/include/oox/drawingml/graphicshapecontext.hxx
@@ -62,6 +62,7 @@ public:
 OleObjectGraphicDataContext( ::oox::core::ContextHandler2Helper const & 
rParent, const ShapePtr& pShapePtr );
 virtual ~OleObjectGraphicDataContext() override;
 virtual ::oox::core::ContextHandlerRef onCreateContext( ::sal_Int32 
Element, const ::oox::AttributeList& rAttribs ) override;
+virtual void onEndElement() override;
 
 private:
 ::oox::vml::OleObjectInfo& mrOleObjectInfo;
diff --git a/include/oox/ole/oleobjecthelper.hxx 
b/include/oox/ole/oleobjecthelper.hxx
index d2506f3d4949..5b792f2048b1 100644
--- a/include/oox/ole/oleobjecthelper.hxx
+++ b/include/oox/ole/oleobjecthelper.hxx
@@ -47,6 +47,7 @@ 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - editeng/source sd/qa

2021-06-23 Thread Gülşah Köse (via logerrit)
 editeng/source/uno/unotext.cxx  |   14 +++---
 sd/qa/unit/data/pptx/tdf142716.pptx |binary
 sd/qa/unit/export-tests.cxx |   18 ++
 3 files changed, 25 insertions(+), 7 deletions(-)

New commits:
commit adaea81bf63815fb171850ea9f4a2e9c9f2144d1
Author: Gülşah Köse 
AuthorDate: Fri Jun 18 11:23:41 2021 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 23 15:06:33 2021 +0200

tdf#142716 Update selection after any text is inserted.

When we don't update the selection after insertion of new text
SvxUnoTextBase::createEnumeration knows old selection and losts last part
of the text.

Change-Id: I20f6530f34097ff213ff00cff617139887fd287a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117409
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
(cherry picked from commit e837f50313a703b6b26abb78f224472c1e4734ea)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117557
Reviewed-by: Mike Kaganski 

diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 6761f8b8b622..81699a1365d3 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1732,13 +1732,6 @@ void SAL_CALL SvxUnoTextBase::insertString( const 
uno::Reference< text::XTextRan
 if( !xRange.is() )
 return;
 
-if (GetEditSource())
-{
-ESelection aSelection;
-::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
-SetSelection( aSelection );
-}
-
 SvxUnoTextRangeBase* pRange = 
comphelper::getUnoTunnelImplementation( xRange );
 if(!pRange)
 return;
@@ -1754,6 +1747,13 @@ void SAL_CALL SvxUnoTextBase::insertString( const 
uno::Reference< text::XTextRan
 pRange->setString( aString );
 
 pRange->CollapseToEnd();
+
+if (GetEditSource())
+{
+ESelection aSelection;
+::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
+SetSelection( aSelection );
+}
 }
 
 void SAL_CALL SvxUnoTextBase::insertControlCharacter( const uno::Reference< 
text::XTextRange >& xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb )
diff --git a/sd/qa/unit/data/pptx/tdf142716.pptx 
b/sd/qa/unit/data/pptx/tdf142716.pptx
new file mode 100644
index ..4ef29e389449
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf142716.pptx differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index d8a214804643..ce57bd18271d 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -57,6 +57,7 @@ public:
 void testImageWithSpecialID();
 void testTdf62176();
 void testTransparentBackground();
+void testTdf142716();
 void testEmbeddedPdf();
 void testEmbeddedText();
 void testTransparenText();
@@ -97,6 +98,7 @@ public:
 CPPUNIT_TEST(testImageWithSpecialID);
 CPPUNIT_TEST(testTdf62176);
 CPPUNIT_TEST(testTransparentBackground);
+CPPUNIT_TEST(testTdf142716);
 CPPUNIT_TEST(testEmbeddedPdf);
 CPPUNIT_TEST(testEmbeddedText);
 CPPUNIT_TEST(testTransparenText);
@@ -295,6 +297,22 @@ void SdExportTest::testTransparentBackground()
 xDocShRef->DoClose();
 }
 
+void SdExportTest::testTdf142716()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf142716.pptx"), 
PPTX);
+xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+
+const SdrPage *pPage = GetPage( 1, xDocShRef );
+const SdrTextObj *pObj = dynamic_cast( pPage->GetObj( 0 ) );
+
+OUString sText = pObj->GetOutlinerParaObject()->GetTextObject().GetText(0);
+
+// Without fix "yyy" part will be lost.
+CPPUNIT_ASSERT_EQUAL( OUString( "xxx and yyy" ), sText);
+
+xDocShRef->DoClose();
+}
+
 void SdExportTest::testMediaEmbedding()
 {
 #ifdef _WIN32
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - editeng/source sd/qa

2021-06-23 Thread Gülşah Köse (via logerrit)
 editeng/source/uno/unotext.cxx  |   14 +++---
 sd/qa/unit/data/pptx/tdf142716.pptx |binary
 sd/qa/unit/export-tests.cxx |   18 ++
 3 files changed, 25 insertions(+), 7 deletions(-)

New commits:
commit d212119828a71e4dc72b6e09532e3628a4597d35
Author: Gülşah Köse 
AuthorDate: Fri Jun 18 11:23:41 2021 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 23 15:05:56 2021 +0200

tdf#142716 Update selection after any text is inserted.

When we don't update the selection after insertion of new text
SvxUnoTextBase::createEnumeration knows old selection and losts last part
of the text.

Change-Id: I20f6530f34097ff213ff00cff617139887fd287a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117409
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
(cherry picked from commit e837f50313a703b6b26abb78f224472c1e4734ea)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117556
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mike Kaganski 

diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 4796732b2c74..246bdc370be6 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1736,13 +1736,6 @@ void SAL_CALL SvxUnoTextBase::insertString( const 
uno::Reference< text::XTextRan
 if( !xRange.is() )
 return;
 
-ESelection aSelection;
-if (GetEditSource())
-{
-::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
-SetSelection( aSelection );
-}
-
 SvxUnoTextRangeBase* pRange = 
comphelper::getUnoTunnelImplementation( xRange );
 if(pRange)
 {
@@ -1757,6 +1750,13 @@ void SAL_CALL SvxUnoTextBase::insertString( const 
uno::Reference< text::XTextRan
 pRange->setString( aString );
 
 pRange->CollapseToEnd();
+
+ESelection aSelection;
+if (GetEditSource())
+{
+::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
+SetSelection( aSelection );
+}
 }
 }
 
diff --git a/sd/qa/unit/data/pptx/tdf142716.pptx 
b/sd/qa/unit/data/pptx/tdf142716.pptx
new file mode 100644
index ..4ef29e389449
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf142716.pptx differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index fdad324b216a..f246f6568534 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -56,6 +56,7 @@ public:
 void testImageWithSpecialID();
 void testTdf62176();
 void testTransparentBackground();
+void testTdf142716();
 void testEmbeddedPdf();
 void testEmbeddedText();
 void testTransparenText();
@@ -90,6 +91,7 @@ public:
 CPPUNIT_TEST(testImageWithSpecialID);
 CPPUNIT_TEST(testTdf62176);
 CPPUNIT_TEST(testTransparentBackground);
+CPPUNIT_TEST(testTdf142716);
 CPPUNIT_TEST(testEmbeddedPdf);
 CPPUNIT_TEST(testEmbeddedText);
 CPPUNIT_TEST(testTransparenText);
@@ -282,6 +284,22 @@ void SdExportTest::testTransparentBackground()
 xDocShRef->DoClose();
 }
 
+void SdExportTest::testTdf142716()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf142716.pptx"), 
PPTX);
+xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+
+const SdrPage *pPage = GetPage( 1, xDocShRef );
+const SdrTextObj *pObj = dynamic_cast( pPage->GetObj( 0 ) );
+
+OUString sText = pObj->GetOutlinerParaObject()->GetTextObject().GetText(0);
+
+// Without fix "yyy" part will be lost.
+CPPUNIT_ASSERT_EQUAL( OUString( "xxx and yyy" ), sText);
+
+xDocShRef->DoClose();
+}
+
 void SdExportTest::testMediaEmbedding()
 {
 if (!OpenGLWrapper::isVCLOpenGLEnabled())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - editeng/source sd/qa

2021-06-23 Thread Gülşah Köse (via logerrit)
 editeng/source/uno/unotext.cxx  |   14 +++---
 sd/qa/unit/data/pptx/tdf142716.pptx |binary
 sd/qa/unit/export-tests.cxx |   18 ++
 3 files changed, 25 insertions(+), 7 deletions(-)

New commits:
commit ce275a824aab6601c9de0b61f4b8568b9478ce19
Author: Gülşah Köse 
AuthorDate: Fri Jun 18 11:23:41 2021 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 23 15:05:20 2021 +0200

tdf#142716 Update selection after any text is inserted.

When we don't update the selection after insertion of new text
SvxUnoTextBase::createEnumeration knows old selection and losts last part
of the text.

Change-Id: I20f6530f34097ff213ff00cff617139887fd287a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117409
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
(cherry picked from commit e837f50313a703b6b26abb78f224472c1e4734ea)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117555
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mike Kaganski 

diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 6761f8b8b622..81699a1365d3 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1732,13 +1732,6 @@ void SAL_CALL SvxUnoTextBase::insertString( const 
uno::Reference< text::XTextRan
 if( !xRange.is() )
 return;
 
-if (GetEditSource())
-{
-ESelection aSelection;
-::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
-SetSelection( aSelection );
-}
-
 SvxUnoTextRangeBase* pRange = 
comphelper::getUnoTunnelImplementation( xRange );
 if(!pRange)
 return;
@@ -1754,6 +1747,13 @@ void SAL_CALL SvxUnoTextBase::insertString( const 
uno::Reference< text::XTextRan
 pRange->setString( aString );
 
 pRange->CollapseToEnd();
+
+if (GetEditSource())
+{
+ESelection aSelection;
+::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
+SetSelection( aSelection );
+}
 }
 
 void SAL_CALL SvxUnoTextBase::insertControlCharacter( const uno::Reference< 
text::XTextRange >& xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb )
diff --git a/sd/qa/unit/data/pptx/tdf142716.pptx 
b/sd/qa/unit/data/pptx/tdf142716.pptx
new file mode 100644
index ..4ef29e389449
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf142716.pptx differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 6f21892531a6..9ef3565a063b 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -59,6 +59,7 @@ public:
 void testImageWithSpecialID();
 void testTdf62176();
 void testTransparentBackground();
+void testTdf142716();
 void testEmbeddedPdf();
 void testEmbeddedText();
 void testTransparenText();
@@ -100,6 +101,7 @@ public:
 CPPUNIT_TEST(testImageWithSpecialID);
 CPPUNIT_TEST(testTdf62176);
 CPPUNIT_TEST(testTransparentBackground);
+CPPUNIT_TEST(testTdf142716);
 CPPUNIT_TEST(testEmbeddedPdf);
 CPPUNIT_TEST(testEmbeddedText);
 CPPUNIT_TEST(testTransparenText);
@@ -299,6 +301,22 @@ void SdExportTest::testTransparentBackground()
 xDocShRef->DoClose();
 }
 
+void SdExportTest::testTdf142716()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf142716.pptx"), 
PPTX);
+xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+
+const SdrPage *pPage = GetPage( 1, xDocShRef );
+const SdrTextObj *pObj = dynamic_cast( pPage->GetObj( 0 ) );
+
+OUString sText = pObj->GetOutlinerParaObject()->GetTextObject().GetText(0);
+
+// Without fix "yyy" part will be lost.
+CPPUNIT_ASSERT_EQUAL( OUString( "xxx and yyy" ), sText);
+
+xDocShRef->DoClose();
+}
+
 void SdExportTest::testMediaEmbedding()
 {
 #ifdef _WIN32
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - editeng/source sd/qa

2021-06-21 Thread Gülşah Köse (via logerrit)
 editeng/source/uno/unotext.cxx  |   14 +++---
 sd/qa/unit/data/pptx/tdf142716.pptx |binary
 sd/qa/unit/export-tests.cxx |   18 ++
 3 files changed, 25 insertions(+), 7 deletions(-)

New commits:
commit 1da6972c716256f908ea11549b6566877ce1e580
Author: Gülşah Köse 
AuthorDate: Fri Jun 18 11:23:41 2021 +0300
Commit: Xisco Fauli 
CommitDate: Mon Jun 21 13:36:46 2021 +0200

tdf#142716 Update selection after any text is inserted.

When we don't update the selection after insertion of new text
SvxUnoTextBase::createEnumeration knows old selection and losts last part
of the text.

Change-Id: I20f6530f34097ff213ff00cff617139887fd287a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117409
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
(cherry picked from commit e837f50313a703b6b26abb78f224472c1e4734ea)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117558
Reviewed-by: Xisco Fauli 

diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 20d901e0d300..cae30b9eaa99 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1739,13 +1739,6 @@ void SAL_CALL SvxUnoTextBase::insertString( const 
uno::Reference< text::XTextRan
 if( !xRange.is() )
 return;
 
-if (GetEditSource())
-{
-ESelection aSelection;
-::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
-SetSelection( aSelection );
-}
-
 SvxUnoTextRangeBase* pRange = 
comphelper::getUnoTunnelImplementation( xRange );
 if(!pRange)
 return;
@@ -1761,6 +1754,13 @@ void SAL_CALL SvxUnoTextBase::insertString( const 
uno::Reference< text::XTextRan
 pRange->setString( aString );
 
 pRange->CollapseToEnd();
+
+if (GetEditSource())
+{
+ESelection aSelection;
+::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
+SetSelection( aSelection );
+}
 }
 
 void SAL_CALL SvxUnoTextBase::insertControlCharacter( const uno::Reference< 
text::XTextRange >& xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb )
diff --git a/sd/qa/unit/data/pptx/tdf142716.pptx 
b/sd/qa/unit/data/pptx/tdf142716.pptx
new file mode 100644
index ..4ef29e389449
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf142716.pptx differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 7805b591b6ed..c44564e201de 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -66,6 +66,7 @@ public:
 void testImageWithSpecialID();
 void testTdf62176();
 void testTransparentBackground();
+void testTdf142716();
 void testEmbeddedPdf();
 void testEmbeddedText();
 void testTransparenText();
@@ -110,6 +111,7 @@ public:
 CPPUNIT_TEST(testImageWithSpecialID);
 CPPUNIT_TEST(testTdf62176);
 CPPUNIT_TEST(testTransparentBackground);
+CPPUNIT_TEST(testTdf142716);
 CPPUNIT_TEST(testEmbeddedPdf);
 CPPUNIT_TEST(testEmbeddedText);
 CPPUNIT_TEST(testTransparenText);
@@ -287,6 +289,22 @@ void SdExportTest::testTransparentBackground()
 xDocShRef->DoClose();
 }
 
+void SdExportTest::testTdf142716()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf142716.pptx"), 
PPTX);
+xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+
+const SdrPage *pPage = GetPage( 1, xDocShRef );
+const SdrTextObj *pObj = dynamic_cast( pPage->GetObj( 0 ) );
+
+OUString sText = pObj->GetOutlinerParaObject()->GetTextObject().GetText(0);
+
+// Without fix "yyy" part will be lost.
+CPPUNIT_ASSERT_EQUAL( OUString( "xxx and yyy" ), sText);
+
+xDocShRef->DoClose();
+}
+
 void SdExportTest::testMediaEmbedding()
 {
 ::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/media_embedding.odp"), 
ODP);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-21 Thread Gülşah Köse (via logerrit)
 editeng/source/uno/unotext.cxx  |   14 +++---
 sd/qa/unit/data/pptx/tdf142716.pptx |binary
 sd/qa/unit/export-tests.cxx |   18 ++
 3 files changed, 25 insertions(+), 7 deletions(-)

New commits:
commit e837f50313a703b6b26abb78f224472c1e4734ea
Author: Gülşah Köse 
AuthorDate: Fri Jun 18 11:23:41 2021 +0300
Commit: Gülşah Köse 
CommitDate: Mon Jun 21 10:27:24 2021 +0200

tdf#142716 Update selection after any text is inserted.

When we don't update the selection after insertion of new text
SvxUnoTextBase::createEnumeration knows old selection and losts last part
of the text.

Change-Id: I20f6530f34097ff213ff00cff617139887fd287a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117409
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 20d901e0d300..cae30b9eaa99 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1739,13 +1739,6 @@ void SAL_CALL SvxUnoTextBase::insertString( const 
uno::Reference< text::XTextRan
 if( !xRange.is() )
 return;
 
-if (GetEditSource())
-{
-ESelection aSelection;
-::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
-SetSelection( aSelection );
-}
-
 SvxUnoTextRangeBase* pRange = 
comphelper::getUnoTunnelImplementation( xRange );
 if(!pRange)
 return;
@@ -1761,6 +1754,13 @@ void SAL_CALL SvxUnoTextBase::insertString( const 
uno::Reference< text::XTextRan
 pRange->setString( aString );
 
 pRange->CollapseToEnd();
+
+if (GetEditSource())
+{
+ESelection aSelection;
+::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
+SetSelection( aSelection );
+}
 }
 
 void SAL_CALL SvxUnoTextBase::insertControlCharacter( const uno::Reference< 
text::XTextRange >& xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb )
diff --git a/sd/qa/unit/data/pptx/tdf142716.pptx 
b/sd/qa/unit/data/pptx/tdf142716.pptx
new file mode 100644
index ..4ef29e389449
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf142716.pptx differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 7805b591b6ed..c44564e201de 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -66,6 +66,7 @@ public:
 void testImageWithSpecialID();
 void testTdf62176();
 void testTransparentBackground();
+void testTdf142716();
 void testEmbeddedPdf();
 void testEmbeddedText();
 void testTransparenText();
@@ -110,6 +111,7 @@ public:
 CPPUNIT_TEST(testImageWithSpecialID);
 CPPUNIT_TEST(testTdf62176);
 CPPUNIT_TEST(testTransparentBackground);
+CPPUNIT_TEST(testTdf142716);
 CPPUNIT_TEST(testEmbeddedPdf);
 CPPUNIT_TEST(testEmbeddedText);
 CPPUNIT_TEST(testTransparenText);
@@ -287,6 +289,22 @@ void SdExportTest::testTransparentBackground()
 xDocShRef->DoClose();
 }
 
+void SdExportTest::testTdf142716()
+{
+::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf142716.pptx"), 
PPTX);
+xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+
+const SdrPage *pPage = GetPage( 1, xDocShRef );
+const SdrTextObj *pObj = dynamic_cast( pPage->GetObj( 0 ) );
+
+OUString sText = pObj->GetOutlinerParaObject()->GetTextObject().GetText(0);
+
+// Without fix "yyy" part will be lost.
+CPPUNIT_ASSERT_EQUAL( OUString( "xxx and yyy" ), sText);
+
+xDocShRef->DoClose();
+}
+
 void SdExportTest::testMediaEmbedding()
 {
 ::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/media_embedding.odp"), 
ODP);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/ooxml-analyze' - bin/compare-ooxml-analyze-results.py

2021-06-07 Thread Gülşah Köse (via logerrit)
 bin/compare-ooxml-analyze-results.py |   87 +++
 1 file changed, 68 insertions(+), 19 deletions(-)

New commits:
commit 4bf4b28b2d6316a34d0966d1109b76162aa0b336
Author: Gülşah Köse 
AuthorDate: Tue Jun 8 08:50:37 2021 +0300
Commit: Gülşah Köse 
CommitDate: Tue Jun 8 08:50:37 2021 +0300

Compare texts

Change-Id: I0aee62ffa79dbf716bb9ec2af2bc06078e1eb566

diff --git a/bin/compare-ooxml-analyze-results.py 
b/bin/compare-ooxml-analyze-results.py
index d0d89fc30a31..fdd4fa8a0243 100644
--- a/bin/compare-ooxml-analyze-results.py
+++ b/bin/compare-ooxml-analyze-results.py
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 
-import sys, getopt, os, pprint, ast
+import sys, getopt, os, pprint, ast, difflib
 
 original_results_dir = ''
 saved_results_dir = ''
@@ -24,13 +24,18 @@ def main(argv):
  global saved_results_dir
  saved_results_dir = arg
 
-   # takes file list produced by ooxml-analyze.py tool.
-   original_result_files = get_list_of_files(original_results_dir)
-   saved_result_files = get_list_of_files(saved_results_dir)
+   # takes result file list produced by ooxml-analyze.py tool. 
.result
+   original_result_files = get_list_of_result_files(original_results_dir)
+   saved_result_files = get_list_of_result_files(saved_results_dir)
+   compare_results(original_result_files, saved_result_files)
 
-   compare(original_result_files, saved_result_files)
+   # takes concanated texts file list produced by ooxml-analyze.py tool. 
.text
+   original_text_files = get_list_of_text_files(original_results_dir)
+   saved_text_files = get_list_of_text_files(saved_results_dir)
+   compare_texts(original_text_files, saved_text_files)
 
-def get_list_of_files(directory_name):
+# collects .result files
+def get_list_of_result_files(directory_name):
 
list_of_file = os.listdir(directory_name)
all_files = list()
@@ -38,16 +43,32 @@ def get_list_of_files(directory_name):
for filename in list_of_file:
   full_path = os.path.join(directory_name, filename)
   if os.path.isdir(full_path):
- all_files = all_files + get_list_of_files(full_path)
+ all_files = all_files + get_list_of_result_files(full_path)
   else:
- all_files.append(full_path)
+ if filename.endswith(".result"):
+all_files.append(full_path)
+
+   return all_files
+
+# collecsts .text files
+def get_list_of_text_files(directory_name):
+
+   list_of_file = os.listdir(directory_name)
+   all_files = list()
+
+   for filename in list_of_file:
+  full_path = os.path.join(directory_name, filename)
+  if os.path.isdir(full_path):
+ all_files = all_files + get_list_of_result_files(full_path)
+  else:
+ if filename.endswith(".text"):
+all_files.append(full_path)
 
return all_files
 
 
 # compares the  elements the original results and and after saved results.
-def compare(original_result_files, saved_result_files):
-   ind = 1
+def compare_results(original_result_files, saved_result_files):
for original_filepath in original_result_files:
   saved_filepath = get_corresponding_file(original_filepath)
   if saved_filepath == '':
@@ -57,11 +78,31 @@ def compare(original_result_files, saved_result_files):
   original_result_list = create_list_from_result_file(original_filepath)
   saved_result_list = create_list_from_result_file(saved_filepath)
 
-  check_text_contents(original_result_list, saved_result_list)
+  check_text_contents(original_result_list, saved_result_list, 
original_filepath)
+
+def compare_texts(original_texts_file, saved_texts_file):
+   for original_filepath in original_texts_file:
+  saved_filepath = get_corresponding_file(original_filepath)
+  if saved_filepath == '':
+ print("No result text file after roundtrip for " + original_filepath)
+ continue
+
+  with open(original_filepath) as file_1:
+ original_file_text = file_1.readlines()
+
+  with open(saved_filepath) as file_2:
+ saved_file_text = file_2.readlines()
+
+ # if os.path.exists("./result"):
+ #os.remove("result")
 
+  for line in difflib.unified_diff(original_file_text, saved_file_text, 
fromfile=original_filepath, tofile=saved_filepath, lineterm=''):
+ with open("result", "a") as log_file:
+print(line, file=log_file)
+ log_file.close()
 
-# checks if we missed any text content after saving the file.
-def check_text_contents(original_result_list, saved_result_list):
+# checks if we missed any text content after saving the file. (except a:t, We 
are comparing them with compare_text function)
+def check_text_contents(original_result_list, saved_result_list, 
original_file_path):
 
# detect if we lost or added any text on existing texts of original version.
for line in original_result_list:
@@ -69,6 +110,10 @@ def check_text_contents(original_result_list, 
saved_result_list):
   if not bool(text_dict): # 

[Libreoffice-commits] core.git: Branch 'feature/ooxml-analyze' - bin/ooxml-analyze.py

2021-06-07 Thread Gülşah Köse (via logerrit)
 bin/ooxml-analyze.py |  103 ---
 1 file changed, 57 insertions(+), 46 deletions(-)

New commits:
commit 7c03a4c092d9cba10ecb22e7f97aaca851259f1f
Author: Gülşah Köse 
AuthorDate: Tue Jun 8 08:43:30 2021 +0300
Commit: Gülşah Köse 
CommitDate: Tue Jun 8 08:43:30 2021 +0300

Improve error handling, exclude None texts

Change-Id: Idedad9c414311d95c355ea70a913f8e0ddf7

diff --git a/bin/ooxml-analyze.py b/bin/ooxml-analyze.py
index a7e2bc2a549f..87acd377c854 100755
--- a/bin/ooxml-analyze.py
+++ b/bin/ooxml-analyze.py
@@ -88,8 +88,11 @@ def extract_files(inputdir, extracted_files_dir):
 filepath = os.path.join(inputdir, filename)
 extracted_file_path = os.path.join(extracted_files_dir, filename)
 
-with ZipFile(filepath) as zipObj:
-zipObj.extractall(extracted_file_path)
+try:
+with ZipFile(filepath) as zipObj:
+zipObj.extractall(extracted_file_path)
+except:
+print("%s is problematic" % filename)
 else:
 continue
 
@@ -126,6 +129,11 @@ def is_file_in_accepted_files(filename):
"ppt/slideMasters" in filename or \
"ppt/theme" in filename or \
"ppt/notesMasters" in filename or \
+   "ppt/notesSlides" in filename or \
+   "ppt/handoutMasters" in filename or \
+   "ppt/tags" in filename or \
+   "pptx/customXml" in filename or \
+   "ppt/diagrams" in filename or \
filename.endswith("docProps/core.xml") or not \
filename.endswith(".xml")):
return False
@@ -149,51 +157,54 @@ def count_elements(extracted_files_dir, result_list, 
concanated_texts_list):
 
 print(xmlfile)
 
-# start to count
-for event, child in etree.iterparse(xmlfile, events=('start', 'end')):
-tag = replace_namespace_with_alias(xmlfile, child.tag)
-tag_idx = get_index_of_tag(tag, result_list)
-
-if event == "start":
-# count tags
-if (tag_idx == -1):
-tmp_list = [{tag: 1},{},{},{}]
-result_list.append(tmp_list)
-else:
-result_list[tag_idx][0][tag] += 1
-
-# count attribute names and values of current tag
-for attr_name, attr_value in child.attrib.items():
-attr_name = replace_namespace_with_alias(xmlfile, 
attr_name)
-if not attr_name in result_list[tag_idx][1].keys():
-result_list[tag_idx][1][attr_name] = 1
+try:
+# start to count
+for event, child in etree.iterparse(xmlfile, events=('start', 
'end')):
+tag = replace_namespace_with_alias(xmlfile, child.tag)
+tag_idx = get_index_of_tag(tag, result_list)
+
+if event == "start":
+# count tags
+if (tag_idx == -1):
+tmp_list = [{tag: 1},{},{},{}]
+result_list.append(tmp_list)
 else:
-result_list[tag_idx][1][attr_name] +=1
-
-if not attr_value in result_list[tag_idx][2].keys():
-result_list[tag_idx][2][attr_value] = 1
-else:
-result_list[tag_idx][2][attr_value] +=1
-
-# concanated text will be resetted in every paragraph begining
-if tag == "a:p":
-concatenated_text = ""
-
-
-if event == "end":
-# Detect seperate texts in paragraph and concanate them.
-if tag == "a:t":
-concatenated_text += str(child.text)
-# End of the paragraph element, add the text as list item.
-if tag == "a:p" and concatenated_text != "":
-concanated_texts_list.append(concatenated_text)
-
-# count text contents except consisted of whitespaces.
-if not (str(child.text) == "None" or 
str(child.text).strip()==""):
-if not child.text in result_list[tag_idx][3].keys():
-result_list[tag_idx][3][child.text] = 1
-else:
-result_list[tag_idx][3][child.text] += 1
+result_list[tag_idx][0][tag] += 1
+
+# count attribute names and values of current tag
+for attr_name, attr_value in child.attrib.items():
+attr_name = replace_namespace_with_alias(xmlfile, 
attr_name)
+if not attr_name in result_list[tag_idx][1].keys():
+result_list[tag_idx][1][attr_name] = 1
+else:
+result_list[tag_idx][1][attr_name] +=1
+
+if not 

[Libreoffice-commits] core.git: Branch 'feature/ooxml-analyze' - bin/ooxml-analyze.py

2021-06-03 Thread Gülşah Köse (via logerrit)
 bin/ooxml-analyze.py |   99 ---
 1 file changed, 64 insertions(+), 35 deletions(-)

New commits:
commit f2bde987693fad6e1347f99e34c2ad5291ea8ee6
Author: Gülşah Köse 
AuthorDate: Thu Jun 3 14:11:05 2021 +0300
Commit: Gülşah Köse 
CommitDate: Thu Jun 3 14:15:14 2021 +0300

Concanate seperate texts runs and create seperate result file fot it.

For eg:

  
text1
  
  
text2
  


We will keep the result text as "text1text2"

As result we will create .text to hold that type texts.

Change-Id: I946af39e2037db1f986e73039d0a462a36bba1d8

diff --git a/bin/ooxml-analyze.py b/bin/ooxml-analyze.py
index 9db39d8c47da..a7e2bc2a549f 100755
--- a/bin/ooxml-analyze.py
+++ b/bin/ooxml-analyze.py
@@ -1,8 +1,9 @@
 #!/usr/bin/python
 
-import sys, getopt, os, shutil, pprint
+import sys, getopt, os, shutil
 import xml.etree.ElementTree as ET
 from zipfile import ZipFile
+from lxml import etree
 
 def main(argv):
 inputdir = ''
@@ -28,9 +29,6 @@ def main(argv):
elif opt in ("-o", "--odir"):
   outputdir = arg
 
-# holds the result structer of analyze
-result_list = []
-
 if(extracted_files_dir_by_user == ''):
 # use default directory path for extracted ooxml files.
 extracted_files_dir = os.path.join(outputdir, 'extractedfiles')
@@ -40,22 +38,39 @@ def main(argv):
 extracted_files_dir = extracted_files_dir_by_user
 
 # create seperate result files for each ooxml document as .result in output directory
+# create seperate concanated texts for each ooxml document as .text in output directory
 for ext_dir in get_list_of_subdir(extracted_files_dir):
 i = ext_dir.rfind('/')
 sub_result_name = ext_dir[i+1:] + ".result"
+sub_texts_name = ext_dir[i+1:] + ".text"
 sub_result_list = []
-count_elements(ext_dir, sub_result_list)
+concatenated_texts_list = [] # holds concanated texts for each 
paragraph
+count_elements(ext_dir, sub_result_list, concatenated_texts_list)
+
 sub_result_path = os.path.join(outputdir, sub_result_name)
+sub_texts_path = os.path.join(outputdir, sub_texts_name)
 
 # sort the result sub list according to tag names
 sub_result_list = sorted(sub_result_list, key=lambda x: 
list(x[0].keys())[0], reverse=False)
+concatenated_texts_list.sort()
 
 if os.path.exists(sub_result_path):
 os.remove(sub_result_path)
+if os.path.exists(sub_texts_path):
+os.remove(sub_texts_path)
+
 for i in sub_result_list:
 with open(sub_result_path, "a") as log_file:
 print(i, file=log_file)
-log_file.close()
+log_file.close()
+for i in concatenated_texts_list:
+with open(sub_texts_path, "a") as log_file:
+print(i, file=log_file)
+log_file.close()
+
+# no need to keep extracted files anymore.
+if(os.path.exists(extracted_files_dir)):
+shutil.rmtree(extracted_files_dir)
 
 # unzip all ooxml files into the given path
 def extract_files(inputdir, extracted_files_dir):
@@ -98,6 +113,7 @@ def replace_namespace_with_alias(filename, element):
 element = element.replace("{" + element_ns + "}", "")
 return element
 
+# decides which files shouldn't be analyzed.
 def is_file_in_accepted_files(filename):
 if(filename.endswith("[Content_Types].xml") or \
filename.endswith("docProps/custom.xml") or \
@@ -109,6 +125,7 @@ def is_file_in_accepted_files(filename):
"ppt/slideLayouts" in filename or \
"ppt/slideMasters" in filename or \
"ppt/theme" in filename or \
+   "ppt/notesMasters" in filename or \
filename.endswith("docProps/core.xml") or not \
filename.endswith(".xml")):
return False
@@ -116,7 +133,7 @@ def is_file_in_accepted_files(filename):
 return True
 
 # counts tags, attribute names and values of xmls
-def count_elements(extracted_files_dir, result_list):
+def count_elements(extracted_files_dir, result_list, concanated_texts_list):
 
 # make sure if extracted files directory exist
 if not (os.path.exists(extracted_files_dir)):
@@ -131,40 +148,52 @@ def count_elements(extracted_files_dir, result_list):
 continue
 
 print(xmlfile)
-tree = ET.parse(xmlfile)
-root = tree.getroot()
 
 # start to count
-for child in root.iter():
+for event, child in etree.iterparse(xmlfile, events=('start', 'end')):
 tag = replace_namespace_with_alias(xmlfile, child.tag)
 tag_idx = get_index_of_tag(tag, result_list)
 
-# count tags
-if (tag_idx == -1):
-tmp_list = [{tag: 1},{},{},{}]
-result_list.append(tmp_list)
-else:
-result_list[tag_idx][0][tag] += 1
-
-

[Libreoffice-commits] core.git: Branch 'feature/ooxml-analyze' - bin/ooxml-analyze.py

2021-05-31 Thread Gülşah Köse (via logerrit)
 bin/ooxml-analyze.py |   38 ++
 1 file changed, 22 insertions(+), 16 deletions(-)

New commits:
commit 056ebfae35f6725b9089439a7bf868dad48fdd0f
Author: Gülşah Köse 
AuthorDate: Mon May 31 16:08:23 2021 +0300
Commit: Gülşah Köse 
CommitDate: Mon May 31 16:08:28 2021 +0300

Fix the use of exist extracted files path and change result output

Tool was counting the text context that consists of whitespaces.
Prevent this, not count that texts as text contexts eg:  " "

Change-Id: Ib71123b82082166addd423b734661a158ec2254e

diff --git a/bin/ooxml-analyze.py b/bin/ooxml-analyze.py
index 12b9ba590db9..9db39d8c47da 100755
--- a/bin/ooxml-analyze.py
+++ b/bin/ooxml-analyze.py
@@ -8,6 +8,7 @@ def main(argv):
 inputdir = ''
 outputdir = ''
 extracted_files_dir_by_user = ''
+extracted_files_dir = ''
 
 #read the arguments
 try:
@@ -34,23 +35,27 @@ def main(argv):
 # use default directory path for extracted ooxml files.
 extracted_files_dir = os.path.join(outputdir, 'extractedfiles')
 extract_files(inputdir, extracted_files_dir)
-
-# create seperate result files for each ooxml document as .result in output directory
-for ext_dir in get_list_of_subdir(extracted_files_dir):
-i = ext_dir.rfind('/')
-sub_result_name = ext_dir[i+1:] + ".result"
-sub_result_list = []
-count_elements(ext_dir, sub_result_list)
-sub_result_path = os.path.join(outputdir, sub_result_name)
-
-# sort the result sub list according to tag names
-sub_result_list = sorted(sub_result_list, key=lambda x: 
list(x[0].keys())[0], reverse=False)
-
-with open(sub_result_path, "w") as log_file:
-pprint.pprint(sub_result_list, log_file)
 else:
 # use user defined directory path for extracted ooxml files.
-count_elements(extracted_files_dir_by_user, result_list)
+extracted_files_dir = extracted_files_dir_by_user
+
+# create seperate result files for each ooxml document as .result in output directory
+for ext_dir in get_list_of_subdir(extracted_files_dir):
+i = ext_dir.rfind('/')
+sub_result_name = ext_dir[i+1:] + ".result"
+sub_result_list = []
+count_elements(ext_dir, sub_result_list)
+sub_result_path = os.path.join(outputdir, sub_result_name)
+
+# sort the result sub list according to tag names
+sub_result_list = sorted(sub_result_list, key=lambda x: 
list(x[0].keys())[0], reverse=False)
+
+if os.path.exists(sub_result_path):
+os.remove(sub_result_path)
+for i in sub_result_list:
+with open(sub_result_path, "a") as log_file:
+print(i, file=log_file)
+log_file.close()
 
 # unzip all ooxml files into the given path
 def extract_files(inputdir, extracted_files_dir):
@@ -154,7 +159,8 @@ def count_elements(extracted_files_dir, result_list):
 else:
 result_list[tag_idx][2][attr_value] +=1
 
-if not (str(child.text) == "None"):
+# count text contents except consisted of whitespaces.
+if not (str(child.text) == "None" or str(child.text).strip()==""):
 if not child.text in result_list[tag_idx][3].keys():
 result_list[tag_idx][3][child.text] = 1
 else:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: compilerplugins/clang cui/source editeng/inc editeng/source include/editeng include/IwyuFilter_include.yaml sd/qa sd/source svl/source svx/sdi sw/source

2021-05-31 Thread Gülşah Köse (via logerrit)
 compilerplugins/clang/constantparam.booleans.results |4 
 cui/source/dialogs/SpellDialog.cxx   |2 
 cui/source/tabpages/backgrnd.cxx |   10 -
 editeng/inc/editattr.hxx |3 
 editeng/source/editeng/editattr.cxx  |4 
 editeng/source/editeng/editdbg.cxx   |2 
 editeng/source/editeng/editdoc.cxx   |2 
 editeng/source/editeng/editeng.cxx   |2 
 editeng/source/editeng/eerdll.cxx|2 
 editeng/source/items/textitem.cxx|  122 +--
 include/IwyuFilter_include.yaml  |1 
 include/editeng/colritem.hxx |   34 -
 include/editeng/eeitem.hxx   |3 
 sd/qa/unit/export-tests-ooxml1.cxx   |   20 +--
 sd/qa/unit/export-tests.cxx  |9 -
 sd/source/core/stlpool.cxx   |8 -
 sd/source/ui/func/fuchar.cxx |2 
 sd/source/ui/func/futempl.cxx|4 
 sd/source/ui/view/drtxtob1.cxx   |2 
 sd/source/ui/view/drviews2.cxx   |2 
 svl/source/items/poolitem.cxx|1 
 svx/sdi/svx.sdi  |4 
 svx/sdi/svxitems.sdi |1 
 sw/source/uibase/shells/drwtxtex.cxx |2 
 24 files changed, 51 insertions(+), 195 deletions(-)

New commits:
commit 936af331ba6f5073aeaa0f10f5f2af1def1d74c6
Author: Gülşah Köse 
AuthorDate: Fri May 28 01:23:53 2021 +0300
Commit: Gülşah Köse 
CommitDate: Mon May 31 11:36:18 2021 +0200

Clean redundant SvxBackgroundColorItem and use SvxColorItem instead.

SvxBackgroundColorItem is just copied from SvxColorItem. There is
nothing special to SvxBackgroundColorItem class. SvxColorItem is a
generic item and it's used on many places related with colors. We can
use SvxColorItem for background colors too.

Change-Id: Iacea31a7557b806e95f5859ff60add9a2626ec05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116282
Reviewed-by: Jan Holesovsky 
Tested-by: Jenkins

diff --git a/compilerplugins/clang/constantparam.booleans.results 
b/compilerplugins/clang/constantparam.booleans.results
index 94efdc01da0a..e34c49f419b8 100644
--- a/compilerplugins/clang/constantparam.booleans.results
+++ b/compilerplugins/clang/constantparam.booleans.results
@@ -706,10 +706,6 @@ include/editeng/boxitem.hxx:114
 _Bool SvxBoxItem::HasBorder(_Bool) const
 _Bool bTreatPaddingAsBorder
 1
-include/editeng/colritem.hxx:69
-void SvxBackgroundColorItem::SvxBackgroundColorItem(const unsigned short)
-const unsigned short nId
-0
 include/editeng/editeng.hxx:548
 void EditEngine::dumpAsXmlEditDoc(struct _xmlTextWriter *) const
 struct _xmlTextWriter * pWriter
diff --git a/cui/source/dialogs/SpellDialog.cxx 
b/cui/source/dialogs/SpellDialog.cxx
index 338990b31628..b583fa03768e 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -1067,7 +1067,7 @@ bool 
SpellDialog::GetNextSentence_Impl(std::unique_ptr* pG
 }
 
 if (elem.bIsField)
-
m_xSentenceED->SetAttrib(SvxBackgroundColorItem(COL_LIGHTGRAY, 
EE_CHAR_BKGCOLOR), nStartPosition, nEndPosition);
+m_xSentenceED->SetAttrib(SvxColorItem(COL_LIGHTGRAY, 
EE_CHAR_BKGCOLOR), nStartPosition, nEndPosition);
 m_xSentenceED->SetAttrib(SvxLanguageItem(elem.eLanguage, 
EE_CHAR_LANGUAGE), nStartPosition, nEndPosition);
 nStartPosition = nEndPosition;
 }
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 38190271d778..3aac1fae51a7 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -153,8 +153,8 @@ bool SvxBkgTabPage::FillItemSet( SfxItemSet* rCoreSet )
 {
 if ( SID_ATTR_CHAR_BACK_COLOR == nSlot )
 {
-maSet.Put( SvxBackgroundColorItem( COL_TRANSPARENT, nWhich 
) );
-rCoreSet->Put( SvxBackgroundColorItem( COL_TRANSPARENT, 
nWhich ) );
+maSet.Put( SvxColorItem( COL_TRANSPARENT, nWhich ) );
+rCoreSet->Put( SvxColorItem( COL_TRANSPARENT, nWhich ) );
 }
 else
 {
@@ -169,8 +169,8 @@ bool SvxBkgTabPage::FillItemSet( SfxItemSet* rCoreSet )
 XFillColorItem aColorItem( maSet.Get( XATTR_FILLCOLOR ) );
 if ( SID_ATTR_CHAR_BACK_COLOR == nSlot )
 {
-maSet.Put( SvxBackgroundColorItem( aColorItem.GetColorValue(), 
nWhich ) );
-rCoreSet->Put( SvxBackgroundColorItem( 
aColorItem.GetColorValue(), nWhich ) );
+maSet.Put( 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - oox/source sd/qa

2021-05-29 Thread Gülşah Köse (via logerrit)
 oox/source/drawingml/textcharacterproperties.cxx |2 +
 sd/qa/unit/data/pptx/tdf96061.pptx   |binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   35 +++
 3 files changed, 37 insertions(+)

New commits:
commit e61bdbf41cf925147eee7f92142089f8adf0a237
Author: Gülşah Köse 
AuthorDate: Wed May 19 14:37:36 2021 +0300
Commit: Andras Timar 
CommitDate: Sat May 29 23:32:40 2021 +0200

tdf#96061 Unset the highlight property

When we have highlight property on specific part of the text
the following texts were highligthing. To prevent this we unset the
highlight property when we have not highlight property anymore.

Change-Id: I802cde1c784afe47201a9ba4f41827dd0c705035
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115800
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116176
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116333
Tested-by: Jenkins CollaboraOffice 

diff --git a/oox/source/drawingml/textcharacterproperties.cxx 
b/oox/source/drawingml/textcharacterproperties.cxx
index de47058e60ca..6b55c5326455 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -178,6 +178,8 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& 
rPropMap, const XmlFil
 
 if( maHighlightColor.isUsed() )
 rPropMap.setProperty( PROP_CharBackColor, maHighlightColor.getColor( 
rFilter.getGraphicHelper() ));
+else
+rPropMap.setProperty( PROP_CharBackColor, sal_Int32(-1));
 }
 
 static void pushToGrabBag( PropertySet& rPropSet, const 
std::vector& aVectorOfProperyValues )
diff --git a/sd/qa/unit/data/pptx/tdf96061.pptx 
b/sd/qa/unit/data/pptx/tdf96061.pptx
new file mode 100644
index ..c6e6aa5ae16f
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf96061.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 399bd4657861..27d42132557f 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -188,6 +188,7 @@ public:
 void testTdf131554();
 void testTdf132282();
 void testTdf128213ShapeRot();
+void testTdf96061_textHighlight();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -294,6 +295,7 @@ public:
 CPPUNIT_TEST(testTdf131554);
 CPPUNIT_TEST(testTdf132282);
 CPPUNIT_TEST(testTdf128213ShapeRot);
+CPPUNIT_TEST(testTdf96061_textHighlight);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2752,6 +2754,39 @@ void SdOOXMLExportTest2::testTdf128213ShapeRot()
 assertXPath(pXmlDocRels, 
"/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr/a:scene3d/a:camera/a:rot", 
"rev", "540");
 }
 
+void SdOOXMLExportTest2::testTdf96061_textHighlight()
+{
+::sd::DrawDocShellRef xDocShRef = loadURL( 
m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf96061.pptx"), PPTX);
+
+uno::Reference xShape(getShapeFromPage(0, 0, 
xDocShRef));
+uno::Reference const 
xParagraph1(getParagraphFromShape(0, xShape));
+uno::Reference xRun1(getRunFromParagraph(0, 
xParagraph1));
+uno::Reference< beans::XPropertySet> xPropSet1(xRun1, 
uno::UNO_QUERY_THROW);
+sal_Int32 aColor;
+xPropSet1->getPropertyValue("CharBackColor") >>= aColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(16776960), aColor);
+
+uno::Reference const 
xParagraph2(getParagraphFromShape(1, xShape));
+uno::Reference xRun2(getRunFromParagraph(0, 
xParagraph2));
+uno::Reference< beans::XPropertySet> xPropSet2(xRun2, 
uno::UNO_QUERY_THROW);
+xPropSet2->getPropertyValue("CharBackColor") >>= aColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), aColor);
+
+xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+
+uno::Reference xShape2(getShapeFromPage(0, 0, 
xDocShRef));
+uno::Reference const 
xParagraph3(getParagraphFromShape(0, xShape2));
+uno::Reference xRun3(getRunFromParagraph(0, 
xParagraph3));
+uno::Reference< beans::XPropertySet> xPropSet3(xRun3, 
uno::UNO_QUERY_THROW);
+xPropSet3->getPropertyValue("CharBackColor") >>= aColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(16776960), aColor);
+
+uno::Reference const 
xParagraph4(getParagraphFromShape(1, xShape2));
+uno::Reference xRun4(getRunFromParagraph(0, 
xParagraph4));
+uno::Reference< beans::XPropertySet> xPropSet4(xRun4, 
uno::UNO_QUERY_THROW);
+xPropSet4->getPropertyValue("CharBackColor") >>= aColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), aColor);
+}
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/ooxml-analyze' - bin/compare-ooxml-analyze-results.py

2021-05-28 Thread Gülşah Köse (via logerrit)
 bin/compare-ooxml-analyze-results.py |  145 +++
 1 file changed, 145 insertions(+)

New commits:
commit 076e9b84985ef81912d5f58da241d790ae17ed33
Author: Gülşah Köse 
AuthorDate: Fri May 28 23:37:36 2021 +0300
Commit: Gülşah Köse 
CommitDate: Fri May 28 23:37:36 2021 +0300

Compares the ooxml analyze results.

Takes the ooxml-analyze tool output files and compares.
We can only detect missing or extra texts between the elements.

Change-Id: I07df20d51efa10077818d30d26e4999c51ed8d12

diff --git a/bin/compare-ooxml-analyze-results.py 
b/bin/compare-ooxml-analyze-results.py
new file mode 100644
index ..d0d89fc30a31
--- /dev/null
+++ b/bin/compare-ooxml-analyze-results.py
@@ -0,0 +1,145 @@
+#!/usr/bin/python
+
+import sys, getopt, os, pprint, ast
+
+original_results_dir = ''
+saved_results_dir = ''
+
+def main(argv):
+   #read the arguments
+   try:
+  opts, args = getopt.getopt(argv,"ho:s:",["original=","saved="])
+   except getopt.GetoptError:
+  print ('compare-ooxml-analyze-results.py -o  -s ')
+  sys.exit(2)
+
+   for opt, arg in opts:
+  if opt == '-h':
+ print ('compare-ooxml-analyze-results.py -o  -s 
')
+ sys.exit()
+  elif opt in ("-o", "--original"):
+ global original_results_dir
+ original_results_dir = arg
+  elif opt in ("-s", "--saved"):
+ global saved_results_dir
+ saved_results_dir = arg
+
+   # takes file list produced by ooxml-analyze.py tool.
+   original_result_files = get_list_of_files(original_results_dir)
+   saved_result_files = get_list_of_files(saved_results_dir)
+
+   compare(original_result_files, saved_result_files)
+
+def get_list_of_files(directory_name):
+
+   list_of_file = os.listdir(directory_name)
+   all_files = list()
+
+   for filename in list_of_file:
+  full_path = os.path.join(directory_name, filename)
+  if os.path.isdir(full_path):
+ all_files = all_files + get_list_of_files(full_path)
+  else:
+ all_files.append(full_path)
+
+   return all_files
+
+
+# compares the  elements the original results and and after saved results.
+def compare(original_result_files, saved_result_files):
+   ind = 1
+   for original_filepath in original_result_files:
+  saved_filepath = get_corresponding_file(original_filepath)
+  if saved_filepath == '':
+ print("No result file after roundtrip for " + original_filepath)
+ continue
+
+  original_result_list = create_list_from_result_file(original_filepath)
+  saved_result_list = create_list_from_result_file(saved_filepath)
+
+  check_text_contents(original_result_list, saved_result_list)
+
+
+# checks if we missed any text content after saving the file.
+def check_text_contents(original_result_list, saved_result_list):
+
+   # detect if we lost or added any text on existing texts of original version.
+   for line in original_result_list:
+  text_dict = line[3]
+  if not bool(text_dict): # check if text context is empty
+ continue
+  tag = list(line[0].keys())[0] #if there is a text context, find the 
owner tag.
+  for sline in saved_result_list:
+ stag = list(sline[0].keys())[0]
+ if stag == tag: # check if saved results has same tag too.
+saved_text_dict = sline[3]
+if text_dict != saved_text_dict:
+   for key, val in text_dict.items():
+  if key not in saved_text_dict.keys():
+ print ("We lost %d \"%s\" text in %s tag." % (val, key, 
tag))
+  elif val > saved_text_dict[key]:
+ print ("We lost %d \"%s\" text in %s tag." % (val - 
saved_text_dict[key], key, tag))
+  elif val < saved_text_dict[key]:
+ print("We added extra %d \"%s\" text in %s tag" % 
(saved_text_dict[key] - val, key, tag))
+
+   # detect if we add any new text that not existed in original version
+   for line in saved_result_list:
+  saved_text_dict = line[3]
+  if not bool(saved_text_dict): # check if text context is empty
+ continue
+  tag = list(line[0].keys())[0] #if there is a text context, find the 
owner tag.
+  for sline in original_result_list:
+ stag = list(sline[0].keys())[0]
+ if stag == tag: # check if original results has same tag too.
+text_dict = sline[3]
+if saved_text_dict != text_dict:
+   for key, val in saved_text_dict.items():
+  if key not in text_dict.keys():
+ print ("We add extra %d \"%s\" text in %s tag." % (val, 
key, tag))
+
+#reads the file context and create the result list structer from.
+# eg res_list[[{},{},{},{}],[{},{},{},{}]...]  
   ]
+def create_list_from_result_file(filepath):
+   result_list = []
+   result_file = open(filepath, 'r')
+
+   for line in result_file.readlines():

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - editeng/source include/editeng

2021-05-28 Thread Gülşah Köse (via logerrit)
 editeng/source/items/textitem.cxx |   68 +++---
 include/editeng/colritem.hxx  |   36 +++-
 2 files changed, 85 insertions(+), 19 deletions(-)

New commits:
commit 672044c7e5eb4d1b506593de0b843d31c9ec0780
Author: Gülşah Köse 
AuthorDate: Wed May 26 08:47:38 2021 +0300
Commit: Andras Timar 
CommitDate: Fri May 28 12:18:03 2021 +0200

Seperate SvxBackgroundColorItem from SvxColorItem

SvxBackgroundColorItem derivated from SfxPoolItem instead of
SvxColorItem.

Casting is common usage to control if object is this or not.
When we can cast SvxBackgroundColorItem to SvxColorItem we can not
seperate them anymore.

eg: Char color is a SvxColorItem and char background color is a
SvxBackgroundColorItem. They can be hold together and we should
understand they are different types.

Change-Id: I7b1879a1b00de26c0b8a2d9f8d658aa3aef75ecb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116135
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116185
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index 53c1baaa7223..ec800e9d5eb4 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1356,26 +1356,32 @@ bool SvxContourItem::GetPresentation
 // class SvxBackgroundColorItem -
 
 SvxBackgroundColorItem::SvxBackgroundColorItem( const sal_uInt16 nId ) :
-SvxColorItem( nId )
+SfxPoolItem( nId ),
+mColor( COL_WHITE )
 {
 }
 
+SvxBackgroundColorItem::SvxBackgroundColorItem( const Color& rCol, const 
sal_uInt16 nId ) :
+SfxPoolItem( nId ),
+mColor( rCol )
+{
+}
 
-SvxBackgroundColorItem::SvxBackgroundColorItem( const Color& rCol,
-const sal_uInt16 nId ) :
-SvxColorItem( rCol, nId )
+SvxBackgroundColorItem::~SvxBackgroundColorItem()
 {
 }
 
-SfxPoolItem* SvxBackgroundColorItem::Clone( SfxItemPool * ) const
+bool SvxBackgroundColorItem::operator==( const SfxPoolItem& rAttr ) const
 {
-return new SvxBackgroundColorItem(*this);
+assert(SfxPoolItem::operator==(rAttr));
+
+return  mColor == static_cast( rAttr 
).mColor;
 }
 
 bool SvxBackgroundColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) 
const
 {
 nMemberId &= ~CONVERT_TWIPS;
-Color aColor = SvxColorItem::GetValue();
+Color aColor = SvxBackgroundColorItem::GetValue();
 
 switch( nMemberId )
 {
@@ -1396,28 +1402,68 @@ bool SvxBackgroundColorItem::QueryValue( uno::Any& 
rVal, sal_uInt8 nMemberId ) c
 bool SvxBackgroundColorItem::PutValue( const uno::Any& rVal, sal_uInt8 
nMemberId )
 {
 nMemberId &= ~CONVERT_TWIPS;
-sal_Int32 nColor = 0;
-Color aColor = SvxColorItem::GetValue();
+Color nColor;
+Color aColor = SvxBackgroundColorItem::GetValue();
 
 switch( nMemberId )
 {
 case MID_GRAPHIC_TRANSPARENT:
 {
 aColor.SetTransparency( Any2Bool( rVal ) ? 0xff : 0 );
-SvxColorItem::SetValue( aColor );
+SvxBackgroundColorItem::SetValue( aColor );
 break;
 }
 default:
 {
 if(!(rVal >>= nColor))
 return false;
-SvxColorItem::SetValue( Color(nColor) );
+SvxBackgroundColorItem::SetValue( nColor );
 break;
 }
 }
 return true;
 }
 
+SvxBackgroundColorItem* SvxBackgroundColorItem::Clone( SfxItemPool * ) const
+{
+return new SvxBackgroundColorItem(*this);
+}
+
+
+bool SvxBackgroundColorItem::GetPresentation
+(
+SfxItemPresentation /*ePres*/,
+MapUnit /*eCoreUnit*/,
+MapUnit /*ePresUnit*/,
+OUString&   rText, const IntlWrapper& /*rIntl*/
+)   const
+{
+rText = ::GetColorString( mColor );
+return true;
+}
+
+void SvxBackgroundColorItem::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+(void)xmlTextWriterStartElement(pWriter, 
BAD_CAST("SvxBackgroundColorItem"));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), 
BAD_CAST(OString::number(Which()).getStr()));
+
+std::stringstream ss;
+ss << mColor;
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), 
BAD_CAST(ss.str().c_str()));
+
+OUString aStr;
+IntlWrapper aIntlWrapper(SvtSysLocale().GetUILanguageTag());
+GetPresentation( SfxItemPresentation::Complete, MapUnit::Map100thMM, 
MapUnit::Map100thMM, aStr, aIntlWrapper);
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), 
BAD_CAST(OUStringToOString(aStr, RTL_TEXTENCODING_UTF8).getStr()));
+(void)xmlTextWriterEndElement(pWriter);
+}
+
+void SvxBackgroundColorItem::SetValue( const Color& rNewCol )
+{
+mColor = rNewCol;
+}
+
+
 // class SvxColorItem 
 

[Libreoffice-commits] core.git: Branch 'feature/ooxml-analyze' - bin/ooxml-analyze.py

2021-05-26 Thread Gülşah Köse (via logerrit)
 bin/ooxml-analyze.py |   90 ---
 1 file changed, 57 insertions(+), 33 deletions(-)

New commits:
commit fc03e6b942a9170bda5964f95893c18123b340e4
Author: Gülşah Köse 
AuthorDate: Wed May 26 18:25:11 2021 +0300
Commit: Gülşah Köse 
CommitDate: Wed May 26 18:25:11 2021 +0300

Export the accepted files part as function. And sort the sub result list

Change-Id: I9b5c003b6363ac50cf7c838cc4e954c14ef935de

diff --git a/bin/ooxml-analyze.py b/bin/ooxml-analyze.py
index 8dbfe8cacd0b..12b9ba590db9 100755
--- a/bin/ooxml-analyze.py
+++ b/bin/ooxml-analyze.py
@@ -42,6 +42,10 @@ def main(argv):
 sub_result_list = []
 count_elements(ext_dir, sub_result_list)
 sub_result_path = os.path.join(outputdir, sub_result_name)
+
+# sort the result sub list according to tag names
+sub_result_list = sorted(sub_result_list, key=lambda x: 
list(x[0].keys())[0], reverse=False)
+
 with open(sub_result_path, "w") as log_file:
 pprint.pprint(sub_result_list, log_file)
 else:
@@ -89,6 +93,23 @@ def replace_namespace_with_alias(filename, element):
 element = element.replace("{" + element_ns + "}", "")
 return element
 
+def is_file_in_accepted_files(filename):
+if(filename.endswith("[Content_Types].xml") or \
+   filename.endswith("docProps/custom.xml") or \
+   filename.endswith("docProps/app.xml") or\
+   filename.endswith("presentation.xml") or \
+   filename.endswith("viewProps.xml") or \
+   filename.endswith("tableStyles.xml") or \
+   filename.endswith("presProps.xml") or \
+   "ppt/slideLayouts" in filename or \
+   "ppt/slideMasters" in filename or \
+   "ppt/theme" in filename or \
+   filename.endswith("docProps/core.xml") or not \
+   filename.endswith(".xml")):
+   return False
+
+return True
+
 # counts tags, attribute names and values of xmls
 def count_elements(extracted_files_dir, result_list):
 
@@ -101,40 +122,43 @@ def count_elements(extracted_files_dir, result_list):
 
 # parse xmls and count elements
 for xmlfile in list_of_files:
-if(xmlfile.endswith(".xml")):
-tree = ET.parse(xmlfile)
-root = tree.getroot()
-
-# start to count
-for child in root.iter():
-tag = replace_namespace_with_alias(xmlfile, child.tag)
-tag_idx = get_index_of_tag(tag, result_list)
-
-# count tags
-if (tag_idx == -1):
-tmp_list = [{tag: 1},{},{},{}]
-result_list.append(tmp_list)
+if not is_file_in_accepted_files(xmlfile):
+continue
+
+print(xmlfile)
+tree = ET.parse(xmlfile)
+root = tree.getroot()
+
+# start to count
+for child in root.iter():
+tag = replace_namespace_with_alias(xmlfile, child.tag)
+tag_idx = get_index_of_tag(tag, result_list)
+
+# count tags
+if (tag_idx == -1):
+tmp_list = [{tag: 1},{},{},{}]
+result_list.append(tmp_list)
+else:
+result_list[tag_idx][0][tag] += 1
+
+# count attribute names and values of current tag
+for attr_name, attr_value in child.attrib.items():
+attr_name = replace_namespace_with_alias(xmlfile, attr_name)
+if not attr_name in result_list[tag_idx][1].keys():
+result_list[tag_idx][1][attr_name] = 1
+else:
+result_list[tag_idx][1][attr_name] +=1
+
+if not attr_value in result_list[tag_idx][2].keys():
+result_list[tag_idx][2][attr_value] = 1
+else:
+result_list[tag_idx][2][attr_value] +=1
+
+if not (str(child.text) == "None"):
+if not child.text in result_list[tag_idx][3].keys():
+result_list[tag_idx][3][child.text] = 1
 else:
-result_list[tag_idx][0][tag] += 1
-
-# count attribute names and values of current tag
-for attr_name, attr_value in child.attrib.items():
-attr_name = replace_namespace_with_alias(xmlfile, 
attr_name)
-if not attr_name in result_list[tag_idx][1].keys():
-result_list[tag_idx][1][attr_name] = 1
-else:
-result_list[tag_idx][1][attr_name] +=1
-
-if not attr_value in result_list[tag_idx][2].keys():
-result_list[tag_idx][2][attr_value] = 1
-else:
-result_list[tag_idx][2][attr_value] +=1
-
-if not (str(child.text) == "None"):
-if not child.text in result_list[tag_idx][3].keys():
-

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - editeng/source include/editeng

2021-05-26 Thread Gülşah Köse (via logerrit)
 editeng/source/items/textitem.cxx |   66 --
 include/editeng/colritem.hxx  |   24 -
 2 files changed, 78 insertions(+), 12 deletions(-)

New commits:
commit 7f9668926d03de947a73c0b3a5e2f6490701fcad
Author: Gülşah Köse 
AuthorDate: Wed May 26 08:47:38 2021 +0300
Commit: Xisco Fauli 
CommitDate: Wed May 26 17:09:37 2021 +0200

Seperate SvxBackgroundColorItem from SvxColorItem

SvxBackgroundColorItem derivated from SfxPoolItem instead of
SvxColorItem.

Casting is common usage to control if object is this or not.
When we can cast SvxBackgroundColorItem to SvxColorItem we can not
seperate them anymore.

eg: Char color is a SvxColorItem and char background color is a
SvxBackgroundColorItem. They can be hold together and we should
understand they are different types.

Change-Id: I7b1879a1b00de26c0b8a2d9f8d658aa3aef75ecb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116135
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116183

diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index e1700df6e254..d9dba072b980 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1313,26 +1313,32 @@ bool SvxContourItem::GetPresentation
 // class SvxBackgroundColorItem -
 
 SvxBackgroundColorItem::SvxBackgroundColorItem( const sal_uInt16 nId ) :
-SvxColorItem( nId )
+SfxPoolItem( nId ),
+mColor( COL_WHITE )
 {
 }
 
+SvxBackgroundColorItem::SvxBackgroundColorItem( const Color& rCol, const 
sal_uInt16 nId ) :
+SfxPoolItem( nId ),
+mColor( rCol )
+{
+}
 
-SvxBackgroundColorItem::SvxBackgroundColorItem( const Color& rCol,
-const sal_uInt16 nId ) :
-SvxColorItem( rCol, nId )
+SvxBackgroundColorItem::~SvxBackgroundColorItem()
 {
 }
 
-SvxBackgroundColorItem* SvxBackgroundColorItem::Clone( SfxItemPool * ) const
+bool SvxBackgroundColorItem::operator==( const SfxPoolItem& rAttr ) const
 {
-return new SvxBackgroundColorItem(*this);
+assert(SfxPoolItem::operator==(rAttr));
+
+return  mColor == static_cast( rAttr 
).mColor;
 }
 
 bool SvxBackgroundColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) 
const
 {
 nMemberId &= ~CONVERT_TWIPS;
-Color aColor = SvxColorItem::GetValue();
+Color aColor = SvxBackgroundColorItem::GetValue();
 
 switch( nMemberId )
 {
@@ -1354,27 +1360,67 @@ bool SvxBackgroundColorItem::PutValue( const uno::Any& 
rVal, sal_uInt8 nMemberId
 {
 nMemberId &= ~CONVERT_TWIPS;
 sal_Int32 nColor = 0;
-Color aColor = SvxColorItem::GetValue();
+Color aColor = SvxBackgroundColorItem::GetValue();
 
 switch( nMemberId )
 {
 case MID_GRAPHIC_TRANSPARENT:
 {
 aColor.SetTransparency( Any2Bool( rVal ) ? 0xff : 0 );
-SvxColorItem::SetValue( aColor );
+SvxBackgroundColorItem::SetValue( aColor );
 break;
 }
 default:
 {
 if(!(rVal >>= nColor))
 return false;
-SvxColorItem::SetValue( Color(nColor) );
+SvxBackgroundColorItem::SetValue( Color(nColor) );
 break;
 }
 }
 return true;
 }
 
+SvxBackgroundColorItem* SvxBackgroundColorItem::Clone( SfxItemPool * ) const
+{
+return new SvxBackgroundColorItem(*this);
+}
+
+
+bool SvxBackgroundColorItem::GetPresentation
+(
+SfxItemPresentation /*ePres*/,
+MapUnit /*eCoreUnit*/,
+MapUnit /*ePresUnit*/,
+OUString&   rText, const IntlWrapper& /*rIntl*/
+)   const
+{
+rText = ::GetColorString( mColor );
+return true;
+}
+
+void SvxBackgroundColorItem::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+(void)xmlTextWriterStartElement(pWriter, 
BAD_CAST("SvxBackgroundColorItem"));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), 
BAD_CAST(OString::number(Which()).getStr()));
+
+std::stringstream ss;
+ss << mColor;
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), 
BAD_CAST(ss.str().c_str()));
+
+OUString aStr;
+IntlWrapper aIntlWrapper(SvtSysLocale().GetUILanguageTag());
+GetPresentation( SfxItemPresentation::Complete, MapUnit::Map100thMM, 
MapUnit::Map100thMM, aStr, aIntlWrapper);
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), 
BAD_CAST(OUStringToOString(aStr, RTL_TEXTENCODING_UTF8).getStr()));
+(void)xmlTextWriterEndElement(pWriter);
+}
+
+void SvxBackgroundColorItem::SetValue( const Color& rNewCol )
+{
+mColor = rNewCol;
+}
+
+
 // class SvxColorItem 
 SvxColorItem::SvxColorItem( const sal_uInt16 nId ) :
 SfxPoolItem( nId ),
diff --git a/include/editeng/colritem.hxx 

[Libreoffice-commits] core.git: Branch 'feature/ooxml-analyze' - bin/ooxml-analyze.py

2021-05-26 Thread Gülşah Köse (via logerrit)
 bin/ooxml-analyze.py |   31 ++-
 1 file changed, 22 insertions(+), 9 deletions(-)

New commits:
commit a8b521dc0f8e810f97630551406ccd8d1590371f
Author: Gülşah Köse 
AuthorDate: Wed May 26 16:57:23 2021 +0300
Commit: Gülşah Köse 
CommitDate: Wed May 26 16:57:23 2021 +0300

Create a sub result for each ooxml document in output directory

Change-Id: Ibbb366725d344f8e44c085ced60c35e190f98a9d

diff --git a/bin/ooxml-analyze.py b/bin/ooxml-analyze.py
index 3f9b0e8bdad1..8dbfe8cacd0b 100755
--- a/bin/ooxml-analyze.py
+++ b/bin/ooxml-analyze.py
@@ -35,13 +35,19 @@ def main(argv):
 extracted_files_dir = os.path.join(outputdir, 'extractedfiles')
 extract_files(inputdir, extracted_files_dir)
 
-count_elements(extracted_files_dir, result_list)
+# create seperate result files for each ooxml document as .result in output directory
+for ext_dir in get_list_of_subdir(extracted_files_dir):
+i = ext_dir.rfind('/')
+sub_result_name = ext_dir[i+1:] + ".result"
+sub_result_list = []
+count_elements(ext_dir, sub_result_list)
+sub_result_path = os.path.join(outputdir, sub_result_name)
+with open(sub_result_path, "w") as log_file:
+pprint.pprint(sub_result_list, log_file)
 else:
 # use user defined directory path for extracted ooxml files.
 count_elements(extracted_files_dir_by_user, result_list)
 
-pprint.pprint(result_list)
-
 # unzip all ooxml files into the given path
 def extract_files(inputdir, extracted_files_dir):
 
@@ -49,9 +55,6 @@ def extract_files(inputdir, extracted_files_dir):
 if(os.path.exists(extracted_files_dir)):
 shutil.rmtree(extracted_files_dir)
 
-# holds directory names for each ooxml document in extracted files dir.
-counter = 1
-
 # unzip files into the extracted files directory
 for filename in os.listdir(inputdir):
 if (filename.endswith(".pptx") or   \
@@ -59,12 +62,10 @@ def extract_files(inputdir, extracted_files_dir):
 filename.endswith(".xlsx")) and not \
 filename.startswith("~"):
 filepath = os.path.join(inputdir, filename)
-extracted_file_path = os.path.join(extracted_files_dir, 
str(counter))
+extracted_file_path = os.path.join(extracted_files_dir, filename)
 
 with ZipFile(filepath) as zipObj:
 zipObj.extractall(extracted_file_path)
-
-counter +=1
 else:
 continue
 
@@ -158,5 +159,17 @@ def get_list_of_files(directory_name):
 
 return all_files
 
+def get_list_of_subdir(directory_name):
+
+list_of_file = os.listdir(directory_name)
+subdirs = list()
+
+for filename in list_of_file:
+full_path = os.path.join(directory_name, filename)
+if os.path.isdir(full_path):
+subdirs.append(full_path)
+
+return subdirs
+
 if __name__ == "__main__":
 main(sys.argv[1:])
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/ooxml-analyze' - bin/ooxml-analyze.py

2021-05-26 Thread Gülşah Köse (via logerrit)
 bin/ooxml-analyze.py |   28 
 1 file changed, 24 insertions(+), 4 deletions(-)

New commits:
commit dbb7762b1235ae245fd5b67046737edf5519fbd9
Author: Gülşah Köse 
AuthorDate: Wed May 26 16:47:12 2021 +0300
Commit: Gülşah Köse 
CommitDate: Wed May 26 16:47:12 2021 +0300

Replace namespaces with namespace aliases on result

Change-Id: If29c0b5d9eb52a7d42a1d1482010653d2714c8fe

diff --git a/bin/ooxml-analyze.py b/bin/ooxml-analyze.py
index efc44bbfa32c..3f9b0e8bdad1 100755
--- a/bin/ooxml-analyze.py
+++ b/bin/ooxml-analyze.py
@@ -33,8 +33,8 @@ def main(argv):
 if(extracted_files_dir_by_user == ''):
 # use default directory path for extracted ooxml files.
 extracted_files_dir = os.path.join(outputdir, 'extractedfiles')
-
 extract_files(inputdir, extracted_files_dir)
+
 count_elements(extracted_files_dir, result_list)
 else:
 # use user defined directory path for extracted ooxml files.
@@ -58,17 +58,36 @@ def extract_files(inputdir, extracted_files_dir):
 filename.endswith(".docx") or   \
 filename.endswith(".xlsx")) and not \
 filename.startswith("~"):
-
 filepath = os.path.join(inputdir, filename)
 extracted_file_path = os.path.join(extracted_files_dir, 
str(counter))
 
 with ZipFile(filepath) as zipObj:
 zipObj.extractall(extracted_file_path)
 
-counter += 1
+counter +=1
 else:
 continue
 
+# get key of value in dictionary
+def get_key(val, dict):
+for key, value in dict.items():
+ if val == value:
+ return str(key)
+return ''
+
+# replace curlybrace namespaces with the shorten ones
+def replace_namespace_with_alias(filename, element):
+namespaces = dict([node for _, node in ET.iterparse(filename, 
events=['start-ns'])])
+i = element.find('}')
+if i>=0:
+element_ns = element[1:i]
+element_ns_alias = get_key(element_ns, namespaces)
+if element_ns_alias !='':
+element = element.replace("{" + element_ns + "}", element_ns_alias 
+ ":")
+else:
+element = element.replace("{" + element_ns + "}", "")
+return element
+
 # counts tags, attribute names and values of xmls
 def count_elements(extracted_files_dir, result_list):
 
@@ -87,7 +106,7 @@ def count_elements(extracted_files_dir, result_list):
 
 # start to count
 for child in root.iter():
-tag = str(child.tag)
+tag = replace_namespace_with_alias(xmlfile, child.tag)
 tag_idx = get_index_of_tag(tag, result_list)
 
 # count tags
@@ -99,6 +118,7 @@ def count_elements(extracted_files_dir, result_list):
 
 # count attribute names and values of current tag
 for attr_name, attr_value in child.attrib.items():
+attr_name = replace_namespace_with_alias(xmlfile, 
attr_name)
 if not attr_name in result_list[tag_idx][1].keys():
 result_list[tag_idx][1][attr_name] = 1
 else:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - oox/source sd/qa

2021-05-26 Thread Gülşah Köse (via logerrit)
 oox/source/drawingml/textcharacterproperties.cxx |2 +
 sd/qa/unit/data/pptx/tdf96061.pptx   |binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   36 +++
 3 files changed, 38 insertions(+)

New commits:
commit 2ff2a77990a09637321417bfda23206a5a8306e8
Author: Gülşah Köse 
AuthorDate: Wed May 19 14:37:36 2021 +0300
Commit: Andras Timar 
CommitDate: Wed May 26 15:20:47 2021 +0200

tdf#96061 Unset the highlight property

When we have highlight property on specific part of the text
the following texts were highligthing. To prevent this we unset the
highlight property when we have not highlight property anymore.

Change-Id: I802cde1c784afe47201a9ba4f41827dd0c705035
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115800
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116176
Reviewed-by: Andras Timar 

diff --git a/oox/source/drawingml/textcharacterproperties.cxx 
b/oox/source/drawingml/textcharacterproperties.cxx
index 20965e33abb1..4eb5acaffb56 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -177,6 +177,8 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& 
rPropMap, const XmlFil
 
 if( maHighlightColor.isUsed() )
 rPropMap.setProperty( PROP_CharBackColor, maHighlightColor.getColor( 
rFilter.getGraphicHelper() ));
+else
+rPropMap.setProperty( PROP_CharBackColor, sal_Int32(-1));
 }
 
 static void pushToGrabBag( PropertySet& rPropSet, const 
std::vector& aVectorOfPropertyValues )
diff --git a/sd/qa/unit/data/pptx/tdf96061.pptx 
b/sd/qa/unit/data/pptx/tdf96061.pptx
new file mode 100644
index ..c6e6aa5ae16f
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf96061.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index ce8280e54f24..bf701ac3ecc1 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -206,6 +206,7 @@ public:
 void testShapeSoftEdgeEffect();
 void testShapeShadowBlurEffect();
 void testTdf119223();
+void testTdf96061_textHighlight();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -327,6 +328,7 @@ public:
 CPPUNIT_TEST(testShapeSoftEdgeEffect);
 CPPUNIT_TEST(testShapeShadowBlurEffect);
 CPPUNIT_TEST(testTdf119223);
+CPPUNIT_TEST(testTdf96061_textHighlight);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -3074,6 +3076,40 @@ void SdOOXMLExportTest2::testTdf119223()
 "//p:cNvPr[@name='SomeGroup']");
 }
 
+void SdOOXMLExportTest2::testTdf96061_textHighlight()
+{
+::sd::DrawDocShellRef xDocShRef = loadURL( 
m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf96061.pptx"), PPTX);
+
+uno::Reference xShape(getShapeFromPage(0, 0, 
xDocShRef));
+uno::Reference const 
xParagraph1(getParagraphFromShape(0, xShape));
+uno::Reference xRun1(getRunFromParagraph(0, 
xParagraph1));
+uno::Reference< beans::XPropertySet> xPropSet1(xRun1, 
uno::UNO_QUERY_THROW);
+sal_Int32 aColor;
+xPropSet1->getPropertyValue("CharBackColor") >>= aColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(16776960), aColor);
+
+uno::Reference const 
xParagraph2(getParagraphFromShape(1, xShape));
+uno::Reference xRun2(getRunFromParagraph(0, 
xParagraph2));
+uno::Reference< beans::XPropertySet> xPropSet2(xRun2, 
uno::UNO_QUERY_THROW);
+xPropSet2->getPropertyValue("CharBackColor") >>= aColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), aColor);
+
+xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+
+uno::Reference xShape2(getShapeFromPage(0, 0, 
xDocShRef));
+uno::Reference const 
xParagraph3(getParagraphFromShape(0, xShape2));
+uno::Reference xRun3(getRunFromParagraph(0, 
xParagraph3));
+uno::Reference< beans::XPropertySet> xPropSet3(xRun3, 
uno::UNO_QUERY_THROW);
+xPropSet3->getPropertyValue("CharBackColor") >>= aColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(16776960), aColor);
+
+uno::Reference const 
xParagraph4(getParagraphFromShape(1, xShape2));
+uno::Reference xRun4(getRunFromParagraph(0, 
xParagraph4));
+uno::Reference< beans::XPropertySet> xPropSet4(xRun4, 
uno::UNO_QUERY_THROW);
+xPropSet4->getPropertyValue("CharBackColor") >>= aColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), aColor);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sw/inc sw/source

2021-05-26 Thread Gülşah Köse (via logerrit)
 sw/inc/strings.hrc   |3 ---
 sw/inc/view.hxx  |3 ---
 sw/source/uibase/uiview/view.cxx |   37 -
 3 files changed, 43 deletions(-)

New commits:
commit f5f9efeaae89623c9a2b86ad4e77448d8be76576
Author: Gülşah Köse 
AuthorDate: Mon May 24 00:19:53 2021 +0300
Commit: Miklos Vajna 
CommitDate: Wed May 26 14:46:46 2021 +0200

Mail Merge: Remove the missing data source warning on load.

User can easily forget that they (or somebody else ) added a
data source to document. This warning is only useful for the
user that plans to use mail merge wizard. When they don't plan
to use mail merge wizard and see that warning on infobar they
can confuse. We already have the same warning on mail merge
dialog itself. We don't need on load warning anymore.

Change-Id: I8d80148a9637ee66cc35e2ef583fff51a04386eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116029
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116132
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index 4fabab278917..c2b15f563c68 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -1383,9 +1383,6 @@
 #define STR_AUTOMARK_YES
NC_("createautomarkdialog|yes", "Yes")
 #define STR_AUTOMARK_NO NC_("createautomarkdialog|no", 
"No")
 
-#define STR_DATASOURCE_NOT_AVAILABLE
NC_("STR_DATASOURCE_NOT_AVAILABLE", "Data source is not available. Mail merge 
wizard will not work properly.")
-#define STR_EXCHANGE_DATABASE   NC_("STR_EXCHANGE_DATABASE", 
"Exchange Database")
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index fc855b426d85..32cc9b545b6d 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -543,8 +543,6 @@ public:
 // form control has been activated
 DECL_LINK( FormControlActivated, LinkParamNone*, void );
 
-DECL_LINK( ExchangeDatabaseHandler, Button*, void);
-
 // edit links
 voidEditLinkDlg();
 voidAutoCaption(const sal_uInt16 nType, const SvGlobalName 
*pOleId = nullptr);
@@ -616,7 +614,6 @@ public:
 
 OUString GetDataSourceName() const;
 static bool IsDataSourceAvailable(const OUString sDataSourceName);
-void AppendDataSourceInfobar();
 
 void ExecFormatPaintbrush(SfxRequest const &);
 void StateFormatPaintbrush(SfxItemSet &);
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 23127155d4f6..e2fa03b5f2ce 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -232,11 +232,6 @@ IMPL_LINK_NOARG(SwView, FormControlActivated, 
LinkParamNone*, void)
 }
 }
 
-IMPL_LINK_NOARG(SwView, ExchangeDatabaseHandler, Button*, void)
-{
-GetDispatcher().Execute(FN_CHANGE_DBFIELD);
-}
-
 namespace
 {
 uno::Reference getLayoutManager(const SfxViewFrame& 
rViewFrame)
@@ -1659,23 +1654,6 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& 
rHint )
 }
 else
 {
-if (auto pSfxEventHint = dynamic_cast())
-{
-switch( pSfxEventHint->GetEventId() )
-{
-case SfxEventHintId::CreateDoc:
-case SfxEventHintId::OpenDoc:
-{
-OUString sDataSourceName = GetDataSourceName();
-if ( !sDataSourceName.isEmpty() && 
!IsDataSourceAvailable(sDataSourceName))
-AppendDataSourceInfobar();
-}
-break;
-default:
-break;
-}
-}
-
 SfxHintId nId = rHint.GetId();
 
 switch ( nId )
@@ -1939,21 +1917,6 @@ bool SwView::IsDataSourceAvailable(const OUString 
sDataSourceName)
 return xDatabaseContext->hasByName(sDataSourceName);
 }
 
-void SwView::AppendDataSourceInfobar()
-{
-auto pInfoBar = GetViewFrame()->AppendInfoBar("datasource", "",
-  SwResId(STR_DATASOURCE_NOT_AVAILABLE),
-  InfobarType::WARNING);
-if (!pInfoBar)
-return;
-
-VclPtrInstance xBtn(GetWindow());
-xBtn->SetText(SwResId(STR_EXCHANGE_DATABASE));
-xBtn->SetSizePixel(xBtn->GetOptimalSize());
-xBtn->SetClickHdl(LINK(this, SwView, ExchangeDatabaseHandler));
-pInfoBar->addButton(xBtn);
-}
-
 namespace sw {
 
 void InitPrintOptionsFromApplication(SwPrintData & o_rData, bool const bWeb)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-26 Thread Gülşah Köse (via logerrit)
 oox/source/drawingml/textcharacterproperties.cxx |2 +
 sd/qa/unit/data/pptx/tdf96061.pptx   |binary
 sd/qa/unit/export-tests-ooxml2.cxx   |   36 +++
 3 files changed, 38 insertions(+)

New commits:
commit 1cd26a9ab64482daf4de08f5bb7730d0a991bbce
Author: Gülşah Köse 
AuthorDate: Wed May 19 14:37:36 2021 +0300
Commit: Gülşah Köse 
CommitDate: Wed May 26 10:14:57 2021 +0200

tdf#96061 Unset the highlight property

When we have highlight property on specific part of the text
the following texts were highligthing. To prevent this we unset the
highlight property when we have not highlight property anymore.

Change-Id: I802cde1c784afe47201a9ba4f41827dd0c705035
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115800
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/oox/source/drawingml/textcharacterproperties.cxx 
b/oox/source/drawingml/textcharacterproperties.cxx
index 20965e33abb1..4eb5acaffb56 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -177,6 +177,8 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& 
rPropMap, const XmlFil
 
 if( maHighlightColor.isUsed() )
 rPropMap.setProperty( PROP_CharBackColor, maHighlightColor.getColor( 
rFilter.getGraphicHelper() ));
+else
+rPropMap.setProperty( PROP_CharBackColor, sal_Int32(-1));
 }
 
 static void pushToGrabBag( PropertySet& rPropSet, const 
std::vector& aVectorOfPropertyValues )
diff --git a/sd/qa/unit/data/pptx/tdf96061.pptx 
b/sd/qa/unit/data/pptx/tdf96061.pptx
new file mode 100644
index ..c6e6aa5ae16f
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf96061.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 6c12ac08928c..973503cc3b80 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -212,6 +212,7 @@ public:
 void testTdf128213ShapeRot();
 void testTdf125560_textDeflate();
 void testTdf125560_textInflateTop();
+void testTdf96061_textHighlight();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
 
@@ -338,6 +339,7 @@ public:
 CPPUNIT_TEST(testTdf128213ShapeRot);
 CPPUNIT_TEST(testTdf125560_textDeflate);
 CPPUNIT_TEST(testTdf125560_textInflateTop);
+CPPUNIT_TEST(testTdf96061_textHighlight);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -3191,6 +3193,40 @@ void SdOOXMLExportTest2::testTdf125560_textInflateTop()
 assertXPath(pXmlDocRels, 
"/office:document-content/office:body/office:presentation/draw:page/draw:custom-shape/draw:enhanced-geometry",
 "type", "mso-spt164");
 }
 
+void SdOOXMLExportTest2::testTdf96061_textHighlight()
+{
+::sd::DrawDocShellRef xDocShRef = loadURL( 
m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf96061.pptx"), PPTX);
+
+uno::Reference xShape(getShapeFromPage(0, 0, 
xDocShRef));
+uno::Reference const 
xParagraph1(getParagraphFromShape(0, xShape));
+uno::Reference xRun1(getRunFromParagraph(0, 
xParagraph1));
+uno::Reference< beans::XPropertySet> xPropSet1(xRun1, 
uno::UNO_QUERY_THROW);
+sal_Int32 aColor;
+xPropSet1->getPropertyValue("CharBackColor") >>= aColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(16776960), aColor);
+
+uno::Reference const 
xParagraph2(getParagraphFromShape(1, xShape));
+uno::Reference xRun2(getRunFromParagraph(0, 
xParagraph2));
+uno::Reference< beans::XPropertySet> xPropSet2(xRun2, 
uno::UNO_QUERY_THROW);
+xPropSet2->getPropertyValue("CharBackColor") >>= aColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), aColor);
+
+xDocShRef = saveAndReload( xDocShRef.get(), PPTX );
+
+uno::Reference xShape2(getShapeFromPage(0, 0, 
xDocShRef));
+uno::Reference const 
xParagraph3(getParagraphFromShape(0, xShape2));
+uno::Reference xRun3(getRunFromParagraph(0, 
xParagraph3));
+uno::Reference< beans::XPropertySet> xPropSet3(xRun3, 
uno::UNO_QUERY_THROW);
+xPropSet3->getPropertyValue("CharBackColor") >>= aColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(16776960), aColor);
+
+uno::Reference const 
xParagraph4(getParagraphFromShape(1, xShape2));
+uno::Reference xRun4(getRunFromParagraph(0, 
xParagraph4));
+uno::Reference< beans::XPropertySet> xPropSet4(xRun4, 
uno::UNO_QUERY_THROW);
+xPropSet4->getPropertyValue("CharBackColor") >>= aColor;
+CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), aColor);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: editeng/source include/editeng

2021-05-26 Thread Gülşah Köse (via logerrit)
 editeng/source/items/textitem.cxx |   66 --
 include/editeng/colritem.hxx  |   24 -
 2 files changed, 78 insertions(+), 12 deletions(-)

New commits:
commit 350d40417fe2cb56e16116f12216d08b9f2705b0
Author: Gülşah Köse 
AuthorDate: Wed May 26 08:47:38 2021 +0300
Commit: Gülşah Köse 
CommitDate: Wed May 26 09:04:37 2021 +0200

Seperate SvxBackgroundColorItem from SvxColorItem

SvxBackgroundColorItem derivated from SfxPoolItem instead of
SvxColorItem.

Casting is common usage to control if object is this or not.
When we can cast SvxBackgroundColorItem to SvxColorItem we can not
seperate them anymore.

eg: Char color is a SvxColorItem and char background color is a
SvxBackgroundColorItem. They can be hold together and we should
understand they are different types.

Change-Id: I7b1879a1b00de26c0b8a2d9f8d658aa3aef75ecb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116135
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index ed4806159a04..d67bd02df5c1 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1313,26 +1313,32 @@ bool SvxContourItem::GetPresentation
 // class SvxBackgroundColorItem -
 
 SvxBackgroundColorItem::SvxBackgroundColorItem( const sal_uInt16 nId ) :
-SvxColorItem( nId )
+SfxPoolItem( nId ),
+mColor( COL_WHITE )
 {
 }
 
+SvxBackgroundColorItem::SvxBackgroundColorItem( const Color& rCol, const 
sal_uInt16 nId ) :
+SfxPoolItem( nId ),
+mColor( rCol )
+{
+}
 
-SvxBackgroundColorItem::SvxBackgroundColorItem( const Color& rCol,
-const sal_uInt16 nId ) :
-SvxColorItem( rCol, nId )
+SvxBackgroundColorItem::~SvxBackgroundColorItem()
 {
 }
 
-SvxBackgroundColorItem* SvxBackgroundColorItem::Clone( SfxItemPool * ) const
+bool SvxBackgroundColorItem::operator==( const SfxPoolItem& rAttr ) const
 {
-return new SvxBackgroundColorItem(*this);
+assert(SfxPoolItem::operator==(rAttr));
+
+return  mColor == static_cast( rAttr 
).mColor;
 }
 
 bool SvxBackgroundColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) 
const
 {
 nMemberId &= ~CONVERT_TWIPS;
-Color aColor = SvxColorItem::GetValue();
+Color aColor = SvxBackgroundColorItem::GetValue();
 
 switch( nMemberId )
 {
@@ -1354,27 +1360,67 @@ bool SvxBackgroundColorItem::PutValue( const uno::Any& 
rVal, sal_uInt8 nMemberId
 {
 nMemberId &= ~CONVERT_TWIPS;
 Color nColor;
-Color aColor = SvxColorItem::GetValue();
+Color aColor = SvxBackgroundColorItem::GetValue();
 
 switch( nMemberId )
 {
 case MID_GRAPHIC_TRANSPARENT:
 {
 aColor.SetAlpha( Any2Bool( rVal ) ? 0 : 255 );
-SvxColorItem::SetValue( aColor );
+SvxBackgroundColorItem::SetValue( aColor );
 break;
 }
 default:
 {
 if(!(rVal >>= nColor))
 return false;
-SvxColorItem::SetValue( nColor );
+SvxBackgroundColorItem::SetValue( nColor );
 break;
 }
 }
 return true;
 }
 
+SvxBackgroundColorItem* SvxBackgroundColorItem::Clone( SfxItemPool * ) const
+{
+return new SvxBackgroundColorItem(*this);
+}
+
+
+bool SvxBackgroundColorItem::GetPresentation
+(
+SfxItemPresentation /*ePres*/,
+MapUnit /*eCoreUnit*/,
+MapUnit /*ePresUnit*/,
+OUString&   rText, const IntlWrapper& /*rIntl*/
+)   const
+{
+rText = ::GetColorString( mColor );
+return true;
+}
+
+void SvxBackgroundColorItem::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+(void)xmlTextWriterStartElement(pWriter, 
BAD_CAST("SvxBackgroundColorItem"));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), 
BAD_CAST(OString::number(Which()).getStr()));
+
+std::stringstream ss;
+ss << mColor;
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), 
BAD_CAST(ss.str().c_str()));
+
+OUString aStr;
+IntlWrapper aIntlWrapper(SvtSysLocale().GetUILanguageTag());
+GetPresentation( SfxItemPresentation::Complete, MapUnit::Map100thMM, 
MapUnit::Map100thMM, aStr, aIntlWrapper);
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), 
BAD_CAST(OUStringToOString(aStr, RTL_TEXTENCODING_UTF8).getStr()));
+(void)xmlTextWriterEndElement(pWriter);
+}
+
+void SvxBackgroundColorItem::SetValue( const Color& rNewCol )
+{
+mColor = rNewCol;
+}
+
+
 // class SvxColorItem 
 SvxColorItem::SvxColorItem( const sal_uInt16 nId ) :
 SfxPoolItem( nId ),
diff --git a/include/editeng/colritem.hxx b/include/editeng/colritem.hxx
index 1eab79723577..8e081fc6aab1 100644
--- a/include/editeng/colritem.hxx
+++ 

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

2021-05-24 Thread Gülşah Köse (via logerrit)
 sw/inc/strings.hrc   |3 ---
 sw/inc/view.hxx  |3 ---
 sw/source/uibase/uiview/view.cxx |   35 ---
 3 files changed, 41 deletions(-)

New commits:
commit 5ef0461b647dbb01a037459b39b47240abb85fca
Author: Gülşah Köse 
AuthorDate: Mon May 24 00:19:53 2021 +0300
Commit: Gülşah Köse 
CommitDate: Mon May 24 10:02:00 2021 +0200

Mail Merge: Remove the missing data source warning on load.

User can easily forget that they (or somebody else ) added a
data source to document. This warning is only useful for the
user that plans to use mail merge wizard. When they don't plan
to use mail merge wizard and see that warning on infobar they
can confuse. We already have the same warning on mail merge
dialog itself. We don't need on load warning anymore.

Change-Id: I8d80148a9637ee66cc35e2ef583fff51a04386eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116029
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index b4cd30c0fc47..9bcd76aad2b8 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -1415,9 +1415,6 @@
 #define STR_AUTOMARK_NO NC_("createautomarkdialog|no", 
"No")
 
 #define STR_WRAP_PANEL_CUSTOM_STR   NC_("sidebarwrap|customlabel", 
"Custom")
-#define STR_DATASOURCE_NOT_AVAILABLE
NC_("STR_DATASOURCE_NOT_AVAILABLE", "Data source is not available. Mail merge 
wizard will not work properly.")
-#define STR_EXCHANGE_DATABASE   NC_("STR_EXCHANGE_DATABASE", 
"Exchange Database")
-
 
 #endif
 
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index 73dfc1c7a54f..7b3f6d490066 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -555,8 +555,6 @@ public:
 // form control has been activated
 DECL_LINK( FormControlActivated, LinkParamNone*, void );
 
-DECL_LINK( ExchangeDatabaseHandler, weld::Button&, void);
-
 // edit links
 voidEditLinkDlg();
 voidAutoCaption(const sal_uInt16 nType, const SvGlobalName 
*pOleId = nullptr);
@@ -628,7 +626,6 @@ public:
 
 OUString GetDataSourceName() const;
 static bool IsDataSourceAvailable(const OUString sDataSourceName);
-void AppendDataSourceInfobar();
 
 void ExecFormatPaintbrush(SfxRequest const &);
 void StateFormatPaintbrush(SfxItemSet &);
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 2590b3afe94d..5612191cc77a 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -212,11 +212,6 @@ IMPL_LINK_NOARG(SwView, FormControlActivated, 
LinkParamNone*, void)
 }
 }
 
-IMPL_LINK_NOARG(SwView, ExchangeDatabaseHandler, weld::Button&, void)
-{
-GetDispatcher().Execute(FN_CHANGE_DBFIELD);
-}
-
 namespace
 {
 uno::Reference getLayoutManager(const SfxViewFrame& 
rViewFrame)
@@ -1643,23 +1638,6 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& 
rHint )
 }
 else
 {
-if (auto pSfxEventHint = dynamic_cast())
-{
-switch( pSfxEventHint->GetEventId() )
-{
-case SfxEventHintId::CreateDoc:
-case SfxEventHintId::OpenDoc:
-{
-OUString sDataSourceName = GetDataSourceName();
-if ( !sDataSourceName.isEmpty() && 
!IsDataSourceAvailable(sDataSourceName))
-AppendDataSourceInfobar();
-}
-break;
-default:
-break;
-}
-}
-
 SfxHintId nId = rHint.GetId();
 
 switch ( nId )
@@ -1923,19 +1901,6 @@ bool SwView::IsDataSourceAvailable(const OUString 
sDataSourceName)
 return xDatabaseContext->hasByName(sDataSourceName);
 }
 
-void SwView::AppendDataSourceInfobar()
-{
-auto pInfoBar = GetViewFrame()->AppendInfoBar("datasource", "",
-  SwResId(STR_DATASOURCE_NOT_AVAILABLE),
-  InfobarType::WARNING);
-if (!pInfoBar)
-return;
-
-weld::Button& rBtn = pInfoBar->addButton();
-rBtn.set_label(SwResId(STR_EXCHANGE_DATABASE));
-rBtn.connect_clicked(LINK(this, SwView, ExchangeDatabaseHandler));
-}
-
 namespace sw {
 
 void InitPrintOptionsFromApplication(SwPrintData & o_rData, bool const bWeb)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'feature/ooxml-analyze'

2021-05-24 Thread Gülşah Köse (via logerrit)
New branch 'feature/ooxml-analyze' available with the following commits:
commit d53433ed5f10315e26cb709d6295fc5317c453cb
Author: Gülşah Köse 
Date:   Mon May 24 01:05:37 2021 +0300

Inital commit of ooxml analyze tool

* Reads input ooxml files given by the user
* Extracts the files into output directory given by user
* Counts tags, attributes, and values.
* Holds the result in result_list structure.
result list is a list that contains a nested list for each tag
Each list holds four dictionaries,
  - first one for tags and counts
  - second one for attributes and counts,
  - third one for values and counts
  - last one for the plain texts between tags
* Prints to result list.
* As an option it can skip extract step and read extracted files
path from the user.

Change-Id: I2d942984cad118fc479c5b04acf8b8a72c519807

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


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

2021-05-17 Thread Gülşah Köse (via logerrit)
 sfx2/uiconfig/ui/developmenttool.ui |   85 +---
 1 file changed, 42 insertions(+), 43 deletions(-)

New commits:
commit 81d6ed89d1e5268c2ea4ff527f3e6087dc1d8ccd
Author: Gülşah Köse 
AuthorDate: Mon May 17 13:59:25 2021 +0300
Commit: Gülşah Köse 
CommitDate: Tue May 18 05:39:37 2021 +0200

tdf#142276 Use vertical GtkBox insted of horizontal GtkGrid for the left 
side.

Keep the layout as simple as possible.

Change-Id: Ie4e77e76dccd4f0a6f41e646ba819dba161b3cc8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115701
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/sfx2/uiconfig/ui/developmenttool.ui 
b/sfx2/uiconfig/ui/developmenttool.ui
index 27962e5863e7..476f9ed610cf 100644
--- a/sfx2/uiconfig/ui/developmenttool.ui
+++ b/sfx2/uiconfig/ui/developmenttool.ui
@@ -69,55 +69,14 @@
 True
 
   
-  
+  
 True
 False
+vertical
 6
 6
 6
 6
-True
-True
-
-  
-200
-True
-True
-True
-True
-in
-
-  
-True
-True
-True
-True
-liststore1
-0
-True
-
-  
-
-
-  
-True
-Object
-
-  
-  
-0
-  
-
-  
-
-  
-
-  
-  
-0
-1
-  
-
 
   
 True
@@ -170,6 +129,46 @@
 0
   
 
+
+  
+200
+True
+True
+True
+True
+in
+
+  
+True
+True
+True
+True
+liststore1
+0
+True
+
+  
+
+
+  
+True
+Object
+
+  
+  
+0
+  
+
+  
+
+  
+
+  
+  
+0
+1
+  
+
   
   
 False
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-17 Thread Gülşah Köse (via logerrit)
 include/sfx2/devtools/ObjectInspectorTreeHandler.hxx |2 +
 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx  |   32 +++
 sfx2/uiconfig/ui/developmenttool.ui  |   10 -
 3 files changed, 34 insertions(+), 10 deletions(-)

New commits:
commit b1c0734ffe0f395757b6e0cea7830d820231afeb
Author: Gülşah Köse 
AuthorDate: Mon May 17 00:08:12 2021 +0300
Commit: Gülşah Köse 
CommitDate: Mon May 17 23:57:17 2021 +0200

tdf#141677 Make columns sortable

Change-Id: Ib4cb8aaba4c59a7afa347f8010deef41477b77f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115688
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx 
b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
index a9cf5be3dae6..03188276a4b4 100644
--- a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -83,6 +83,8 @@ public:
 DECL_LINK(NotebookEnterPage, const OString&, void);
 DECL_LINK(NotebookLeavePage, const OString&, bool);
 
+DECL_LINK(HeaderBarClick, int, void);
+
 void introspect(css::uno::Reference const& 
xInterface);
 
 void dispose();
diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx 
b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
index 60a81be9ab60..d7d4895e5d6b 100644
--- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
+++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
@@ -956,6 +956,15 @@ ObjectInspectorTreeHandler::ObjectInspectorTreeHandler(
 mpObjectInspectorWidgets->mpPropertiesTreeView->make_sorted();
 mpObjectInspectorWidgets->mpMethodsTreeView->make_sorted();
 
+mpObjectInspectorWidgets->mpInterfacesTreeView->connect_column_clicked(
+LINK(this, ObjectInspectorTreeHandler, HeaderBarClick));
+mpObjectInspectorWidgets->mpServicesTreeView->connect_column_clicked(
+LINK(this, ObjectInspectorTreeHandler, HeaderBarClick));
+mpObjectInspectorWidgets->mpPropertiesTreeView->connect_column_clicked(
+LINK(this, ObjectInspectorTreeHandler, HeaderBarClick));
+mpObjectInspectorWidgets->mpMethodsTreeView->connect_column_clicked(
+LINK(this, ObjectInspectorTreeHandler, HeaderBarClick));
+
 mpObjectInspectorWidgets->mpToolbar->connect_clicked(
 LINK(this, ObjectInspectorTreeHandler, ToolbarButtonClicked));
 mpObjectInspectorWidgets->mpToolbar->set_item_sensitive("inspect", false);
@@ -1040,6 +1049,29 @@ IMPL_LINK(ObjectInspectorTreeHandler, SelectionChanged, 
weld::TreeView&, rTreeVi
 mpObjectInspectorWidgets->mpToolbar->set_item_sensitive("inspect", 
bHaveNodeWithObject);
 }
 
+static void updateOrder(std::unique_ptr& pTreeView, sal_Int32 
nColumn)
+{
+pTreeView->set_sort_column(nColumn);
+
+bool bSortAtoZ = pTreeView->get_sort_order();
+pTreeView->set_sort_order(!bSortAtoZ);
+pTreeView->set_sort_indicator(!bSortAtoZ ? TRISTATE_TRUE : TRISTATE_FALSE, 
nColumn);
+}
+
+IMPL_LINK(ObjectInspectorTreeHandler, HeaderBarClick, int, nColumn, void)
+{
+auto rPageId = 
mpObjectInspectorWidgets->mpNotebook->get_current_page_ident();
+
+if (rPageId == "object_inspector_interfaces_tab")
+updateOrder(mpObjectInspectorWidgets->mpInterfacesTreeView, nColumn);
+else if (rPageId == "object_inspector_services_tab")
+updateOrder(mpObjectInspectorWidgets->mpServicesTreeView, nColumn);
+else if (rPageId == "object_inspector_properties_tab")
+updateOrder(mpObjectInspectorWidgets->mpPropertiesTreeView, nColumn);
+else if (rPageId == "object_inspector_methods_tab")
+updateOrder(mpObjectInspectorWidgets->mpMethodsTreeView, nColumn);
+}
+
 IMPL_LINK(ObjectInspectorTreeHandler, PopupMenuHandler, const CommandEvent&, 
rCommandEvent, bool)
 {
 if (rCommandEvent.GetCommand() != CommandEventId::ContextMenu)
diff --git a/sfx2/uiconfig/ui/developmenttool.ui 
b/sfx2/uiconfig/ui/developmenttool.ui
index 58e03b3cf21a..27962e5863e7 100644
--- a/sfx2/uiconfig/ui/developmenttool.ui
+++ b/sfx2/uiconfig/ui/developmenttool.ui
@@ -320,7 +320,6 @@
 Name
 True
 True
-0
 
   
   
@@ -366,7 +365,6 @@
 Name
 True
 True
-0
 
   
   
@@ -421,7 +419,6 @@
 Object
 True
 True
-0
 
   
   
@@ -436,7 +433,6 @@
 Value
 True
  

  1   2   3   4   >