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

2020-12-11 Thread Yusuf Keten (via logerrit)
 cui/source/dialogs/AdditionsDialog.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 516c9acad348872dd2d0c1b26a013c68f8cf55b4
Author: Yusuf Keten 
AuthorDate: Sun Dec 6 02:47:34 2020 +0300
Commit: Muhammet Kara 
CommitDate: Fri Dec 11 14:54:00 2020 +0100

Additions Dialog URL change

After this patch, extensions in Additions Dialog will
be updated every day.

Change-Id: Ia76e36e9d07f73b8102713709c2891723f6a44d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107270
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index 383afdaa62dc..2a00f1f28a0c 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -463,7 +463,7 @@ AdditionsDialog::AdditionsDialog(weld::Window* pParent, 
const OUString& sAdditio
 m_sTag = "allextensions"; // Means empty parameter
 }
 //FIXME: Temporary URL
-OUString rURL = "https://yusufketen.com/api/; + m_sTag + ".json";
+OUString rURL = "https://libreoffice.yusufketen.com/api/; + m_sTag + 
".json";
 m_sURL = rURL;
 
 m_xExtensionManager
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-30 Thread Yusuf Keten (via logerrit)
 cui/source/dialogs/AdditionsDialog.cxx |5 -
 cui/uiconfig/ui/additionsfragment.ui   |   14 +++---
 2 files changed, 11 insertions(+), 8 deletions(-)

New commits:
commit 6379f799704935a571a4b3af44cabd0671c48dbe
Author: Yusuf Keten 
AuthorDate: Fri Aug 28 13:57:57 2020 +0300
Commit: Muhammet Kara 
CommitDate: Sun Aug 30 19:44:40 2020 +0200

tdf#135273: Tight integration dialog shows unclear properties

When there is no info about the author of the extension, the label was NULL.
If it is null, it will be empty after this patch.

The initial label of the labelAuthor is cleared. Also, unnecessary 
translatable expressions in the additionsfragment.ui were deleted.

Change-Id: Iab9517f1b3ff5d8c6b3947d7b29c897c18e94664
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101537
Tested-by: Muhammet Kara 
Reviewed-by: Muhammet Kara 

diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index 7d26416c910c..3586704a1e9b 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -685,7 +685,10 @@ AdditionsItem::AdditionsItem(weld::Widget* pParent, 
AdditionsDialog* pParentDial
 
 m_xLinkButtonName->set_uri(additionInfo.sExtensionURL);
 m_xLabelDescription->set_label(additionInfo.sIntroduction);
-m_xLabelAuthor->set_label(additionInfo.sAuthorName);
+
+if (!additionInfo.sAuthorName.equalsIgnoreAsciiCase("null"))
+m_xLabelAuthor->set_label(additionInfo.sAuthorName);
+
 m_xButtonInstall->set_label(CuiResId(RID_SVXSTR_ADDITIONS_INSTALLBUTTON));
 OUString sLicenseString = CuiResId(RID_SVXSTR_ADDITIONS_LICENCE) + 
additionInfo.sLicense;
 m_xLabelLicense->set_label(sLicenseString);
diff --git a/cui/uiconfig/ui/additionsfragment.ui 
b/cui/uiconfig/ui/additionsfragment.ui
index 93c8e50ad126..cc1701dfce82 100644
--- a/cui/uiconfig/ui/additionsfragment.ui
+++ b/cui/uiconfig/ui/additionsfragment.ui
@@ -77,7 +77,7 @@
 top
 
   
-button
+button
 True
 True
 True
@@ -97,7 +97,7 @@
 True
 False
 start
-label
+
   
   
 False
@@ -125,7 +125,7 @@
 False
 start
 start
-label
+label
 True
 word-char
 1
@@ -146,7 +146,7 @@
 False
 start
 3
-label
+label
   
   
 False
@@ -160,7 +160,7 @@
 False
 start
 3
-label
+label
   
   
 False
@@ -187,7 +187,7 @@
 
 
   
-button
+button
 True
 True
 True
@@ -338,7 +338,7 @@
 True
 False
 start
-label
+label
 
   
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-28 Thread Yusuf Keten (via logerrit)
 cui/source/dialogs/AdditionsDialog.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 0d7a15c7dd622c3ba035ecca59de4bba57d1ea5e
Author: Yusuf Keten 
AuthorDate: Thu Aug 27 09:09:46 2020 +0300
Commit: Muhammet Kara 
CommitDate: Fri Aug 28 11:42:55 2020 +0200

Additions: Change default sort criteria to number of downloads

Change-Id: Ifcecdbdf5b969305d92c571c4a3a529f2e6597d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101433
Tested-by: Muhammet Kara 
Reviewed-by: Muhammet Kara 

diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index 395198948dea..7d26416c910c 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -446,7 +446,8 @@ void SearchAndParseThread::execute()
 std::string sResponse = curlGet(m_pAdditionsDialog->m_sURL);
 parseResponse(sResponse, m_pAdditionsDialog->m_aAllExtensionsVector);
 std::sort(m_pAdditionsDialog->m_aAllExtensionsVector.begin(),
-  m_pAdditionsDialog->m_aAllExtensionsVector.end(), 
AdditionsDialog::sortByRating);
+  m_pAdditionsDialog->m_aAllExtensionsVector.end(),
+  AdditionsDialog::sortByDownload);
 Search();
 }
 else // Searching
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-26 Thread Yusuf Keten (via logerrit)
 cui/source/dialogs/AdditionsDialog.cxx |   59 +++--
 cui/source/inc/AdditionsDialog.hxx |6 +++
 2 files changed, 55 insertions(+), 10 deletions(-)

New commits:
commit f1e6919a5072b3f4bc67dbf5d8fcde524b74ecf8
Author: Yusuf Keten 
AuthorDate: Fri Aug 21 02:30:26 2020 +0300
Commit: Muhammet Kara 
CommitDate: Wed Aug 26 21:49:22 2020 +0200

tdf#135275: Additions: Sorting of extensions

Change-Id: If10820786ebc1f97aef24a7cb71a9f8a67e4bb8d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101097
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index 7460fb576790..395198948dea 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -445,6 +445,8 @@ void SearchAndParseThread::execute()
 {
 std::string sResponse = curlGet(m_pAdditionsDialog->m_sURL);
 parseResponse(sResponse, m_pAdditionsDialog->m_aAllExtensionsVector);
+std::sort(m_pAdditionsDialog->m_aAllExtensionsVector.begin(),
+  m_pAdditionsDialog->m_aAllExtensionsVector.end(), 
AdditionsDialog::sortByRating);
 Search();
 }
 else // Searching
@@ -471,6 +473,9 @@ AdditionsDialog::AdditionsDialog(weld::Window* pParent, 
const OUString& sAdditio
 , m_xLabelProgress(m_xBuilder->weld_label("labelProgress"))
 , m_xGearBtn(m_xBuilder->weld_menu_button("buttonGear"))
 {
+m_xGearBtn->connect_selected(LINK(this, AdditionsDialog, GearHdl));
+m_xGearBtn->set_item_active("gear_sort_voting", true);
+
 m_aSearchDataTimer.SetInvokeHandler(LINK(this, AdditionsDialog, 
ImplUpdateDataHdl));
 m_aSearchDataTimer.SetDebugName("AdditionsDialog SearchDataTimer");
 m_aSearchDataTimer.SetTimeout(EDIT_UPDATEDATA_TIMEOUT);
@@ -579,6 +584,32 @@ void AdditionsDialog::ClearList()
 this->m_aAdditionsItems.clear();
 }
 
+void AdditionsDialog::RefreshUI()
+{
+if (m_pSearchThread.is())
+m_pSearchThread->StopExecution();
+ClearList();
+m_nCurrentListItemCount = 0;
+m_nMaxItemCount = PAGE_SIZE;
+m_pSearchThread = new SearchAndParseThread(this, false);
+m_pSearchThread->launch();
+}
+
+bool AdditionsDialog::sortByRating(const AdditionInfo& a, const AdditionInfo& 
b)
+{
+return a.sRating.toDouble() > b.sRating.toDouble();
+}
+
+bool AdditionsDialog::sortByComment(const AdditionInfo& a, const AdditionInfo& 
b)
+{
+return a.sCommentNumber.toUInt32() > b.sCommentNumber.toUInt32();
+}
+
+bool AdditionsDialog::sortByDownload(const AdditionInfo& a, const 
AdditionInfo& b)
+{
+return a.sDownloadNumber.toUInt32() > b.sDownloadNumber.toUInt32();
+}
+
 AdditionsItem::AdditionsItem(weld::Widget* pParent, AdditionsDialog* 
pParentDialog,
  AdditionInfo& additionInfo)
 : m_xBuilder(Application::CreateBuilder(pParent, 
"cui/ui/additionsfragment.ui"))
@@ -700,16 +731,7 @@ bool AdditionsItem::getExtensionFile(OUString& 
sExtensionFile)
 return true;
 }
 
-IMPL_LINK_NOARG(AdditionsDialog, ImplUpdateDataHdl, Timer*, void)
-{
-if (m_pSearchThread.is())
-m_pSearchThread->StopExecution();
-ClearList();
-m_nCurrentListItemCount = 0;
-m_nMaxItemCount = PAGE_SIZE;
-m_pSearchThread = new SearchAndParseThread(this, false);
-m_pSearchThread->launch();
-}
+IMPL_LINK_NOARG(AdditionsDialog, ImplUpdateDataHdl, Timer*, void) { 
RefreshUI(); }
 
 IMPL_LINK_NOARG(AdditionsDialog, SearchUpdateHdl, weld::Entry&, void)
 {
@@ -848,4 +870,21 @@ void TmpRepositoryCommandEnv::update(uno::Any const& 
/*Status */) {}
 
 void TmpRepositoryCommandEnv::pop() {}
 
+IMPL_LINK(AdditionsDialog, GearHdl, const OString&, rIdent, void)
+{
+if (rIdent == "gear_sort_voting")
+{
+std::sort(m_aAllExtensionsVector.begin(), 
m_aAllExtensionsVector.end(), sortByRating);
+}
+else if (rIdent == "gear_sort_comments")
+{
+std::sort(m_aAllExtensionsVector.begin(), 
m_aAllExtensionsVector.end(), sortByComment);
+}
+else if (rIdent == "gear_sort_downloads")
+{
+std::sort(m_aAllExtensionsVector.begin(), 
m_aAllExtensionsVector.end(), sortByDownload);
+}
+// After the sorting, UI will be refreshed to update extension list.
+RefreshUI();
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/inc/AdditionsDialog.hxx 
b/cui/source/inc/AdditionsDialog.hxx
index 9061b755a5be..9efaad017af7 100644
--- a/cui/source/inc/AdditionsDialog.hxx
+++ b/cui/source/inc/AdditionsDialog.hxx
@@ -68,6 +68,7 @@ class AdditionsDialog : public weld::GenericDialogController
 private:
 Timer m_aSearchDataTimer;
 
+DECL_LINK(GearHdl, const OString&, void);
 DECL_LINK(SearchUpdateHdl, weld::Entry&, void);
 DECL_LINK(ImplUpdateDataHdl, Timer*, void);
 DECL_LINK(FocusOut_Impl, weld::Widget&, void);
@@ -102,6 +103,11 @@ public:
 getInstalledExtensions();
 void 

[Libreoffice-commits] core.git: 2 commits - cui/source include/xmloff xmloff/inc xmloff/source

2020-08-25 Thread Yusuf Keten (via logerrit)
 cui/source/dialogs/AdditionsDialog.cxx  |1 +
 include/xmloff/prstylei.hxx |4 
 xmloff/inc/PageMasterImportContext.hxx  |5 ++---
 xmloff/source/style/PageMasterImportContext.cxx |6 +++---
 xmloff/source/style/prstylei.cxx|   10 ++
 xmloff/source/style/xmlstyle.cxx|   17 -
 6 files changed, 28 insertions(+), 15 deletions(-)

New commits:
commit ba9c11e0186844fffa02c594a5c49aad4a52242c
Author: Yusuf Keten 
AuthorDate: Tue Aug 25 02:09:20 2020 +0300
Commit: Muhammet Kara 
CommitDate: Tue Aug 25 11:18:24 2020 +0200

tdf#133026: Additions: Set label of install button for installed extensions

Change-Id: Ic45f5684c1b483e294179e151d6beec34de2e004
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101297
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index 680e519a60d0..7460fb576790 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -422,6 +422,7 @@ void SearchAndParseThread::CheckInstalledExtensions()
 else
 {
 rInfo->m_xButtonInstall->set_sensitive(false);
+rInfo->m_xButtonInstall->set_label("Installed");
 }
 }
 }
commit 4070818f586a46a2b572501aca152bb811fa2d5b
Author: Noel Grandin 
AuthorDate: Tue Aug 25 08:58:16 2020 +0200
Commit: Noel Grandin 
CommitDate: Tue Aug 25 11:18:11 2020 +0200

use fastparser in PageStyleContext

Change-Id: Iaa433e5c8c5712bbcbef519c613927dbffa22906
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101305
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/xmloff/prstylei.hxx b/include/xmloff/prstylei.hxx
index 42f5c732c423..0bb6243b57f5 100644
--- a/include/xmloff/prstylei.hxx
+++ b/include/xmloff/prstylei.hxx
@@ -93,6 +93,10 @@ public:
 const css::uno::Reference< css::xml::sax::XAttributeList > & 
xAttrList,
 SvXMLStylesContext& rStyles, XmlStyleFamily nFamily,
 bool bDefaultStyle=false );
+XMLPropStyleContext( SvXMLImport& rImport, sal_Int32 nElement,
+const css::uno::Reference< css::xml::sax::XFastAttributeList > & 
xAttrList,
+SvXMLStylesContext& rStyles, XmlStyleFamily nFamily,
+bool bDefaultStyle=false );
 virtual ~XMLPropStyleContext() override;
 
 virtual SvXMLImportContextRef CreateChildContext(
diff --git a/xmloff/inc/PageMasterImportContext.hxx 
b/xmloff/inc/PageMasterImportContext.hxx
index 66933da8c172..a60522249759 100644
--- a/xmloff/inc/PageMasterImportContext.hxx
+++ b/xmloff/inc/PageMasterImportContext.hxx
@@ -36,9 +36,8 @@ private:
 public:
 
 
-PageStyleContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
-const OUString& rLName,
-const css::uno::Reference< css::xml::sax::XAttributeList > & 
xAttrList,
+PageStyleContext( SvXMLImport& rImport, sal_Int32 nElement,
+const css::uno::Reference< css::xml::sax::XFastAttributeList > & 
xAttrList,
 SvXMLStylesContext& rStyles,
 bool bDefaultStyle);
 virtual ~PageStyleContext() override;
diff --git a/xmloff/source/style/PageMasterImportContext.cxx 
b/xmloff/source/style/PageMasterImportContext.cxx
index 3bb1483f1950..8e2caba9eb90 100644
--- a/xmloff/source/style/PageMasterImportContext.cxx
+++ b/xmloff/source/style/PageMasterImportContext.cxx
@@ -61,11 +61,11 @@ void PageStyleContext::SetAttribute( sal_uInt16 nPrefixKey,
 
 
 PageStyleContext::PageStyleContext( SvXMLImport& rImport,
-sal_uInt16 nPrfx, const OUString& rLName,
-const uno::Reference< xml::sax::XAttributeList > & xAttrList,
+sal_Int32 nElement,
+const uno::Reference< xml::sax::XFastAttributeList > & xAttrList,
 SvXMLStylesContext& rStyles,
 bool bDefaultStyle) :
-XMLPropStyleContext( rImport, nPrfx, rLName, xAttrList, rStyles, 
XmlStyleFamily::PAGE_MASTER, bDefaultStyle),
+XMLPropStyleContext( rImport, nElement, xAttrList, rStyles, 
XmlStyleFamily::PAGE_MASTER, bDefaultStyle),
 sPageUsage(),
 m_bIsFillStyleAlreadyConverted(false) //
 {
diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx
index 02362142ee41..f5389010fb4a 100644
--- a/xmloff/source/style/prstylei.cxx
+++ b/xmloff/source/style/prstylei.cxx
@@ -156,6 +156,16 @@ XMLPropStyleContext::XMLPropStyleContext( SvXMLImport& 
rImport,
 {
 }
 
+XMLPropStyleContext::XMLPropStyleContext( SvXMLImport& rImport,
+sal_Int32 nElement,
+const Reference< XFastAttributeList > & xAttrList,
+SvXMLStylesContext& rStyles, XmlStyleFamily nFamily,
+bool bDefault )
+:   SvXMLStyleContext( rImport, nElement, xAttrList, nFamily, bDefault )
+,   mxStyles(  )
+{
+}
+
 

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

2020-08-24 Thread Yusuf Keten (via logerrit)
 cui/source/dialogs/AdditionsDialog.cxx |   30 +
 cui/source/inc/AdditionsDialog.hxx |7 +-
 cui/uiconfig/ui/additionsfragment.ui   |  101 ++---
 3 files changed, 129 insertions(+), 9 deletions(-)

New commits:
commit 48a796c5bbdf897228eb4125512e4f80527f4b55
Author: Yusuf Keten 
AuthorDate: Wed Aug 19 19:36:58 2020 +0300
Commit: Muhammet Kara 
CommitDate: Mon Aug 24 21:45:07 2020 +0200

tdf#133026: Additions: Rating image implementation

Change-Id: Id250f0e70490941743e0f3ca2b94897f69a9208f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101013
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index f57031511404..680e519a60d0 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -592,7 +592,12 @@ AdditionsItem::AdditionsItem(weld::Widget* pParent, 
AdditionsDialog* pParentDial
 , m_xLabelVersion(m_xBuilder->weld_label("labelVersion"))
 , m_xLabelComments(m_xBuilder->weld_label("labelComments")) // no change
 , m_xLinkButtonComments(m_xBuilder->weld_link_button("linkButtonComments"))
-, m_xImageVoting(m_xBuilder->weld_image("imageVoting"))
+, m_xImageVoting1(m_xBuilder->weld_image("imageVoting1"))
+, m_xImageVoting2(m_xBuilder->weld_image("imageVoting2"))
+, m_xImageVoting3(m_xBuilder->weld_image("imageVoting3"))
+, m_xImageVoting4(m_xBuilder->weld_image("imageVoting4"))
+, m_xImageVoting5(m_xBuilder->weld_image("imageVoting5"))
+, m_xLabelNoVoting(m_xBuilder->weld_label("votingLabel"))
 , m_xImageDownloadNumber(m_xBuilder->weld_image("imageDownloadNumber"))
 , m_xLabelDownloadNumber(m_xBuilder->weld_label("labelDownloadNumber"))
 , m_xButtonShowMore(m_xBuilder->weld_button("buttonShowMore"))
@@ -622,6 +627,29 @@ AdditionsItem::AdditionsItem(weld::Widget* pParent, 
AdditionsDialog* pParentDial
 
 m_xLinkButtonName->set_label(sExtensionName);
 
+double aExtensionRating = additionInfo.sRating.toDouble();
+switch (int(aExtensionRating))
+{
+case 5:
+m_xImageVoting5->show();
+[[fallthrough]];
+case 4:
+m_xImageVoting4->show();
+[[fallthrough]];
+case 3:
+m_xImageVoting3->show();
+[[fallthrough]];
+case 2:
+m_xImageVoting2->show();
+[[fallthrough]];
+case 1:
+m_xImageVoting1->show();
+break;
+case 0:
+m_xLabelNoVoting->show();
+break;
+}
+
 m_xLinkButtonName->set_uri(additionInfo.sExtensionURL);
 m_xLabelDescription->set_label(additionInfo.sIntroduction);
 m_xLabelAuthor->set_label(additionInfo.sAuthorName);
diff --git a/cui/source/inc/AdditionsDialog.hxx 
b/cui/source/inc/AdditionsDialog.hxx
index 5b7089b9b6c5..9061b755a5be 100644
--- a/cui/source/inc/AdditionsDialog.hxx
+++ b/cui/source/inc/AdditionsDialog.hxx
@@ -126,7 +126,12 @@ public:
 std::unique_ptr m_xLabelVersion;
 std::unique_ptr m_xLabelComments;
 std::unique_ptr m_xLinkButtonComments;
-std::unique_ptr m_xImageVoting;
+std::unique_ptr m_xImageVoting1;
+std::unique_ptr m_xImageVoting2;
+std::unique_ptr m_xImageVoting3;
+std::unique_ptr m_xImageVoting4;
+std::unique_ptr m_xImageVoting5;
+std::unique_ptr m_xLabelNoVoting;
 std::unique_ptr m_xImageDownloadNumber;
 std::unique_ptr m_xLabelDownloadNumber;
 std::unique_ptr m_xButtonShowMore;
diff --git a/cui/uiconfig/ui/additionsfragment.ui 
b/cui/uiconfig/ui/additionsfragment.ui
index 2b4c23dff55b..93c8e50ad126 100644
--- a/cui/uiconfig/ui/additionsfragment.ui
+++ b/cui/uiconfig/ui/additionsfragment.ui
@@ -132,7 +132,6 @@
 50
 
   
-  
 
   
   
@@ -209,14 +208,102 @@
   
 
 
-  
+  
 True
 False
-start
-gtk-about
-
-  
-
+
+  
+False
+start
+gtk-about
+
+  
+
+  
+  
+False
+True
+0
+  
+
+
+  
+False
+start
+gtk-about
+
+  
+
+  
+  
+False
+True
+1
+  
+
+
+  
+False
+start
+   

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

2020-08-24 Thread Yusuf Keten (via logerrit)
 cui/source/dialogs/AdditionsDialog.cxx |  139 -
 cui/source/inc/AdditionsDialog.hxx |   38 -
 2 files changed, 174 insertions(+), 3 deletions(-)

New commits:
commit 169cbf05aaa87b625387325a708c1f254499972b
Author: Yusuf Keten 
AuthorDate: Fri Aug 14 03:34:10 2020 +0300
Commit: Muhammet Kara 
CommitDate: Mon Aug 24 14:34:02 2020 +0200

tdf#133026: Additions: Install Extension Function

Change-Id: Ifcad25a85533833c7d05e5be46ea763e1eeaa5d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100714
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index 9f8826dce6cc..b0a5421f54f2 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -50,6 +50,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 //cURL
 #include 
 #include 
@@ -74,6 +77,7 @@ using ::com::sun::star::graphic::XGraphicProvider;
 using ::com::sun::star::uno::Sequence;
 using ::com::sun::star::beans::PropertyValue;
 using ::com::sun::star::graphic::XGraphic;
+
 using namespace com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::ucb;
@@ -264,7 +268,6 @@ bool getPreviewFile(const AdditionInfo& aAdditionInfo, 
OUString& sPreviewFile)
 {
 uno::Reference xFileAccess
 = 
ucb::SimpleFileAccess::create(comphelper::getProcessComponentContext());
-Reference 
xContext(::comphelper::getProcessComponentContext());
 
 // copy the images to the user's additions folder
 OUString userFolder = "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER
@@ -595,6 +598,7 @@ AdditionsItem::AdditionsItem(weld::Widget* pParent, 
AdditionsDialog* pParentDial
 , m_xButtonShowMore(m_xBuilder->weld_button("buttonShowMore"))
 , m_pParentDialog(pParentDialog)
 , m_sDownloadURL("")
+, m_sExtensionID("")
 {
 SolarMutexGuard aGuard;
 
@@ -632,11 +636,41 @@ AdditionsItem::AdditionsItem(weld::Widget* pParent, 
AdditionsDialog* pParentDial
 m_xLabelDownloadNumber->set_label(additionInfo.sDownloadNumber);
 m_pParentDialog = pParentDialog;
 m_sDownloadURL = additionInfo.sDownloadURL;
+m_sExtensionID = additionInfo.sExtensionID;
 
 m_xButtonShowMore->connect_clicked(LINK(this, AdditionsItem, ShowMoreHdl));
 m_xButtonInstall->connect_clicked(LINK(this, AdditionsItem, InstallHdl));
 }
 
+bool AdditionsItem::getExtensionFile(OUString& sExtensionFile)
+{
+uno::Reference xFileAccess
+= 
ucb::SimpleFileAccess::create(comphelper::getProcessComponentContext());
+
+// copy the extensions' files to the user's additions folder
+OUString userFolder = "${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER
+  "/" SAL_CONFIGFILE("bootstrap") 
"::UserInstallation}";
+rtl::Bootstrap::expandMacros(userFolder);
+userFolder += "/user/additions/" + m_sExtensionID + "/";
+
+OUString aExtesionsFile(INetURLObject(m_sDownloadURL).getName());
+OString aExtesionsURL = OUStringToOString(m_sDownloadURL, 
RTL_TEXTENCODING_UTF8);
+
+try
+{
+osl::Directory::createPath(userFolder);
+
+if (!xFileAccess->exists(userFolder + aExtesionsFile))
+curlDownload(aExtesionsURL, userFolder + aExtesionsFile);
+}
+catch (const uno::Exception&)
+{
+return false;
+}
+sExtensionFile = userFolder + aExtesionsFile;
+return true;
+}
+
 IMPL_LINK_NOARG(AdditionsDialog, ImplUpdateDataHdl, Timer*, void)
 {
 if (m_pSearchThread.is())
@@ -681,7 +715,108 @@ IMPL_LINK_NOARG(AdditionsItem, ShowMoreHdl, 
weld::Button&, void)
 
 IMPL_LINK_NOARG(AdditionsItem, InstallHdl, weld::Button&, void)
 {
-m_xButtonInstall->set_label("Success");
+m_xButtonInstall->set_label("Installing");
+m_xButtonInstall->set_sensitive(false);
+OUString aExtensionFile;
+bool bResult = getExtensionFile(aExtensionFile); // info vector json data
+
+if (!bResult)
+{
+m_xButtonInstall->set_label("Install");
+m_xButtonInstall->set_sensitive(true);
+
+SAL_INFO("cui.dialogs", "Couldn't get the extension file.");
+return;
+}
+
+TmpRepositoryCommandEnv* pCmdEnv = new TmpRepositoryCommandEnv();
+uno::Reference 
xCmdEnv(static_cast(pCmdEnv),
+ uno::UNO_QUERY);
+uno::Reference xAbortChannel;
+try
+{
+m_pParentDialog->m_xExtensionManager->addExtension(
+aExtensionFile, uno::Sequence(), "user", 
xAbortChannel, xCmdEnv);
+m_xButtonInstall->set_label("Installed");
+}
+catch (const ucb::CommandFailedException)
+{
+SAL_WARN("cui.dialogs", "Additions: addExtension 
CommandFailedException occured.");
+m_xButtonInstall->set_label("Install");
+m_xButtonInstall->set_sensitive(true);
+}
+catch (const ucb::CommandAbortedException)
+{
+SAL_WARN("cui.dialogs", "Additions: 

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

2020-08-16 Thread Yusuf Keten (via logerrit)
 cui/source/dialogs/AdditionsDialog.cxx |   18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

New commits:
commit b8610d804f076a58ee5a4964fd428062d5ea420f
Author: Yusuf Keten 
AuthorDate: Thu Aug 13 15:03:38 2020 +0300
Commit: Muhammet Kara 
CommitDate: Sun Aug 16 18:58:36 2020 +0200

tdf#133026: Additions: Set the maximum length for extension name

Change-Id: I52c6fe32e7737e1e0160cfd585d8616a035320c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100657
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index 3db93edf48e2..9f8826dce6cc 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -598,10 +598,26 @@ AdditionsItem::AdditionsItem(weld::Widget* pParent, 
AdditionsDialog* pParentDial
 {
 SolarMutexGuard aGuard;
 
+// AdditionsItem set location
 m_xContainer->set_grid_left_attach(0);
 m_xContainer->set_grid_top_attach(pParentDialog->m_aAdditionsItems.size() 
- 1);
 
-m_xLinkButtonName->set_label(additionInfo.sName);
+// Set maximum length of the extension title
+OUString sExtensionName;
+const sal_Int32 maxExtensionNameLength = 30;
+
+if (additionInfo.sName.getLength() > maxExtensionNameLength)
+{
+OUString sShortName = additionInfo.sName.copy(0, 
maxExtensionNameLength - 3);
+sExtensionName = sShortName + "...";
+}
+else
+{
+sExtensionName = additionInfo.sName;
+}
+
+m_xLinkButtonName->set_label(sExtensionName);
+
 m_xLinkButtonName->set_uri(additionInfo.sExtensionURL);
 m_xLabelDescription->set_label(additionInfo.sIntroduction);
 m_xLabelAuthor->set_label(additionInfo.sAuthorName);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-16 Thread Yusuf Keten (via logerrit)
 cui/source/dialogs/AdditionsDialog.cxx |1 
 cui/source/inc/AdditionsDialog.hxx |2 
 cui/uiconfig/ui/additionsdialog.ui |   84 +
 3 files changed, 87 insertions(+)

New commits:
commit a6373c11938926d0f5d73be74aedfb4ab1d1720c
Author: Yusuf Keten 
AuthorDate: Sat Aug 15 21:41:45 2020 +0300
Commit: Muhammet Kara 
CommitDate: Sun Aug 16 15:20:35 2020 +0200

tdf133275: Additions: Sorting menu ui implementation

Change-Id: I41b0887d0bc6bf4618bd1cf9afd06f4b1ddbabb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100778
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index c467e647e020..3db93edf48e2 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -465,6 +465,7 @@ AdditionsDialog::AdditionsDialog(weld::Window* pParent, 
const OUString& sAdditio
 , m_xContentWindow(m_xBuilder->weld_scrolled_window("contentWindow"))
 , m_xContentGrid(m_xBuilder->weld_container("contentGrid"))
 , m_xLabelProgress(m_xBuilder->weld_label("labelProgress"))
+, m_xGearBtn(m_xBuilder->weld_menu_button("buttonGear"))
 {
 m_aSearchDataTimer.SetInvokeHandler(LINK(this, AdditionsDialog, 
ImplUpdateDataHdl));
 m_aSearchDataTimer.SetDebugName("AdditionsDialog SearchDataTimer");
diff --git a/cui/source/inc/AdditionsDialog.hxx 
b/cui/source/inc/AdditionsDialog.hxx
index 027f2f1f24c9..71df58c63b7f 100644
--- a/cui/source/inc/AdditionsDialog.hxx
+++ b/cui/source/inc/AdditionsDialog.hxx
@@ -74,6 +74,8 @@ public:
 std::unique_ptr m_xContentGrid;
 
 std::unique_ptr m_xLabelProgress;
+std::unique_ptr m_xGearBtn;
+
 ::rtl::Reference m_pSearchThread;
 
 OString m_sURL;
diff --git a/cui/uiconfig/ui/additionsdialog.ui 
b/cui/uiconfig/ui/additionsdialog.ui
index 523bcc276ede..4b91bd5950b9 100644
--- a/cui/uiconfig/ui/additionsdialog.ui
+++ b/cui/uiconfig/ui/additionsdialog.ui
@@ -2,6 +2,89 @@
 
 
   
+  
+True
+False
+
+  
+True
+False
+Active version only
+  
+
+
+  
+True
+False
+  
+
+
+  
+True
+False
+Sort by
+
+  
+True
+False
+
+  
+True
+False
+Voting
+True
+gear_sort_downloads
+  
+
+
+  
+True
+False
+Downloads
+True
+gear_sort_voting
+  
+
+
+  
+True
+False
+Comments
+True
+gear_sort_voting
+  
+
+  
+
+  
+
+
+  
+True
+False
+  
+
+
+  
+True
+False
+Detail view
+True
+True
+True
+gear_condensedList
+  
+
+
+  
+True
+False
+Condensed list
+True
+gear_detailView
+  
+
+  
   
 400
 500
@@ -118,6 +201,7 @@
 True
 end
 1
+additionsmenu
 False
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-13 Thread Yusuf Keten (via logerrit)
 cui/source/dialogs/AdditionsDialog.cxx |  110 ++---
 cui/source/inc/AdditionsDialog.hxx |   92 ++-
 2 files changed, 99 insertions(+), 103 deletions(-)

New commits:
commit d21f802d91cce6d3de40f95d7478401776afab00
Author: Yusuf Keten 
AuthorDate: Fri Aug 7 17:40:30 2020 +0300
Commit: Muhammet Kara 
CommitDate: Thu Aug 13 14:24:04 2020 +0200

tdf#133026: Additions: Install Button Handler

Change-Id: If4e9b192557b6c9f56bd04ccf9f6a5a8273d7515
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100340
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index 71f7fb1f09c4..c467e647e020 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -14,7 +14,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -29,8 +28,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -293,7 +290,7 @@ bool getPreviewFile(const AdditionInfo& aAdditionInfo, 
OUString& sPreviewFile)
 return true;
 }
 
-void LoadImage(const OUString& rPreviewFile, const AdditionsItem& rCurrentItem)
+void LoadImage(const OUString& rPreviewFile, std::shared_ptr 
pCurrentItem)
 {
 SolarMutexGuard aGuard;
 
@@ -306,11 +303,11 @@ void LoadImage(const OUString& rPreviewFile, const 
AdditionsItem& rCurrentItem)
 aFilter.ImportGraphic(aGraphic, aURLObj);
 BitmapEx aBmp = aGraphic.GetBitmapEx();
 
-ScopedVclPtr xVirDev = 
rCurrentItem.m_xImageScreenshot->create_virtual_device();
+ScopedVclPtr xVirDev = 
pCurrentItem->m_xImageScreenshot->create_virtual_device();
 xVirDev->SetOutputSizePixel(aBmp.GetSizePixel());
 xVirDev->DrawBitmapEx(Point(0, 0), aBmp);
 
-rCurrentItem.m_xImageScreenshot->set_image(xVirDev.get());
+pCurrentItem->m_xImageScreenshot->set_image(xVirDev.get());
 xVirDev.disposeAndClear();
 }
 
@@ -326,32 +323,7 @@ 
SearchAndParseThread::SearchAndParseThread(AdditionsDialog* pDialog, const bool&
 
 SearchAndParseThread::~SearchAndParseThread() {}
 
-void SearchAndParseThread::LoadInfo(const AdditionInfo& additionInfo, 
AdditionsItem& rCurrentItem)
-{
-SolarMutexGuard aGuard;
-
-rCurrentItem.m_xContainer->set_grid_left_attach(0);
-
rCurrentItem.m_xContainer->set_grid_top_attach(m_pAdditionsDialog->m_aAdditionsItems.size()
-   - 1);
-
-rCurrentItem.m_xLinkButtonName->set_label(additionInfo.sName);
-rCurrentItem.m_xLinkButtonName->set_uri(additionInfo.sExtensionURL);
-rCurrentItem.m_xLabelDescription->set_label(additionInfo.sIntroduction);
-rCurrentItem.m_xLabelAuthor->set_label(additionInfo.sAuthorName);
-
rCurrentItem.m_xButtonInstall->set_label(CuiResId(RID_SVXSTR_ADDITIONS_INSTALLBUTTON));
-OUString sLicenseString = CuiResId(RID_SVXSTR_ADDITIONS_LICENCE) + 
additionInfo.sLicense;
-rCurrentItem.m_xLabelLicense->set_label(sLicenseString);
-OUString sVersionString
-= CuiResId(RID_SVXSTR_ADDITIONS_REQUIREDVERSION) + 
additionInfo.sCompatibleVersion;
-rCurrentItem.m_xLabelVersion->set_label(sVersionString);
-rCurrentItem.m_xLinkButtonComments->set_label(additionInfo.sCommentNumber);
-rCurrentItem.m_xLinkButtonComments->set_uri(additionInfo.sCommentURL);
-
rCurrentItem.m_xLabelDownloadNumber->set_label(additionInfo.sDownloadNumber);
-rCurrentItem.m_pParentDialog = m_pAdditionsDialog;
-rCurrentItem.m_sDownloadURL = additionInfo.sDownloadURL;
-}
-
-void SearchAndParseThread::Append(const AdditionInfo& additionInfo)
+void SearchAndParseThread::Append(AdditionInfo& additionInfo)
 {
 if (!m_bExecute)
 return;
@@ -366,10 +338,11 @@ void SearchAndParseThread::Append(const AdditionInfo& 
additionInfo)
 
 SolarMutexGuard aGuard;
 
-
m_pAdditionsDialog->m_aAdditionsItems.emplace_back(m_pAdditionsDialog->m_xContentGrid.get());
-AdditionsItem& aCurrentItem = m_pAdditionsDialog->m_aAdditionsItems.back();
+auto newItem = 
std::make_shared(m_pAdditionsDialog->m_xContentGrid.get(),
+   m_pAdditionsDialog, 
additionInfo);
+m_pAdditionsDialog->m_aAdditionsItems.push_back(newItem);
+std::shared_ptr aCurrentItem = 
m_pAdditionsDialog->m_aAdditionsItems.back();
 
-LoadInfo(additionInfo, aCurrentItem);
 LoadImage(aPreviewFile, aCurrentItem);
 m_pAdditionsDialog->m_nCurrentListItemCount++;
 
@@ -377,15 +350,7 @@ void SearchAndParseThread::Append(const AdditionInfo& 
additionInfo)
 {
 if (m_pAdditionsDialog->m_nCurrentListItemCount
 != m_pAdditionsDialog->m_aAllExtensionsVector.size())
-aCurrentItem.m_xButtonShowMore->set_visible(true);
-}
-}
-
-void SearchAndParseThread::AppendAllExtensions()
-{
-for (auto& additionInfo : m_pAdditionsDialog->m_aAllExtensionsVector)
-{
-

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

2020-08-11 Thread Yusuf Keten (via logerrit)
 cui/uiconfig/ui/additionsdialog.ui |   10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit b03e218e9a5f6f8350ccb9c921b97a6bda2485bc
Author: Yusuf Keten 
AuthorDate: Mon Aug 10 23:23:36 2020 +0300
Commit: Muhammet Kara 
CommitDate: Tue Aug 11 13:34:48 2020 +0200

tdf#135313: Crash on opening the tight integration dialog

The crash problem in MacOS and Windows is fixed.

Change-Id: I2968880b77f723f2caf6dc77f4904411392c4008
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100449
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/uiconfig/ui/additionsdialog.ui 
b/cui/uiconfig/ui/additionsdialog.ui
index 0cd02d98e8cb..cf606dec438f 100644
--- a/cui/uiconfig/ui/additionsdialog.ui
+++ b/cui/uiconfig/ui/additionsdialog.ui
@@ -93,15 +93,11 @@
 True
 False
 
-  
-275
+  
 True
 True
-5
-150
-edit-find-symbolic
-False
-False
+50
+50
 
   
 searchEntry
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-06 Thread Yusuf Keten (via logerrit)
 cui/source/dialogs/AdditionsDialog.cxx |   83 +
 cui/source/inc/AdditionsDialog.hxx |   31 +---
 2 files changed, 107 insertions(+), 7 deletions(-)

New commits:
commit 4e31468ce84951a8789f5bcd229145d6dcd55c5e
Author: Yusuf Keten 
AuthorDate: Thu Jul 30 19:31:28 2020 +0300
Commit: Muhammet Kara 
CommitDate: Fri Aug 7 07:24:09 2020 +0200

tdf#133026: Additions: Disable install buttons of the existing extensions

If the extension exists, the install button will be disabled.

Change-Id: Ide88faeabe86d9cdb6a3cb99257710d92e3b4769
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99809
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index 61a45329cbee..71f7fb1f09c4 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -47,6 +47,13 @@
 #include 
 #include 
 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+//cURL
 #include 
 #include 
 #include 
@@ -341,6 +348,7 @@ void SearchAndParseThread::LoadInfo(const AdditionInfo& 
additionInfo, AdditionsI
 rCurrentItem.m_xLinkButtonComments->set_uri(additionInfo.sCommentURL);
 
rCurrentItem.m_xLabelDownloadNumber->set_label(additionInfo.sDownloadNumber);
 rCurrentItem.m_pParentDialog = m_pAdditionsDialog;
+rCurrentItem.m_sDownloadURL = additionInfo.sDownloadURL;
 }
 
 void SearchAndParseThread::Append(const AdditionInfo& additionInfo)
@@ -409,6 +417,48 @@ void SearchAndParseThread::Search()
 nIteration++;
 }
 }
+CheckInstalledExtensions();
+}
+
+void SearchAndParseThread::CheckInstalledExtensions()
+{
+uno::Sequence>> 
xAllPackages
+= m_pAdditionsDialog->getInstalledExtensions();
+
+if (!xAllPackages.hasElements())
+return;
+
+OUString currentExtensionName;
+
+for (auto& package : xAllPackages)
+{
+for (auto& extensionVersion : package)
+{
+if (extensionVersion.is())
+{
+currentExtensionName = extensionVersion->getName();
+if (currentExtensionName.isEmpty())
+continue;
+
+m_pAdditionsDialog->m_searchOptions.searchString = 
currentExtensionName;
+utl::TextSearch 
textSearch(m_pAdditionsDialog->m_searchOptions);
+
+for (auto& rInfo : m_pAdditionsDialog->m_aAdditionsItems)
+{
+OUString sExtensionDownloadURL = rInfo.m_sDownloadURL;
+
+if (!textSearch.searchForward(sExtensionDownloadURL))
+{
+continue;
+}
+else
+{
+rInfo.m_xButtonInstall->set_sensitive(false);
+}
+}
+}
+}
+}
 }
 
 void SearchAndParseThread::execute()
@@ -479,6 +529,9 @@ AdditionsDialog::AdditionsDialog(weld::Window* pParent, 
const OUString& sAdditio
 OString rURL = sPrefixURL + m_sTag + sSuffixURL;
 m_sURL = rURL;
 
+m_xExtensionManager
+= 
deployment::ExtensionManager::get(::comphelper::getProcessComponentContext());
+
 //Initialize search util
 m_searchOptions.AlgorithmType2 = css::util::SearchAlgorithms2::ABSOLUTE;
 m_searchOptions.transliterateFlags |= TransliterationFlags::IGNORE_CASE;
@@ -501,6 +554,36 @@ AdditionsDialog::~AdditionsDialog()
 }
 }
 
+uno::Sequence>>
+AdditionsDialog::getInstalledExtensions()
+{
+uno::Sequence>> 
xAllPackages;
+
+try
+{
+xAllPackages = m_xExtensionManager->getAllExtensions(
+uno::Reference(), 
uno::Reference());
+}
+catch (const deployment::DeploymentException&)
+{
+SAL_WARN("cui.dialogs", "Deployment Exception");
+}
+catch (const ucb::CommandFailedException&)
+{
+SAL_WARN("cui.dialogs", "Command Failed Exception");
+}
+catch (const ucb::CommandAbortedException&)
+{
+SAL_WARN("cui.dialogs", "Command Aborted Exception");
+}
+catch (const lang::IllegalArgumentException& e)
+{
+css::uno::Any anyEx = cppu::getCaughtException();
+throw css::lang::WrappedTargetRuntimeException(e.Message, e.Context, 
anyEx);
+}
+return xAllPackages;
+}
+
 void AdditionsDialog::SetProgress(const OUString& rProgress)
 {
 if (rProgress.isEmpty())
diff --git a/cui/source/inc/AdditionsDialog.hxx 
b/cui/source/inc/AdditionsDialog.hxx
index 7b082a1b5230..7a688516fa1a 100644
--- a/cui/source/inc/AdditionsDialog.hxx
+++ b/cui/source/inc/AdditionsDialog.hxx
@@ -13,10 +13,19 @@
 #include 
 #include 
 #include 
-#include 
 #include 
+
+// Detect changes on the UI
+#include 
+
+// Search and filter
 #include 
 
+// Extension Manager Connection
+#include 
+#include 
+#include 
+
 class AdditionsDialog;
 class SearchAndParseThread;
 
@@ -40,6 +49,7 @@ struct 

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

2020-07-28 Thread Yusuf Keten (via logerrit)
 cui/source/dialogs/AdditionsDialog.cxx |  150 +
 cui/source/inc/AdditionsDialog.hxx |   11 +-
 2 files changed, 87 insertions(+), 74 deletions(-)

New commits:
commit c4bee547b02fbe3d07b1e9ee203c73e48f86e6bf
Author: Yusuf Keten 
AuthorDate: Fri Jul 24 20:41:34 2020 +0300
Commit: Muhammet Kara 
CommitDate: Tue Jul 28 20:23:22 2020 +0200

tdf#133026: Additions: Better Search Function

Old search function was demo to test something. This function uses the JSON 
response to search, not the API call to search.

Change-Id: I0f4163a55331667a73f15dd220302f58a27831c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99388
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index 555f0c74a64e..7f6339eed64c 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -37,6 +37,11 @@
 #include 
 #include 
 
+#include 
+#include 
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -48,6 +53,12 @@
 #include 
 #include 
 
+// FIXME
+// This preprocessor command is written to prevent the error caused by 
"css::util::SearchAlgorithms2::ABSOLUTE" in the AdditionsDialog().
+#ifdef ABSOLUTE
+#undef ABSOLUTE
+#endif
+
 #define PAGE_SIZE 30
 
 using namespace css;
@@ -309,26 +320,13 @@ 
SearchAndParseThread::SearchAndParseThread(AdditionsDialog* pDialog, const bool&
 
 SearchAndParseThread::~SearchAndParseThread() {}
 
-std::vector 
SearchAndParseThread::CreateInfoVectorToLoading(const size_t startNumber)
-{
-std::vector additionInfos;
-for (size_t i = startNumber; i < m_pAdditionsDialog->m_nMaxItemCount; i++)
-{
-if (i == m_pAdditionsDialog->m_aAllExtensionsVector.size())
-break;
-additionInfos.push_back(m_pAdditionsDialog->m_aAllExtensionsVector[i]);
-}
-
-return additionInfos;
-}
-
-void SearchAndParseThread::LoadInfo(const AdditionInfo& additionInfo, 
AdditionsItem& rCurrentItem,
-const size_t nGridPositionY)
+void SearchAndParseThread::LoadInfo(const AdditionInfo& additionInfo, 
AdditionsItem& rCurrentItem)
 {
 SolarMutexGuard aGuard;
 
 rCurrentItem.m_xContainer->set_grid_left_attach(0);
-rCurrentItem.m_xContainer->set_grid_top_attach(nGridPositionY);
+
rCurrentItem.m_xContainer->set_grid_top_attach(m_pAdditionsDialog->m_aAdditionsItems.size()
+   - 1);
 
 rCurrentItem.m_xLinkButtonName->set_label(additionInfo.sName);
 rCurrentItem.m_xLinkButtonName->set_uri(additionInfo.sExtensionURL);
@@ -346,44 +344,76 @@ void SearchAndParseThread::LoadInfo(const AdditionInfo& 
additionInfo, AdditionsI
 rCurrentItem.m_pParentDialog = m_pAdditionsDialog;
 }
 
-void SearchAndParseThread::UpdateUI(const std::vector& 
aAdditionInfos)
+void SearchAndParseThread::Append(const AdditionInfo& additionInfo)
 {
-//Get Preview Files
-for (auto& additionInfo : aAdditionInfos)
+if (!m_bExecute)
+return;
+OUString aPreviewFile;
+bool bResult = getPreviewFile(additionInfo, aPreviewFile); // info vector 
json data
+
+if (!bResult)
 {
-if (!m_bExecute)
-return;
-OUString aPreviewFile;
-bool bResult = getPreviewFile(additionInfo, aPreviewFile); // info 
vector json data
+SAL_INFO("cui.dialogs", "Couldn't get the preview file. Skipping: " << 
aPreviewFile);
+return;
+}
 
-if (!bResult)
-{
-SAL_INFO("cui.dialogs", "Couldn't get the preview file. Skipping: 
" << aPreviewFile);
-continue;
-}
+SolarMutexGuard aGuard;
 
-SolarMutexGuard aGuard;
-AdditionsDialog* rDialog = m_pAdditionsDialog;
+
m_pAdditionsDialog->m_aAdditionsItems.emplace_back(m_pAdditionsDialog->m_xContentGrid.get());
+AdditionsItem& aCurrentItem = m_pAdditionsDialog->m_aAdditionsItems.back();
 
-rDialog->m_aAdditionsItems.emplace_back(rDialog->m_xContentGrid.get());
-AdditionsItem& aCurrentItem = rDialog->m_aAdditionsItems.back();
+LoadInfo(additionInfo, aCurrentItem);
+LoadImage(aPreviewFile, aCurrentItem);
+m_pAdditionsDialog->m_nCurrentListItemCount++;
 
-LoadInfo(additionInfo, aCurrentItem, rDialog->m_nCurrentListItemCount);
-LoadImage(aPreviewFile, aCurrentItem);
+if (m_pAdditionsDialog->m_nCurrentListItemCount == 
m_pAdditionsDialog->m_nMaxItemCount)
+{
+if (m_pAdditionsDialog->m_nCurrentListItemCount
+!= m_pAdditionsDialog->m_aAllExtensionsVector.size())
+aCurrentItem.m_xButtonShowMore->set_visible(true);
+}
+}
 
-rDialog->m_nCurrentListItemCount++;
-if (rDialog->m_nCurrentListItemCount == rDialog->m_nMaxItemCount)
-{
-if (rDialog->m_nCurrentListItemCount != 
rDialog->m_aAllExtensionsVector.size())
-

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

2020-07-23 Thread Yusuf Keten (via logerrit)
 cui/source/dialogs/AdditionsDialog.cxx |  228 +-
 cui/source/inc/AdditionsDialog.hxx |   49 +++
 cui/uiconfig/ui/additionsfragment.ui   |  410 +
 3 files changed, 384 insertions(+), 303 deletions(-)

New commits:
commit 04f56b5fc29e082139ee77991f4780372edba34a
Author: Yusuf Keten 
AuthorDate: Thu Jul 23 21:17:01 2020 +0300
Commit: Muhammet Kara 
CommitDate: Thu Jul 23 23:54:26 2020 +0200

tdf#133026: Additions: Add Show More button and refactor

After this patch, not all extensions that come with JSON will be shown. 
Instead, a certain number (currently 30) of extensions will be shown and the 
Show More button will appear after the last extension. If the user presses the 
button, a certain number of extensions will be added again.

Change-Id: Icf8f549d585a5bca1d55b85acf9b72478b507444
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99338
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index 37e90c4ecb66..555f0c74a64e 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -48,6 +48,8 @@
 #include 
 #include 
 
+#define PAGE_SIZE 30
+
 using namespace css;
 using ::com::sun::star::uno::Reference;
 using ::com::sun::star::uno::XComponentContext;
@@ -71,25 +73,6 @@ const char kUserAgent[] = "LibreOffice 
AdditionsDownloader/1.0 (unknown platform
 
 namespace
 {
-struct AdditionInfo
-{
-OUString sExtensionID;
-OUString sName;
-OUString sAuthorName;
-OUString sExtensionURL;
-OUString sScreenshotURL;
-OUString sIntroduction;
-OUString sDescription;
-OUString sCompatibleVersion;
-OUString sReleaseVersion;
-OUString sLicense;
-OUString sCommentNumber;
-OUString sCommentURL;
-OUString sRating;
-OUString sDownloadNumber;
-OUString sDownloadURL;
-};
-
 size_t WriteCallback(void* ptr, size_t size, size_t nmemb, void* userp)
 {
 if (!userp)
@@ -293,13 +276,32 @@ bool getPreviewFile(const AdditionInfo& aAdditionInfo, 
OUString& sPreviewFile)
 return true;
 }
 
+void LoadImage(const OUString& rPreviewFile, const AdditionsItem& rCurrentItem)
+{
+SolarMutexGuard aGuard;
+
+GraphicFilter aFilter;
+Graphic aGraphic;
+
+INetURLObject aURLObj(rPreviewFile);
+
+// for VCL to be able to create bitmaps / do visual changes in the thread
+aFilter.ImportGraphic(aGraphic, aURLObj);
+BitmapEx aBmp = aGraphic.GetBitmapEx();
+
+ScopedVclPtr xVirDev = 
rCurrentItem.m_xImageScreenshot->create_virtual_device();
+xVirDev->SetOutputSizePixel(aBmp.GetSizePixel());
+xVirDev->DrawBitmapEx(Point(0, 0), aBmp);
+
+rCurrentItem.m_xImageScreenshot->set_image(xVirDev.get());
+xVirDev.disposeAndClear();
+}
+
 } // End of the anonymous namespace
 
-SearchAndParseThread::SearchAndParseThread(AdditionsDialog* pDialog, const 
OUString& rURL,
-   const bool& isFirstLoading)
+SearchAndParseThread::SearchAndParseThread(AdditionsDialog* pDialog, const 
bool& isFirstLoading)
 : Thread("cuiAdditionsSearchThread")
 , m_pAdditionsDialog(pDialog)
-, m_aURL(rURL)
 , m_bExecute(true)
 , m_bIsFirstLoading(isFirstLoading)
 {
@@ -307,6 +309,78 @@ 
SearchAndParseThread::SearchAndParseThread(AdditionsDialog* pDialog, const OUStr
 
 SearchAndParseThread::~SearchAndParseThread() {}
 
+std::vector 
SearchAndParseThread::CreateInfoVectorToLoading(const size_t startNumber)
+{
+std::vector additionInfos;
+for (size_t i = startNumber; i < m_pAdditionsDialog->m_nMaxItemCount; i++)
+{
+if (i == m_pAdditionsDialog->m_aAllExtensionsVector.size())
+break;
+additionInfos.push_back(m_pAdditionsDialog->m_aAllExtensionsVector[i]);
+}
+
+return additionInfos;
+}
+
+void SearchAndParseThread::LoadInfo(const AdditionInfo& additionInfo, 
AdditionsItem& rCurrentItem,
+const size_t nGridPositionY)
+{
+SolarMutexGuard aGuard;
+
+rCurrentItem.m_xContainer->set_grid_left_attach(0);
+rCurrentItem.m_xContainer->set_grid_top_attach(nGridPositionY);
+
+rCurrentItem.m_xLinkButtonName->set_label(additionInfo.sName);
+rCurrentItem.m_xLinkButtonName->set_uri(additionInfo.sExtensionURL);
+rCurrentItem.m_xLabelDescription->set_label(additionInfo.sIntroduction);
+rCurrentItem.m_xLabelAuthor->set_label(additionInfo.sAuthorName);
+
rCurrentItem.m_xButtonInstall->set_label(CuiResId(RID_SVXSTR_ADDITIONS_INSTALLBUTTON));
+OUString sLicenseString = CuiResId(RID_SVXSTR_ADDITIONS_LICENCE) + 
additionInfo.sLicense;
+rCurrentItem.m_xLabelLicense->set_label(sLicenseString);
+OUString sVersionString
+= CuiResId(RID_SVXSTR_ADDITIONS_REQUIREDVERSION) + 
additionInfo.sCompatibleVersion;
+rCurrentItem.m_xLabelVersion->set_label(sVersionString);
+

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

2020-07-23 Thread Yusuf Keten (via logerrit)
 cui/source/dialogs/AdditionsDialog.cxx |   11 +++
 cui/source/inc/AdditionsDialog.hxx |3 +++
 2 files changed, 14 insertions(+)

New commits:
commit 490f430b2cb18513ae8292e6d1f608ba08e05215
Author: Yusuf Keten 
AuthorDate: Wed Jul 22 20:31:22 2020 +0300
Commit: Muhammet Kara 
CommitDate: Thu Jul 23 08:01:17 2020 +0200

tdf#133026: Additions - Thread Execution Termination

After press the close button, the search thread will be terminated after 
this patch.

Change-Id: Ic79928bf0604203de9497c34cb18dbd76e3f376c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99250
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index 975fa57415fd..37e90c4ecb66 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -418,6 +418,7 @@ AdditionsDialog::AdditionsDialog(weld::Window* pParent, 
const OUString& sAdditio
 : GenericDialogController(pParent, "cui/ui/additionsdialog.ui", 
"AdditionsDialog")
 , m_aSearchDataTimer("SearchDataTimer")
 , m_xEntrySearch(m_xBuilder->weld_entry("entrySearch"))
+, m_xButtonClose(m_xBuilder->weld_button("buttonClose"))
 , m_xMenuButtonSettings(m_xBuilder->weld_menu_button("buttonGear"))
 , m_xContentWindow(m_xBuilder->weld_scrolled_window("contentWindow"))
 , m_xContentGrid(m_xBuilder->weld_container("contentGrid"))
@@ -430,6 +431,8 @@ AdditionsDialog::AdditionsDialog(weld::Window* pParent, 
const OUString& sAdditio
 m_xEntrySearch->connect_changed(LINK(this, AdditionsDialog, 
SearchUpdateHdl));
 m_xEntrySearch->connect_focus_out(LINK(this, AdditionsDialog, 
FocusOut_Impl));
 
+m_xButtonClose->connect_clicked(LINK(this, AdditionsDialog, 
CloseButtonHdl));
+
 m_sTag = OUStringToOString(sAdditionsTag, RTL_TEXTENCODING_UTF8);
 
 OUString titlePrefix = CuiResId(RID_SVXSTR_ADDITIONS_DIALOG_TITLE_PREFIX);
@@ -457,6 +460,7 @@ AdditionsDialog::~AdditionsDialog()
 {
 if (m_pSearchThread.is())
 {
+m_pSearchThread->StopExecution();
 // Release the solar mutex, so the thread is not affected by the race
 // when it's after the m_bExecute check but before taking the solar
 // mutex.
@@ -530,4 +534,11 @@ IMPL_LINK_NOARG(AdditionsDialog, FocusOut_Impl, 
weld::Widget&, void)
 }
 }
 
+IMPL_LINK_NOARG(AdditionsDialog, CloseButtonHdl, weld::Button&, void)
+{
+if (m_pSearchThread.is())
+m_pSearchThread->StopExecution();
+this->response(RET_CLOSE);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/inc/AdditionsDialog.hxx 
b/cui/source/inc/AdditionsDialog.hxx
index be73c78d96d0..7f327b2a8c28 100644
--- a/cui/source/inc/AdditionsDialog.hxx
+++ b/cui/source/inc/AdditionsDialog.hxx
@@ -63,9 +63,12 @@ private:
 DECL_LINK(SearchUpdateHdl, weld::Entry&, void);
 DECL_LINK(ImplUpdateDataHdl, Timer*, void);
 DECL_LINK(FocusOut_Impl, weld::Widget&, void);
+DECL_LINK(CloseButtonHdl, weld::Button&, void);
 
 public:
 std::unique_ptr m_xEntrySearch;
+std::unique_ptr m_xButtonClose;
+
 std::unique_ptr m_xMenuButtonSettings;
 std::vector m_aAdditionsItems;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: cui/inc cui/source include/sfx2 include/vcl sc/source sd/source sfx2/sdi sfx2/source sw/source

2020-07-21 Thread Yusuf Keten (via logerrit)
 cui/inc/strings.hrc|2 +-
 cui/source/dialogs/AdditionsDialog.cxx |   26 --
 cui/source/factory/dlgfact.cxx |6 +++---
 cui/source/factory/dlgfact.hxx |2 +-
 cui/source/inc/AdditionsDialog.hxx |3 ++-
 include/sfx2/sfxsids.hrc   |1 +
 include/vcl/abstdlg.hxx|2 +-
 sc/source/ui/view/tabvwshb.cxx |   21 ++---
 sd/source/ui/view/drviews2.cxx |8 +++-
 sfx2/sdi/sfx.sdi   |2 +-
 sfx2/source/appl/appuno.cxx|1 +
 sw/source/uibase/uiview/viewdlg2.cxx   |   10 +-
 12 files changed, 61 insertions(+), 23 deletions(-)

New commits:
commit 6e50e03262aa12921f108b502d3c76ce983d54f1
Author: Yusuf Keten 
AuthorDate: Sun Jul 19 20:22:23 2020 +0300
Commit: Muhammet Kara 
CommitDate: Tue Jul 21 22:25:13 2020 +0200

tdf#133026: Additions - Parameter support to UNO Command

After this patch, parameter support to uno command(.uno:AdditionsDialog) 
will be available.
To use parameter, add "?AdditionsTag:string=YourParameter" to UNO command. 
Parameters are the tags of extensions on webpage.

Change-Id: I0072c7340bda14ee13c21c347e06a04545cba69a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99007
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc
index be9c3f7d3a3e..d1b39a67e541 100644
--- a/cui/inc/strings.hrc
+++ b/cui/inc/strings.hrc
@@ -398,7 +398,7 @@
 #define RID_SVXSTR_ADDITIONS_SEARCHING  
NC_("RID_SVXSTR_ADDITIONS_SEARCHING", "Searching...")
 #define RID_SVXSTR_ADDITIONS_LOADING
NC_("RID_SVXSTR_ADDITIONS_LOADING", "Loading...")
 #define RID_SVXSTR_ADDITIONS_NORESULTS  
NC_("ID_SVXSTR_ADDITIONS_NORESULTS", "No results found")
-
+#define RID_SVXSTR_ADDITIONS_DIALOG_TITLE_PREFIX
NC_("RID_SVXSTR_ADDITIONS_DIALOG_TITLE_PREFIX", "Extensions")
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index 73b0247b8b0a..975fa57415fd 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -207,7 +207,7 @@ void parseResponse(const std::string& rResponse, 
std::vector& aAdd
   RTL_TEXTENCODING_UTF8),
 
OStringToOUString(OString(arrayElement.child("author").string_value().get()),
   RTL_TEXTENCODING_UTF8),
-
OStringToOUString(OString(arrayElement.child("URL").string_value().get()),
+
OStringToOUString(OString(arrayElement.child("url").string_value().get()),
   RTL_TEXTENCODING_UTF8),
 
OStringToOUString(OString(arrayElement.child("screenshotURL").string_value().get()),
   RTL_TEXTENCODING_UTF8),
@@ -219,13 +219,13 @@ void parseResponse(const std::string& rResponse, 
std::vector& aAdd
 RTL_TEXTENCODING_UTF8),
 OStringToOUString(OString(arrayElement.child("releases")
   .child(0)
-  .child("compatibleVersion")
+  .child("compatibility")
   .string_value()
   .get()),
   RTL_TEXTENCODING_UTF8),
 OStringToOUString(OString(arrayElement.child("releases")
   .child(0)
-  .child("releaseNumber")
+  .child("releaseName")
   .string_value()
   .get()),
   RTL_TEXTENCODING_UTF8),
@@ -414,7 +414,7 @@ void SearchAndParseThread::execute()
 m_pAdditionsDialog->SetProgress(sProgress);
 }
 
-AdditionsDialog::AdditionsDialog(weld::Window* pParent)
+AdditionsDialog::AdditionsDialog(weld::Window* pParent, const OUString& 
sAdditionsTag)
 : GenericDialogController(pParent, "cui/ui/additionsdialog.ui", 
"AdditionsDialog")
 , m_aSearchDataTimer("SearchDataTimer")
 , m_xEntrySearch(m_xBuilder->weld_entry("entrySearch"))
@@ -430,8 +430,22 @@ AdditionsDialog::AdditionsDialog(weld::Window* pParent)
 m_xEntrySearch->connect_changed(LINK(this, AdditionsDialog, 
SearchUpdateHdl));
 m_xEntrySearch->connect_focus_out(LINK(this, AdditionsDialog, 
FocusOut_Impl));
 
-// TODO - Temporary URL
-OString rURL = "https://yusufketen.com/extensionTest.json;;
+m_sTag = OUStringToOString(sAdditionsTag, RTL_TEXTENCODING_UTF8);
+
+OUString titlePrefix = CuiResId(RID_SVXSTR_ADDITIONS_DIALOG_TITLE_PREFIX);
+if 

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

2020-07-19 Thread Yusuf Keten (via logerrit)
 cui/source/dialogs/AdditionsDialog.cxx |   60 +
 cui/source/inc/AdditionsDialog.hxx |8 +++-
 2 files changed, 67 insertions(+), 1 deletion(-)

New commits:
commit 27cf6e73d05ac803d5fc12c53aea20ed53007234
Author: Yusuf Keten 
AuthorDate: Sat Jul 11 08:23:20 2020 +0300
Commit: Muhammet Kara 
CommitDate: Sun Jul 19 11:45:50 2020 +0200

tdf#133026: Tight integration of extensions - Add the search functions

The search function added. However, I added a case for checking (UI change 
occurs when "2" is written) because the API is not ready at the moment.
The finalURL variable will be activated when the API is ready.

Change-Id: I23c83e28d6ad8dea6c52813b4c98d219299fa9f1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98554
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index ba49e07b9365..73b0247b8b0a 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -416,12 +416,20 @@ void SearchAndParseThread::execute()
 
 AdditionsDialog::AdditionsDialog(weld::Window* pParent)
 : GenericDialogController(pParent, "cui/ui/additionsdialog.ui", 
"AdditionsDialog")
+, m_aSearchDataTimer("SearchDataTimer")
 , m_xEntrySearch(m_xBuilder->weld_entry("entrySearch"))
 , m_xMenuButtonSettings(m_xBuilder->weld_menu_button("buttonGear"))
 , m_xContentWindow(m_xBuilder->weld_scrolled_window("contentWindow"))
 , m_xContentGrid(m_xBuilder->weld_container("contentGrid"))
 , m_xLabelProgress(m_xBuilder->weld_label("labelProgress"))
 {
+m_aSearchDataTimer.SetInvokeHandler(LINK(this, AdditionsDialog, 
ImplUpdateDataHdl));
+m_aSearchDataTimer.SetDebugName("AdditionsDialog SearchDataTimer");
+m_aSearchDataTimer.SetTimeout(EDIT_UPDATEDATA_TIMEOUT);
+
+m_xEntrySearch->connect_changed(LINK(this, AdditionsDialog, 
SearchUpdateHdl));
+m_xEntrySearch->connect_focus_out(LINK(this, AdditionsDialog, 
FocusOut_Impl));
+
 // TODO - Temporary URL
 OString rURL = "https://yusufketen.com/extensionTest.json;;
 
@@ -456,4 +464,56 @@ void AdditionsDialog::SetProgress(const OUString& 
rProgress)
 }
 }
 
+void AdditionsDialog::ClearList()
+{
+// for VCL to be able to destroy bitmaps
+SolarMutexGuard aGuard;
+
+for (auto& item : this->m_aAdditionsItems)
+{
+item.m_xContainer->hide();
+}
+this->m_aAdditionsItems.clear();
+}
+
+IMPL_LINK_NOARG(AdditionsDialog, ImplUpdateDataHdl, Timer*, void)
+{
+this->ClearList();
+OUString aSearchTerm(m_xEntrySearch->get_text());
+/* OPTIONAL
+if (aSearchTerm.isEmpty())
+return;
+*/
+if (m_pSearchThread.is())
+m_pSearchThread->StopExecution();
+
+OString rURL = "https://yusufketen.com/extensionTest.json;; // + 
q=aSearchTerm
+OUString finalURL = OStringToOUString(rURL + "?q=", RTL_TEXTENCODING_UTF8) 
+ aSearchTerm;
+
+// Search Test
+if (aSearchTerm == "2")
+{
+rURL = "https://yusufketen.com/extensionTest2.json;;
+}
+
+this->SetProgress(finalURL);
+m_pSearchThread
+= new SearchAndParseThread(this, OStringToOUString(rURL, 
RTL_TEXTENCODING_UTF8), false);
+m_pSearchThread->launch();
+}
+
+IMPL_LINK_NOARG(AdditionsDialog, SearchUpdateHdl, weld::Entry&, void)
+{
+m_aSearchDataTimer.Start();
+}
+
+IMPL_LINK_NOARG(AdditionsDialog, FocusOut_Impl, weld::Widget&, void)
+{
+if (m_aSearchDataTimer.IsActive())
+{
+m_aSearchDataTimer.Stop();
+m_aSearchDataTimer.Invoke();
+}
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/inc/AdditionsDialog.hxx 
b/cui/source/inc/AdditionsDialog.hxx
index 8b3211bb3d1a..7983c1a0438a 100644
--- a/cui/source/inc/AdditionsDialog.hxx
+++ b/cui/source/inc/AdditionsDialog.hxx
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 struct AdditionsItem
@@ -57,7 +58,11 @@ class SearchAndParseThread;
 class AdditionsDialog : public weld::GenericDialogController
 {
 private:
-// void fillGrid();
+Timer m_aSearchDataTimer;
+
+DECL_LINK(SearchUpdateHdl, weld::Entry&, void);
+DECL_LINK(ImplUpdateDataHdl, Timer*, void);
+DECL_LINK(FocusOut_Impl, weld::Widget&, void);
 
 public:
 std::unique_ptr m_xEntrySearch;
@@ -74,6 +79,7 @@ public:
 ~AdditionsDialog() override;
 
 void SetProgress(const OUString& rProgress);
+void ClearList();
 };
 
 class SearchAndParseThread : public salhelper::Thread
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-07-10 Thread Yusuf Keten (via logerrit)
 cui/inc/strings.hrc|3 
 cui/source/dialogs/AdditionsDialog.cxx |  301 +++--
 cui/source/inc/AdditionsDialog.hxx |   30 +++
 cui/uiconfig/ui/additionsdialog.ui |   47 -
 4 files changed, 323 insertions(+), 58 deletions(-)

New commits:
commit daefcf77bd99d9dae9aaa08695c40c2a99d753d7
Author: Yusuf Keten 
AuthorDate: Tue Jul 7 03:22:01 2020 +0300
Commit: Muhammet Kara 
CommitDate: Fri Jul 10 12:39:56 2020 +0200

tdf#133026: Tight integration of extensions - Adding thread structure

- Add new class - SearchAndParseThread.
- Add new label to show progress such as not found, loading, searching, etc.
- Add cache to prevent unnecessary data transfers.

Change-Id: Ieb5dbdabc3c9b5224e89be959728ca9b6d5c63b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98226
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc
index d54a0f9cd370..be9c3f7d3a3e 100644
--- a/cui/inc/strings.hrc
+++ b/cui/inc/strings.hrc
@@ -395,6 +395,9 @@
 #define RID_SVXSTR_ADDITIONS_INSTALLBUTTON  
NC_("RID_SVXSTR_ADDITIONS_INSTALLBUTTON", "Install")
 #define RID_SVXSTR_ADDITIONS_LICENCE
NC_("RID_SVXSTR_ADDITIONS_LICENCE", "License:")
 #define RID_SVXSTR_ADDITIONS_REQUIREDVERSION
NC_("RID_SVXSTR_ADDITIONS_REQUIREDVERSION","Required version: >=")
+#define RID_SVXSTR_ADDITIONS_SEARCHING  
NC_("RID_SVXSTR_ADDITIONS_SEARCHING", "Searching...")
+#define RID_SVXSTR_ADDITIONS_LOADING
NC_("RID_SVXSTR_ADDITIONS_LOADING", "Loading...")
+#define RID_SVXSTR_ADDITIONS_NORESULTS  
NC_("ID_SVXSTR_ADDITIONS_NORESULTS", "No results found")
 
 #endif
 
diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
index 5ed8ad97e46c..ba49e07b9365 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -7,23 +7,41 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  */
+#include 
 
 #include 
+
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -40,14 +58,25 @@ using ::com::sun::star::graphic::XGraphicProvider;
 using ::com::sun::star::uno::Sequence;
 using ::com::sun::star::beans::PropertyValue;
 using ::com::sun::star::graphic::XGraphic;
+using namespace com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::ucb;
+using namespace ::com::sun::star::beans;
+
+#ifdef UNX
+const char kUserAgent[] = "LibreOffice AdditionsDownloader/1.0 (Linux)";
+#else
+const char kUserAgent[] = "LibreOffice AdditionsDownloader/1.0 (unknown 
platform)";
+#endif
 
 namespace
 {
 struct AdditionInfo
 {
+OUString sExtensionID;
 OUString sName;
 OUString sAuthorName;
-OUString sPreviewURL;
+OUString sExtensionURL;
 OUString sScreenshotURL;
 OUString sIntroduction;
 OUString sDescription;
@@ -72,6 +101,18 @@ size_t WriteCallback(void* ptr, size_t size, size_t nmemb, 
void* userp)
 return real_size;
 }
 
+// Callback to get the response data from server to a file.
+size_t WriteCallbackFile(void* ptr, size_t size, size_t nmemb, void* userp)
+{
+if (!userp)
+return 0;
+
+SvStream* response = static_cast(userp);
+size_t real_size = size * nmemb;
+response->WriteBytes(ptr, real_size);
+return real_size;
+}
+
 // Gets the content of the given URL and returns as a standard string
 std::string curlGet(const OString& rURL)
 {
@@ -104,6 +145,36 @@ std::string curlGet(const OString& rURL)
 return response_body;
 }
 
+// Downloads and saves the file at the given rURL to a local path (sFileURL)
+void curlDownload(const OString& rURL, const OUString& sFileURL)
+{
+CURL* curl = curl_easy_init();
+SvFileStream aFile(sFileURL, StreamMode::WRITE);
+
+if (!curl)
+return;
+
+curl_easy_setopt(curl, CURLOPT_URL, rURL.getStr());
+curl_easy_setopt(curl, CURLOPT_USERAGENT, kUserAgent);
+
+curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallbackFile);
+curl_easy_setopt(curl, CURLOPT_WRITEDATA, static_cast());
+
+CURLcode cc = curl_easy_perform(curl);
+long http_code = 0;
+curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, _code);
+
+if (http_code != 200)
+{
+SAL_WARN("cui.dialogs", "Download failed. Error code: " << http_code);
+}
+
+if (cc != CURLE_OK)
+{
+SAL_WARN("cui.dialogs", "curl error: " << cc);
+}
+}
+
 void parseResponse(const std::string& rResponse, std::vector& 
aAdditions)
 {
 orcus::json::document_tree aJsonDoc;
@@ -130,6 +201,8 @@ void parseResponse(const std::string& rResponse, 

[Libreoffice-commits] core.git: cui/inc cui/Library_cui.mk cui/source cui/uiconfig cui/UIConfig_cui.mk include/sfx2 include/vcl officecfg/registry sc/sdi sc/source sd/sdi sd/source sfx2/sdi sw/sdi sw/

2020-06-25 Thread Yusuf Keten (via logerrit)
 cui/Library_cui.mk   |1 
 cui/UIConfig_cui.mk  |2 
 cui/inc/strings.hrc  |4 
 cui/source/dialogs/AdditionsDialog.cxx   |  260 
+
 cui/source/factory/dlgfact.cxx   |   12 
 cui/source/factory/dlgfact.hxx   |   17 
 cui/source/inc/AdditionsDialog.hxx   |   71 ++
 cui/uiconfig/ui/additionsdialog.ui   |  183 
++
 cui/uiconfig/ui/additionsfragment.ui |  277 
++
 include/sfx2/sfxsids.hrc |1 
 include/vcl/abstdlg.hxx  |   10 
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |   17 
 sc/sdi/tabvwsh.sdi   |1 
 sc/source/ui/view/tabvwshb.cxx   |9 
 sd/sdi/_drvwsh.sdi   |5 
 sd/source/ui/view/drviews2.cxx   |   11 
 sfx2/sdi/docslots.sdi|5 
 sfx2/sdi/sfx.sdi |   17 
 sw/sdi/viewsh.sdi|6 
 sw/source/uibase/uiview/viewdlg2.cxx |8 
 20 files changed, 917 insertions(+)

New commits:
commit 12bbcce5018a09f1ab4c629bdab813f9bf079605
Author: Yusuf Keten 
AuthorDate: Fri Jun 5 14:50:39 2020 +0300
Commit: Muhammet Kara 
CommitDate: Thu Jun 25 22:16:55 2020 +0200

tdf#133026: Tight integration of extensions - Additions Dialog first 
iteration

- Add the uno command .uno:AdditionsDialog
- Add the necessary commands to cui makefiles.
- Add the dialog AdditionsDialog for only test
- Implement the basic functionality to show up when clicked on the
  menu/toolbar item.

Change-Id: I89dd74e49f5ff246ca355d2f8d1397621b26dea6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95593
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk
index 27d89ec1c3b6..ed1e07d5ff13 100644
--- a/cui/Library_cui.mk
+++ b/cui/Library_cui.mk
@@ -104,6 +104,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\
 cui/source/customize/SvxNotebookbarConfigPage \
 cui/source/customize/CustomNotebookbarGenerator \
 cui/source/dialogs/about \
+cui/source/dialogs/AdditionsDialog \
 cui/source/dialogs/colorpicker \
 cui/source/dialogs/cuicharmap \
 cui/source/dialogs/cuifmsearch \
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index ca8911310c2c..62291eff5acf 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -14,6 +14,8 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/aboutconfigdialog\
cui/uiconfig/ui/aboutconfigvaluedialog \
cui/uiconfig/ui/accelconfigpage \
+   cui/uiconfig/ui/additionsdialog \
+   cui/uiconfig/ui/additionsfragment \
cui/uiconfig/ui/agingdialog \
cui/uiconfig/ui/acorexceptpage \
cui/uiconfig/ui/acoroptionspage \
diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc
index dcfbcc0f4e9c..20ec52202bc0 100644
--- a/cui/inc/strings.hrc
+++ b/cui/inc/strings.hrc
@@ -391,6 +391,10 @@
 #define RID_SVXSTR_DELETEUSERCOLOR1 
NC_("RID_SVXSTR_DELETEUSERCOLOR1", "You can only delete user-defined colors")
 #define RID_SVXSTR_DELETEUSERCOLOR2 
NC_("RID_SVXSTR_DELETEUSERCOLOR2", "Please select the color to delete")
 
+#define RID_SVXSTR_ADDITIONS_INSTALLBUTTON  
NC_("RID_SVXSTR_ADDITIONS_INSTALLBUTTON", "Install")
+#define RID_SVXSTR_ADDITIONS_LICENCE
NC_("RID_SVXSTR_ADDITIONS_LICENCE", "License:")
+#define RID_SVXSTR_ADDITIONS_REQUIREDVERSION
NC_("RID_SVXSTR_ADDITIONS_REQUIREDVERSION","Required version: >=")
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/dialogs/AdditionsDialog.cxx 
b/cui/source/dialogs/AdditionsDialog.cxx
new file mode 100644
index ..5ed8ad97e46c
--- /dev/null
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -0,0 +1,260 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 

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

2020-05-01 Thread Yusuf Keten (via logerrit)
 sc/source/filter/inc/addressconverter.hxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit b8fb7ecd9cdbe1898c41eaecd9894df8e8f01e25
Author: Yusuf Keten 
AuthorDate: Tue Apr 28 21:48:31 2020 +0300
Commit: Eike Rathke 
CommitDate: Fri May 1 22:01:04 2020 +0200

tdf#124176: Use pragma once instead of include guards

Change-Id: I72c978c9d392d1aba1ca99feeacee021835adf52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93098
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/sc/source/filter/inc/addressconverter.hxx 
b/sc/source/filter/inc/addressconverter.hxx
index 0d5b3dac1b70..6447b1b63565 100644
--- a/sc/source/filter/inc/addressconverter.hxx
+++ b/sc/source/filter/inc/addressconverter.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SC_SOURCE_FILTER_INC_ADDRESSCONVERTER_HXX
-#define INCLUDED_SC_SOURCE_FILTER_INC_ADDRESSCONVERTER_HXX
+#pragma once
 
 #include 
 #include 
@@ -502,6 +501,5 @@ private:
 } // namespace xls
 } // namespace oox
 
-#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-16 Thread Yusuf Keten (via logerrit)
 extras/source/autocorr/lang/tr/DocumentList.xml |   56 
 1 file changed, 56 insertions(+)

New commits:
commit 0078b90f64c412487ab0818aa9101ccc4b137e5a
Author: Yusuf Keten 
AuthorDate: Sun Feb 16 18:53:38 2020 +0300
Commit: Muhammet Kara 
CommitDate: Sun Feb 16 19:32:00 2020 +0100

tdf#130711: [tr] Extend Autocorrect list for Turkish language(Start with A)

Change-Id: Ib1b374539f6ab70d3df3a36fc6bc99503eecd1fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88809
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/extras/source/autocorr/lang/tr/DocumentList.xml 
b/extras/source/autocorr/lang/tr/DocumentList.xml
index cfd818caeb7c..e7553e3aba55 100644
--- a/extras/source/autocorr/lang/tr/DocumentList.xml
+++ b/extras/source/autocorr/lang/tr/DocumentList.xml
@@ -34,20 +34,72 @@
   
   
   
+  
+  
+  
+  
+  
+  
+  
+  
   
   
+  
+  
+  
+  
   
   
+  
+  
+  
+  
+  
+  
   
   
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
   
   
+  
+  
   
   
+  
+  
+  
+  
+  
+  
+  
+  
   
   
   
   
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
   
   
   
@@ -114,6 +166,8 @@
   
   
   
+  
+  
   
   
   
@@ -176,6 +230,8 @@
   
   
   
+  
+  
   
   
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-11 Thread Yusuf Keten (via logerrit)
 cui/source/options/optgdlg.cxx  |   80 
 cui/source/tabpages/chardlg.cxx |9 +++-
 cui/source/tabpages/numfmt.cxx  |5 +-
 include/svx/langbox.hxx |4 +-
 svx/source/dialog/langbox.cxx   |   34 +++--
 5 files changed, 99 insertions(+), 33 deletions(-)

New commits:
commit 5326d238d7f98b11886eb4be01f19db73f8eda39
Author: Yusuf Keten 
AuthorDate: Tue Feb 4 00:14:17 2020 +0300
Commit: Mike Kaganski 
CommitDate: Tue Feb 11 18:25:37 2020 +0100

tdf#114694: Make default value in language settings the first element

For Languages, to make the default value ​​the first element in the
list, I've added 3 parameters to SvxLanguageBox::SetLanguageList().
With this parameters, function adds default value according to its
existence before other values. For sorting User Interface and
Currency, I removed the make_sorted function.  I added std::sort
with lambda expressions for both of them.

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

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index fb73341b9897..d99f3530e161 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 
*/
 /*
  * This file is part of the LibreOffice project.
  *
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1335,9 +1336,6 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(weld::Container* 
pPage, weld::DialogCon
 , m_xCTLSupportCB(m_xBuilder->weld_check_button("ctlsupport"))
 , 
m_xIgnoreLanguageChangeCB(m_xBuilder->weld_check_button("ignorelanguagechange"))
 {
-m_xUserInterfaceLB->make_sorted();
-m_xCurrencyLB->make_sorted();
-
 // tdf#125483 save original default label
 m_sDecimalSeparatorLabel = m_xDecimalSeparatorCB->get_label();
 
@@ -1349,7 +1347,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(weld::Container* 
pPage, weld::DialogCon

SvtLanguageTable::GetLanguageString(GetInstalledLocaleForSystemUILanguage().getLanguageType());
 
 m_xUserInterfaceLB->append("0", aUILang);
-m_xUserInterfaceLB->set_active(0);
+m_xUserInterfaceLB->append_separator("");
 try
 {
 Reference< XMultiServiceFactory > theConfigProvider(
@@ -1364,16 +1362,32 @@ 
OfaLanguagesTabPage::OfaLanguagesTabPage(weld::Container* pPage, weld::DialogCon
 theConfigProvider->createInstanceWithArguments(sAccessSrvc, 
theArgs ), UNO_QUERY_THROW );
 seqInstalledLanguages = theNameAccess->getElementNames();
 LanguageType aLang = LANGUAGE_DONTKNOW;
-for (sal_IntPtr i=0; i > aUILanguages;
+for (sal_Int32 i=0; iappend(OUString::number(i+1), aLangStr);
+aUILanguages.emplace_back(i+1, aLangStr);
 }
 }
 
+std::sort(aUILanguages.begin(), aUILanguages.end(), [](const auto& l1, 
const auto& l2) {
+static const auto aSorter = 
comphelper::string::NaturalStringSorter(
+comphelper::getProcessComponentContext(),
+Application::GetSettings().GetLanguageTag().getLocale());
+return aSorter.compare(l1.second, l2.second) < 0;
+});
+
+// tdf#114694: append the sorted list after the default entry and 
separator.
+for (const auto & [ nGroupID, sGroupName ] : aUILanguages)
+{
+m_xUserInterfaceLB->append(OUString::number(nGroupID), sGroupName);
+}
+
+m_xUserInterfaceLB->set_active(0);
+
 // find out whether the user has a specific locale specified
 Sequence< Any > theArgs2(1);
 theArgs2[0] <<= NamedValue("nodepath", Any(OUString(sUserLocalePath)));
@@ -1400,38 +1414,57 @@ 
OfaLanguagesTabPage::OfaLanguagesTabPage(weld::Container* pPage, weld::DialogCon
 TOOLS_WARN_EXCEPTION("cui.options", "ignoring" );
 }
 
-m_xWesternLanguageLB->SetLanguageList( SvxLanguageListFlags::WESTERN | 
SvxLanguageListFlags::ONLY_KNOWN, true, false, true );
-m_xWesternLanguageLB->InsertDefaultLanguage( css::i18n::ScriptType::LATIN 
);
-m_xAsianLanguageLB->SetLanguageList( SvxLanguageListFlags::CJK | 
SvxLanguageListFlags::ONLY_KNOWN, true, false, true );
-m_xAsianLanguageLB->InsertDefaultLanguage( css::i18n::ScriptType::ASIAN );
-m_xComplexLanguageLB->SetLanguageList( SvxLanguageListFlags::CTL | 
SvxLanguageListFlags::ONLY_KNOWN, true, false, true );
-m_xComplexLanguageLB->InsertDefaultLanguage( 
css::i18n::ScriptType::COMPLEX );
+m_xWesternLanguageLB->SetLanguageList(
+SvxLanguageListFlags::WESTERN | SvxLanguageListFlags::ONLY_KNOWN, 
true, false, true, true,
+

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

2020-02-08 Thread Yusuf Keten (via logerrit)
 include/vcl/outdev.hxx   |2 ++
 include/vcl/print.hxx|2 ++
 vcl/source/gdi/print.cxx |7 +++
 vcl/source/gdi/print2.cxx|   11 +--
 vcl/source/outdev/outdev.cxx |5 +
 5 files changed, 17 insertions(+), 10 deletions(-)

New commits:
commit ec48d37f574924c66dea4f7adb56944bbe636aa1
Author: Yusuf Keten 
AuthorDate: Fri Feb 7 19:18:57 2020 +0300
Commit: Muhammet Kara 
CommitDate: Sat Feb 8 16:56:23 2020 +0100

tdf#74702 Remove OutDevType from 
OutputDevice::RemoveTransparenciesFromMetaFile

Extracted SetBackgroundComponentBounds() which removes need for
checking OutDevType especially whether it is Printer or not in OutputDevice.

Change-Id: Ib8884b861314f595283af9ae3a2cd5645b334d51
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86312
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 687b9a1c207a..e4430b2415f3 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -559,6 +559,8 @@ protected:
 
 virtual voidCopyDeviceArea( SalTwoRect& aPosAry, bool 
bWindowInvalidate);
 
+virtual tools::RectangleSetBackgroundComponentBounds();
+
 virtual voidDrawOutDevDirectCheck( const OutputDevice* 
pSrcDev, SalGraphics*& pSrcGraphics );
 
 virtual voidDrawOutDevDirectProcess( const OutputDevice* 
pSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics );
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index 154ee694bd83..eff9c983ff5c 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -365,6 +365,8 @@ public:
 virtual voidCopyArea( const Point& rDestPt, const Point& 
rSrcPt,
 const Size& rSrcSize, bool 
bWindowInvalidate = false ) override;
 
+virtual tools::RectangleSetBackgroundComponentBounds() override;
+
 // These 3 together are more modular PrintJob(), allowing printing more 
documents as one print job
 // by repeated calls to ExecutePrintJob(). Used by mailmerge.
 static bool PreparePrintJob( 
std::shared_ptr i_pController,
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 364f0af35587..7c8a68892708 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -316,6 +316,13 @@ void Printer::CopyArea( const Point& /*rDestPt*/,
 SAL_WARN( "vcl.gdi", "Don't use OutputDevice::CopyArea(...) with printer 
devices!" );
 }
 
+tools::Rectangle Printer::SetBackgroundComponentBounds()
+{
+Point aPageOffset = Point( 0, 0 ) - this->GetPageOffsetPixel();
+Size aSize  = this->GetPaperSizePixel();
+return tools::Rectangle( aPageOffset, aSize );
+}
+
 void Printer::SetPrinterOptions( const PrinterOptions& i_rOptions )
 {
 *mpPrinterOptions = i_rOptions;
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index db4b6dd0af72..b51318c8ea83 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -748,16 +748,7 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const 
GDIMetaFile& rInMtf,
 if( rBackground != COL_TRANSPARENT )
 {
 aBackgroundComponent.aBgColor = rBackground;
-if( meOutDevType == OUTDEV_PRINTER )
-{
-Printer* pThis = dynamic_cast(this);
-assert(pThis);
-Point aPageOffset = Point( 0, 0 ) - 
pThis->GetPageOffsetPixel();
-Size aSize  = pThis->GetPaperSizePixel();
-aBackgroundComponent.aBounds = tools::Rectangle( aPageOffset, 
aSize );
-}
-else
-aBackgroundComponent.aBounds = tools::Rectangle( Point( 0, 0 
), GetOutputSizePixel() );
+aBackgroundComponent.aBounds = SetBackgroundComponentBounds();
 }
 while( pCurrAct && bStillBackground )
 {
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 880181cb5407..0dcdd84a5d0a 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -579,6 +579,11 @@ void OutputDevice::DrawOutDevDirectProcess( const 
OutputDevice* pSrcDev, SalTwoR
 mpGraphics->CopyBits( rPosAry, pSrcGraphics, this, pSrcDev );
 }
 
+tools::Rectangle OutputDevice::SetBackgroundComponentBounds()
+{
+return tools::Rectangle( Point( 0, 0 ), GetOutputSizePixel() );
+}
+
 // Layout public functions
 
 void OutputDevice::EnableRTL( bool bEnable )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-04 Thread Yusuf Keten (via logerrit)
 include/vcl/outdev.hxx   |4 ++
 include/vcl/window.hxx   |2 +
 vcl/source/outdev/outdev.cxx |   68 +--
 vcl/source/window/window.cxx |   42 ++
 4 files changed, 76 insertions(+), 40 deletions(-)

New commits:
commit a68157c88add7a815678155f4d7a743b010d92f5
Author: Yusuf Keten 
AuthorDate: Sat Jan 4 20:39:42 2020 +0300
Commit: Muhammet Kara 
CommitDate: Tue Feb 4 18:05:28 2020 +0100

tdf#74702: Remove enum OutDevType from OutputDevice::drawOutDevDirect

Extracted DrawOutDevDirectCheck and DrawOutDevDirectProcess. 
DrawoutDevDirectCheck checks OutputDeviceType and define pSrcGraphics according 
to its type. DrawOutDevDirectProcess perform some operations about drawing out 
according to its type and checks some pointers for avoiding NULL pointer.

Change-Id: I24247ee42d2dd686dbd13bb5f6b24bbe8fab43ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86229
Reviewed-by: Muhammet Kara 
Reviewed-by: Tomaž Vajngerl 
Tested-by: Jenkins

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 022edb9e2a54..c991867495ea 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -559,6 +559,10 @@ protected:
 
 virtual voidCopyDeviceArea( SalTwoRect& aPosAry, bool 
bWindowInvalidate);
 
+virtual voidDrawOutDevDirectCheck( const OutputDevice* 
pSrcDev, SalGraphics*& pSrcGraphics );
+
+virtual voidDrawOutDevDirectProcess( const OutputDevice* 
pSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics );
+
 SAL_DLLPRIVATE void drawOutDevDirect ( const OutputDevice* 
pSrcDev, SalTwoRect& rPosAry );
 
 SAL_DLLPRIVATE bool is_double_buffered_window() const;
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index a78259c5f222..6d98bec0576b 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -752,6 +752,8 @@ protected:
 virtual voidImplAdjustNWFSizes();
 
 virtual voidCopyDeviceArea( SalTwoRect& aPosAry, 
bool bWindowInvalidate) override;
+virtual voidDrawOutDevDirectCheck(const 
OutputDevice* pSrcDev, SalGraphics*& pSrcGraphics) override;
+virtual voidDrawOutDevDirectProcess( const 
OutputDevice* pSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) 
override;
 virtual voidClipToPaintRegion( tools::Rectangle& 
rDstRect ) override;
 virtual boolUsePolyPolygonForComplexGradient() 
override;
 
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 6776cb3d7c85..880181cb5407 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -532,41 +532,9 @@ void OutputDevice::CopyDeviceArea( SalTwoRect& aPosAry, 
bool /*bWindowInvalidate
 void OutputDevice::drawOutDevDirect( const OutputDevice* pSrcDev, SalTwoRect& 
rPosAry )
 {
 SalGraphics* pSrcGraphics;
+SalGraphics*& pSrcGraphicsRef = pSrcGraphics;
 
-if ( this == pSrcDev )
-pSrcGraphics = nullptr;
-else
-{
-if ( (GetOutDevType() != pSrcDev->GetOutDevType()) ||
- (GetOutDevType() != OUTDEV_WINDOW) )
-{
-if ( !pSrcDev->mpGraphics )
-{
-if ( !pSrcDev->AcquireGraphics() )
-return;
-}
-pSrcGraphics = pSrcDev->mpGraphics;
-}
-else
-{
-if ( static_cast(this)->mpWindowImpl->mpFrameWindow 
== static_cast(pSrcDev)->mpWindowImpl->mpFrameWindow )
-pSrcGraphics = nullptr;
-else
-{
-if ( !pSrcDev->mpGraphics )
-{
-if ( !pSrcDev->AcquireGraphics() )
-return;
-}
-pSrcGraphics = pSrcDev->mpGraphics;
-
-if ( !mpGraphics && !AcquireGraphics() )
-return;
-SAL_WARN_IF( !mpGraphics || !pSrcDev->mpGraphics, "vcl.gdi",
-"OutputDevice::DrawOutDev(): We need more than one 
Graphics" );
-}
-}
-}
+DrawOutDevDirectCheck(pSrcDev, pSrcGraphicsRef);
 
 // #102532# Offset only has to be pseudo window offset
 const tools::Rectangle aSrcOutRect( Point( pSrcDev->mnOutOffX, 
pSrcDev->mnOutOffY ),
@@ -580,17 +548,37 @@ void OutputDevice::drawOutDevDirect( const OutputDevice* 
pSrcDev, SalTwoRect& rP
 // mirroring may be required
 // because only windows have a SalGraphicsLayout
 // mirroring is performed here
-if( (GetOutDevType() != OUTDEV_WINDOW) && pSrcGraphics && 
(pSrcGraphics->GetLayout() & SalLayoutFlags::BiDiRtl) )
+DrawOutDevDirectProcess( pSrcDev, rPosAry, pSrcGraphics);
+}
+}
+
+void OutputDevice::DrawOutDevDirectCheck( const OutputDevice* pSrcDev, 
SalGraphics*& 

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

2020-02-01 Thread Yusuf Keten (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx   |   44 +++-
 sw/qa/extras/ooxmlexport/ooxmlw14export.cxx |   36 +-
 2 files changed, 20 insertions(+), 60 deletions(-)

New commits:
commit a5cdcc3a17a562382fc2cc38a8aaf5b584343d12
Author: Yusuf Keten 
AuthorDate: Sun Feb 2 00:06:00 2020 +0300
Commit: Mike Kaganski 
CommitDate: Sun Feb 2 08:21:43 2020 +0100

 tdf#129423: Make export tests export-only where applicable

Change-Id: I5754534c4bd77d2b5f406b12e994427924e89e27
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87812
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index d28322e7cedd..d0579508fabe 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -508,21 +508,17 @@ DECLARE_OOXMLEXPORT_TEST(testTdf112352_nextPageColumns, 
"tdf112352_nextPageColum
 CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextColumns->getColumnCount());
 }
 
-DECLARE_OOXMLEXPORT_TEST(testTdf109310_endnoteStyleForMSO, 
"tdf109310_endnoteStyleForMSO.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf109310_endnoteStyleForMSO, 
"tdf109310_endnoteStyleForMSO.docx")
 {
 xmlDocPtr pXmlDoc = parseExport("word/endnotes.xml");
-if (!pXmlDoc)
-return;
 // Check w:rStyle element has w:val attribute - note that w: is not 
specified for attribute
 assertXPath(pXmlDoc, 
"/w:endnotes/w:endnote[@w:id='2']/w:p/w:r[1]/w:rPr/w:rStyle", "val",
 "EndnoteCharacters");
 }
 
-DECLARE_OOXMLEXPORT_TEST(testTdf103389, "tdf103389.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf103389, "tdf103389.docx")
 {
 xmlDocPtr pXmlDoc = parseExport("word/document.xml");
-if (!pXmlDoc)
-return;
 // No geometry was exported for the second canvas
 // Check both canvases' geometry
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:p[1]/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:inline/a:graphic/a:graphicData/wpg:wgp/wps:wsp/wps:spPr/a:prstGeom",
 "prst", "rect");
@@ -610,11 +606,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf79329, "tdf79329.docx")
 CPPUNIT_ASSERT_EQUAL(static_cast(2), xTables->getCount());
 }
 
-DECLARE_OOXMLEXPORT_TEST(testTdf103982, "tdf103982.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf103982, "tdf103982.docx")
 {
 xmlDocPtr pXmlDoc = parseExport("word/document.xml");
-if (!pXmlDoc)
-return;
 sal_Int32 nDistB = getXPath(pXmlDoc, "//wp:anchor", "distB").toInt32();
 // This was -260350, which is not a valid value for an unsigned type.
 CPPUNIT_ASSERT(nDistB >= 0);
@@ -624,11 +618,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf103982, "tdf103982.docx")
 CPPUNIT_ASSERT(!getProperty(xPropertySet, "Shadow"));
 }
 
-DECLARE_OOXMLEXPORT_TEST(testTdf104115, "tdf104115.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf104115, "tdf104115.docx")
 {
 xmlDocPtr pXmlDoc = parseExport("word/document.xml");
-if (!pXmlDoc)
-return;
 // This found 0 nodes: the custom geometry was not written for the Bezier
 // curve -> Word refused to open the document.
 assertXPath(pXmlDoc, "//a:custGeom", 1);
@@ -646,15 +638,13 @@ DECLARE_OOXMLEXPORT_TEST(testTdf103651, "tdf103651.docx")
 CPPUNIT_ASSERT(getProperty(getRun(getParagraph(1), 1), 
"CharAutoKerning"));
 }
 
-DECLARE_OOXMLEXPORT_TEST(testTdf99227, "tdf99227.docx")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf99227, "tdf99227.docx")
 {
 // A drawing anchored as character to a footnote caused write past end of 
document.xml at export to docx.
 // After that, importing after export failed with
 // SAXParseException: '[word/document.xml line 2]: Extra content at the 
end of the document', Stream 'word / document.xml',
 // and before commit ebf767eeb2a169ba533e1b2ffccf16f41d95df35, the drawing 
was silently lost.
 xmlDocPtr pXmlDoc = parseExport("word/footnotes.xml");
-if (!pXmlDoc)
-return;
 
 assertXPath(pXmlDoc, "//w:footnote/w:p/w:r/w:drawing", 1);
 }
@@ -822,13 +812,11 @@ DECLARE_OOXMLEXPORT_TEST(testTdf106001, "tdf106001.docx")
 CPPUNIT_ASSERT_EQUAL( static_cast( 100 ), 
getProperty(getRun(getParagraph(1), 1), "CharScaleWidth" ));
 }
 
-DECLARE_OOXMLEXPORT_TEST(testTdf106001_2, "tdf106001-2.odt")
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf106001_2, "tdf106001-2.odt")
 {
 // In test ODT CharScaleWidth = 900, this was not changed upon OOXML 
export to stay in [1..600], now it's clamped to 600
 // Note: we disregard what's set in pPr / rPr and only care about r / rPr
 xmlDocPtr pXmlDoc = parseExport("word/document.xml");
-if (!pXmlDoc)
-return;
 assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:rPr/w:w","val","600");
 }
 
@@ -1135,11 +1123,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf109184, "tdf109184.docx")
 CPPUNIT_ASSERT_EQUAL(static_cast(0xff), 
getProperty(xCell3, "BackColor"));
 }
 

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

2020-01-13 Thread Yusuf Keten (via logerrit)
 sfx2/source/doc/doctemplates.cxx |4 ++--
 svx/source/dialog/charmap.cxx|4 ++--
 svx/source/svdraw/svdedtv2.cxx   |4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit c7de89df5efc4b2af1f81c00befcc957a7e22ca6
Author: Yusuf Keten 
AuthorDate: Sat Jan 4 15:30:01 2020 +0300
Commit: Michael Stahl 
CommitDate: Mon Jan 13 14:04:42 2020 +0100

tdf#75280 Convert inappropriate use of sal_uIntPtr to better integer types

Change-Id: Ia45fb0bc882411fe0bfcd1e83932d187b4873ab0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86214
Reviewed-by: Michael Stahl 
Tested-by: Jenkins

diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index aba17d40360b..1247d6cfab88 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -2580,8 +2580,8 @@ void SfxDocTplService_Impl::addGroupToHierarchy( 
GroupData_Impl *pGroup )
 setProperty( aGroup, TARGET_DIR_URL, makeAny( pGroup->getTargetURL() ) 
);
 pGroup->setHierarchyURL( aNewGroupURL );
 
-sal_uIntPtr nCount = pGroup->count();
-for ( sal_uIntPtr i=0; icount();
+for ( size_t i = 0; i < nCount; i++ )
 {
 DocTemplates_EntryData_Impl *pData = pGroup->getEntry( i );
 addToHierarchy( pGroup, pData ); // add entry to hierarchy
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index ff323461cfa5..403d748a231e 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -358,9 +358,9 @@ int SvxShowCharSet::FirstInView() const
 
 int SvxShowCharSet::LastInView() const
 {
-sal_uIntPtr nIndex = FirstInView();
+sal_uInt32 nIndex = FirstInView();
 nIndex += ROW_COUNT * COLUMN_COUNT - 1;
-sal_uIntPtr nCompare = 
sal::static_int_cast(mxFontCharMap->GetCharCount() - 1);
+sal_uInt32 nCompare = mxFontCharMap->GetCharCount() - 1;
 if (nIndex > nCompare)
 nIndex = nCompare;
 return nIndex;
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index 286b74bb5a23..72a743fda6c8 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -2093,7 +2093,7 @@ void SdrEditView::DoImportMarkedMtf(SvdProgressInfo 
*pProgrInfo)
 SdrPageView* pPV=pM->GetPageView();
 SdrObjList*  pOL=pObj->getParentSdrObjListFromSdrObject();
 const size_t nInsPos=pObj->GetOrdNum()+1;
-sal_uIntPtr  nInsCnt=0;
+size_t  nInsCnt=0;
 tools::Rectangle aLogicRect;
 
 SdrGrafObj*  pGraf = dynamic_cast( pObj );
@@ -2142,7 +2142,7 @@ void SdrEditView::DoImportMarkedMtf(SvdProgressInfo 
*pProgrInfo)
 if (aGeoStat.nRotationAngle)
 aGeoStat.RecalcSinCos();
 
-for (sal_uIntPtr i = 0; i < nInsCnt; i++)
+for (size_t i = 0; i < nInsCnt; i++)
 {
 if (bUndo)
 
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pOL->GetObj(nObj)));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: dbaccess/source package/source sccomp/source sc/source svx/source

2020-01-12 Thread Yusuf Keten (via logerrit)
 dbaccess/source/filter/xml/xmlfilter.cxx |3 +--
 dbaccess/source/ui/browser/unodatbr.cxx  |3 +--
 package/source/zippackage/ZipPackage.cxx |3 +--
 sc/source/ui/sidebar/ScPanelFactory.cxx  |3 +--
 sc/source/ui/unoobj/appluno.cxx  |3 +--
 sc/source/ui/unoobj/miscuno.cxx  |3 +--
 sc/source/ui/unoobj/pageuno.cxx  |3 +--
 sc/source/ui/unoobj/scdetect.cxx |3 +--
 sccomp/source/solver/SwarmSolver.cxx |3 +--
 svx/source/tbxctrls/tbunocontroller.cxx  |3 +--
 10 files changed, 10 insertions(+), 20 deletions(-)

New commits:
commit 1be03e47df4281a2a855a61b71f006dea0e212ff
Author: Yusuf Keten 
AuthorDate: Sat Jan 11 19:01:20 2020 +0300
Commit: Stephan Bergmann 
CommitDate: Sun Jan 12 17:09:42 2020 +0100

tdf88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

Change-Id: I5eb9c58f511a6ded473eb3fb998fd21584c227d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86607
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx 
b/dbaccess/source/filter/xml/xmlfilter.cxx
index d0b93e21f80d..9aba80c73801 100644
--- a/dbaccess/source/filter/xml/xmlfilter.cxx
+++ b/dbaccess/source/filter/xml/xmlfilter.cxx
@@ -218,8 +218,7 @@ OUString ODBFilter::getImplementationName_Static()
 
 css::uno::Sequence ODBFilter::getSupportedServiceNames_Static()
 {
-css::uno::Sequence s { "com.sun.star.document.ImportFilter" };
-return s;
+return { "com.sun.star.document.ImportFilter" };
 }
 
 
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx 
b/dbaccess/source/ui/browser/unodatbr.cxx
index e5c095e185e9..02c1e734ac6c 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -198,8 +198,7 @@ OUString 
SbaTableQueryBrowser::getImplementationName_Static()
 
 css::uno::Sequence 
SbaTableQueryBrowser::getSupportedServiceNames_Static()
 {
-css::uno::Sequence aSupported { 
"com.sun.star.sdb.DataSourceBrowser" };
-return aSupported;
+return { "com.sun.star.sdb.DataSourceBrowser" };
 }
 
 Reference< XInterface > SbaTableQueryBrowser::Create(const 
Reference& _rxFactory)
diff --git a/package/source/zippackage/ZipPackage.cxx 
b/package/source/zippackage/ZipPackage.cxx
index 7a0b8c1934ec..9f5d9f632cf7 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -1683,8 +1683,7 @@ OUString ZipPackage::static_getImplementationName()
 
 Sequence< OUString > ZipPackage::static_getSupportedServiceNames()
 {
-uno::Sequence aNames { "com.sun.star.packages.Package" };
-return aNames;
+return { "com.sun.star.packages.Package" };
 }
 
 OUString ZipPackage::getImplementationName()
diff --git a/sc/source/ui/sidebar/ScPanelFactory.cxx 
b/sc/source/ui/sidebar/ScPanelFactory.cxx
index 7257b5b07972..b3f69e7b0e08 100644
--- a/sc/source/ui/sidebar/ScPanelFactory.cxx
+++ b/sc/source/ui/sidebar/ScPanelFactory.cxx
@@ -128,8 +128,7 @@ sal_Bool ScPanelFactory::supportsService(OUString const & 
ServiceName)
 
 css::uno::Sequence ScPanelFactory::getSupportedServiceNames()
 {
-css::uno::Sequence aServiceNames { 
"com.sun.star.ui.UIElementFactory" };
-return aServiceNames;
+return { "com.sun.star.ui.UIElementFactory" };
 }
 
 } } // end of namespace sc::sidebar
diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx
index 683714501a15..4eebb81d8ff9 100644
--- a/sc/source/ui/unoobj/appluno.cxx
+++ b/sc/source/ui/unoobj/appluno.cxx
@@ -191,8 +191,7 @@ OUString 
ScSpreadsheetSettings::getImplementationName_Static()
 
 uno::Sequence 
ScSpreadsheetSettings::getSupportedServiceNames_Static()
 {
-uno::Sequence aRet { SCSPREADSHEETSETTINGS_SERVICE };
-return aRet;
+return { SCSPREADSHEETSETTINGS_SERVICE };
 }
 
 bool ScSpreadsheetSettings::getPropertyBool(const OUString& aPropertyName)
diff --git a/sc/source/ui/unoobj/miscuno.cxx b/sc/source/ui/unoobj/miscuno.cxx
index c8ccfa464295..9a74f7291c72 100644
--- a/sc/source/ui/unoobj/miscuno.cxx
+++ b/sc/source/ui/unoobj/miscuno.cxx
@@ -228,8 +228,7 @@ sal_Bool SAL_CALL ScIndexEnumeration::supportsService( 
const OUString& ServiceNa
 css::uno::Sequence< OUString >
 SAL_CALL ScIndexEnumeration::getSupportedServiceNames()
 {
-css::uno::Sequence aRet { sServiceName };
-return aRet;
+return { sServiceName };
 }
 
 ScNameToIndexAccess::ScNameToIndexAccess( const css::uno::Reference<
diff --git a/sc/source/ui/unoobj/pageuno.cxx b/sc/source/ui/unoobj/pageuno.cxx
index 3455537ff149..5de45a583953 100644
--- a/sc/source/ui/unoobj/pageuno.cxx
+++ b/sc/source/ui/unoobj/pageuno.cxx
@@ -54,8 +54,7 @@ sal_Bool SAL_CALL ScPageObj::supportsService( const OUString& 
rServiceName )
 
 uno::Sequence SAL_CALL ScPageObj::getSupportedServiceNames()
 {
-uno::Sequence aRet { "com.sun.star.sheet.SpreadsheetDrawPage" };
-return aRet;
+return { "com.sun.star.sheet.SpreadsheetDrawPage" };
 }
 
 /* vim:set 

[Libreoffice-commits] core.git: dbaccess/source extensions/source filter/source

2020-01-12 Thread Yusuf Keten (via logerrit)
 dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx |3 +--
 dbaccess/source/ui/uno/DBTypeWizDlg.cxx|3 +--
 dbaccess/source/ui/uno/TableFilterDlg.cxx  |3 +--
 dbaccess/source/ui/uno/UserSettingsDlg.cxx |3 +--
 dbaccess/source/ui/uno/admindlg.cxx|3 +--
 dbaccess/source/ui/uno/unosqlmessage.cxx   |3 +--
 extensions/source/propctrlr/MasterDetailLinkDialog.cxx |3 +--
 filter/source/msfilter/msvbahelper.cxx |3 +--
 8 files changed, 8 insertions(+), 16 deletions(-)

New commits:
commit dd3e75758f9de9e08022938b5cc948c2a4417058
Author: Yusuf Keten 
AuthorDate: Sat Jan 11 18:43:19 2020 +0300
Commit: Stephan Bergmann 
CommitDate: Sun Jan 12 17:07:31 2020 +0100

tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctor

Change-Id: I9b285a80e0d52f412e2738995d66aa65cf93d16a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86606
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx 
b/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx
index 9a2d0e652176..70fc2e9fa5e4 100644
--- a/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx
+++ b/dbaccess/source/ui/uno/AdvancedSettingsDlg.cxx
@@ -106,8 +106,7 @@ namespace dbaui
 
 css::uno::Sequence 
OAdvancedSettingsDialog::getSupportedServiceNames_Static()
 {
-css::uno::Sequence aSupported { 
"com.sun.star.sdb.AdvancedDatabaseSettingsDialog" };
-return aSupported;
+return { "com.sun.star.sdb.AdvancedDatabaseSettingsDialog" };
 }
 
 Reference  SAL_CALL 
OAdvancedSettingsDialog::getPropertySetInfo()
diff --git a/dbaccess/source/ui/uno/DBTypeWizDlg.cxx 
b/dbaccess/source/ui/uno/DBTypeWizDlg.cxx
index 963d3e136668..4906d080b8f6 100644
--- a/dbaccess/source/ui/uno/DBTypeWizDlg.cxx
+++ b/dbaccess/source/ui/uno/DBTypeWizDlg.cxx
@@ -70,8 +70,7 @@ css::uno::Sequence SAL_CALL 
ODBTypeWizDialog::getSupportedServiceNames
 
 css::uno::Sequence 
ODBTypeWizDialog::getSupportedServiceNames_Static()
 {
-css::uno::Sequence aSupported { 
"com.sun.star.sdb.DataSourceTypeChangeDialog" };
-return aSupported;
+return { "com.sun.star.sdb.DataSourceTypeChangeDialog" };
 }
 
 Reference  SAL_CALL ODBTypeWizDialog::getPropertySetInfo()
diff --git a/dbaccess/source/ui/uno/TableFilterDlg.cxx 
b/dbaccess/source/ui/uno/TableFilterDlg.cxx
index 92fee688b89d..f34c1a1005c6 100644
--- a/dbaccess/source/ui/uno/TableFilterDlg.cxx
+++ b/dbaccess/source/ui/uno/TableFilterDlg.cxx
@@ -71,8 +71,7 @@ css::uno::Sequence SAL_CALL 
OTableFilterDialog::getSupportedServiceNam
 
 css::uno::Sequence 
OTableFilterDialog::getSupportedServiceNames_Static()
 {
-css::uno::Sequence aSupported { 
"com.sun.star.sdb.TableFilterDialog" };
-return aSupported;
+return { "com.sun.star.sdb.TableFilterDialog" };
 }
 
 Reference  SAL_CALL OTableFilterDialog::getPropertySetInfo()
diff --git a/dbaccess/source/ui/uno/UserSettingsDlg.cxx 
b/dbaccess/source/ui/uno/UserSettingsDlg.cxx
index 3bb09cad794b..b1e829fe02d2 100644
--- a/dbaccess/source/ui/uno/UserSettingsDlg.cxx
+++ b/dbaccess/source/ui/uno/UserSettingsDlg.cxx
@@ -71,8 +71,7 @@ css::uno::Sequence SAL_CALL 
OUserSettingsDialog::getSupportedServiceNa
 
 css::uno::Sequence 
OUserSettingsDialog::getSupportedServiceNames_Static()
 {
-css::uno::Sequence aSupported { 
"com.sun.star.sdb.UserAdministrationDialog" };
-return aSupported;
+return { "com.sun.star.sdb.UserAdministrationDialog" };
 }
 
 Reference  SAL_CALL OUserSettingsDialog::getPropertySetInfo()
diff --git a/dbaccess/source/ui/uno/admindlg.cxx 
b/dbaccess/source/ui/uno/admindlg.cxx
index f5d9c97a7263..2562b946b650 100644
--- a/dbaccess/source/ui/uno/admindlg.cxx
+++ b/dbaccess/source/ui/uno/admindlg.cxx
@@ -71,8 +71,7 @@ css::uno::Sequence SAL_CALL 
ODataSourcePropertyDialog::getSupportedSer
 
 css::uno::Sequence 
ODataSourcePropertyDialog::getSupportedServiceNames_Static()
 {
-css::uno::Sequence aSupported { 
"com.sun.star.sdb.DatasourceAdministrationDialog" };
-return aSupported;
+return { "com.sun.star.sdb.DatasourceAdministrationDialog" };
 }
 
 Reference  SAL_CALL 
ODataSourcePropertyDialog::getPropertySetInfo()
diff --git a/dbaccess/source/ui/uno/unosqlmessage.cxx 
b/dbaccess/source/ui/uno/unosqlmessage.cxx
index cf8551c6a722..d566fcadd8e9 100644
--- a/dbaccess/source/ui/uno/unosqlmessage.cxx
+++ b/dbaccess/source/ui/uno/unosqlmessage.cxx
@@ -86,8 +86,7 @@ css::uno::Sequence SAL_CALL 
OSQLMessageDialog::getSupportedServiceName
 
 css::uno::Sequence 
OSQLMessageDialog::getSupportedServiceNames_Static()
 {
-css::uno::Sequence aSupported { 
"com.sun.star.sdb.ErrorMessageDialog" };
-return aSupported;
+return { "com.sun.star.sdb.ErrorMessageDialog" };
 }
 
 void OSQLMessageDialog::initialize(Sequence const & args)
diff --git a/extensions/source/propctrlr/MasterDetailLinkDialog.cxx 

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

2020-01-08 Thread Yusuf Keten (via logerrit)
 filter/source/graphicfilter/icgm/class1.cxx |2 +-
 filter/source/graphicfilter/icgm/class4.cxx |6 +++---
 sfx2/source/doc/oleprops.cxx|8 
 sfx2/source/view/viewfrm.cxx|4 ++--
 svx/source/dialog/_bmpmask.cxx  |6 +++---
 5 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit d66ddcffe61d90cb1472e74a040963086032bf9c
Author: Yusuf Keten 
AuthorDate: Tue Jan 7 00:05:15 2020 +0300
Commit: Michael Stahl 
CommitDate: Wed Jan 8 16:24:12 2020 +0100

tdf#75280 Convert inappropriate use of sal_uIntPtr to better integer types

Change-Id: Idf73b768671c0daa0d815b75ce71740fc0e5f5c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86310
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/filter/source/graphicfilter/icgm/class1.cxx 
b/filter/source/graphicfilter/icgm/class1.cxx
index cf9e7ed9885f..2661931d7df2 100644
--- a/filter/source/graphicfilter/icgm/class1.cxx
+++ b/filter/source/graphicfilter/icgm/class1.cxx
@@ -169,7 +169,7 @@ void CGM::ImplDoClass1()
 {
 sal_uInt32 nSize = ImplGetUI(1);
 
-if (static_cast(mpEndValidSource - (mpSource + 
mnParaSize)) < nSize)
+if (static_cast(mpEndValidSource - (mpSource + 
mnParaSize)) < nSize)
 throw css::uno::Exception("attempt to read past end of 
input", nullptr);
 
 pElement->aFontList.InsertName( mpSource + mnParaSize, nSize );
diff --git a/filter/source/graphicfilter/icgm/class4.cxx 
b/filter/source/graphicfilter/icgm/class4.cxx
index 0213e89542e3..4760215ebe18 100644
--- a/filter/source/graphicfilter/icgm/class4.cxx
+++ b/filter/source/graphicfilter/icgm/class4.cxx
@@ -186,7 +186,7 @@ void CGM::ImplDoClass4()
 sal_uInt32 nType = ImplGetUI16();
 sal_uInt32 nSize = ImplGetUI( 1 );
 
-if (static_cast(mpEndValidSource - (mpSource + 
mnParaSize)) < nSize)
+if (static_cast(mpEndValidSource - (mpSource + 
mnParaSize)) < nSize)
 throw css::uno::Exception("attempt to read past end of 
input", nullptr);
 
 OUString aStr(reinterpret_cast(mpSource) + mnParaSize, 
nSize, RTL_TEXTENCODING_ASCII_US);
@@ -223,7 +223,7 @@ void CGM::ImplDoClass4()
 sal_uInt32 nType = ImplGetUI16();
 sal_uInt32 nSize = ImplGetUI(1);
 
-if (static_cast(mpEndValidSource - (mpSource + 
mnParaSize)) < nSize)
+if (static_cast(mpEndValidSource - (mpSource + 
mnParaSize)) < nSize)
 throw css::uno::Exception("attempt to read past end of 
input", nullptr);
 
 OUString aStr(reinterpret_cast(mpSource) + mnParaSize, 
nSize, RTL_TEXTENCODING_ASCII_US);
@@ -240,7 +240,7 @@ void CGM::ImplDoClass4()
 (void)ImplGetUI16(); // nType
 sal_uInt32 nSize = ImplGetUI( 1 );
 
-if (static_cast(mpEndValidSource - (mpSource + 
mnParaSize)) <= nSize)
+if (static_cast(mpEndValidSource - (mpSource + 
mnParaSize)) <= nSize)
 throw css::uno::Exception("attempt to read past end of 
input", nullptr);
 
 mpSource[ mnParaSize + nSize ] = 0;
diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx
index 6ff78214d802..e194db7d2671 100644
--- a/sfx2/source/doc/oleprops.cxx
+++ b/sfx2/source/doc/oleprops.cxx
@@ -538,10 +538,10 @@ void SfxOleFileTimeProperty::ImplSave( SvStream& rStrm )
 static_cast< sal_uInt16 >( maDateTime.Month ),
 static_cast< sal_uInt16 >( maDateTime.Year ) ),
 tools::Time(
-static_cast< sal_uIntPtr >( maDateTime.Hours ),
-static_cast< sal_uIntPtr >( maDateTime.Minutes ),
-static_cast< sal_uIntPtr >( maDateTime.Seconds ),
-static_cast< sal_uIntPtr >( maDateTime.NanoSeconds ) ) );
+static_cast< sal_uInt16 >( maDateTime.Hours ),
+static_cast< sal_uInt16 >( maDateTime.Minutes ),
+static_cast< sal_uInt16 >( maDateTime.Seconds ),
+static_cast< sal_uInt32 >( maDateTime.NanoSeconds ) ) );
 // invalid time stamp is not converted to UTC
 // heuristic to detect editing durations (which we assume to be < 1 year):
 // check only the year, not the entire date
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index e7f0bbd1c3a4..94964af0ca92 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2694,8 +2694,8 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const 
OUString& sMacro )
 aOUSource = pModule->GetSource32();
 sal_uInt16 nStart, nEnd;
 pMethod->GetLineRange( nStart, nEnd );
-sal_uIntPtr nlStart = nStart;
-sal_uIntPtr nlEnd = nEnd;
+sal_uInt16 

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

2020-01-08 Thread Yusuf Keten (via logerrit)
 svx/source/engine3d/obj3d.cxx  |2 +-
 svx/source/svdraw/svdobj.cxx   |2 +-
 svx/source/svdraw/svdocirc.cxx |4 ++--
 svx/source/svdraw/svdograf.cxx |2 +-
 svx/source/svdraw/svdomeas.cxx |6 +++---
 svx/source/svdraw/svdotext.cxx |2 +-
 svx/source/svdraw/svdotxdr.cxx |2 +-
 tools/source/stream/stream.cxx |2 +-
 8 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit f69fa576c579a88853a563aed1b947319b6ffcf1
Author: Yusuf Keten 
AuthorDate: Tue Jan 7 00:12:30 2020 +0300
Commit: Michael Stahl 
CommitDate: Wed Jan 8 14:00:31 2020 +0100

 tdf#96505 Get rid of cargo cult long integer literals

Change-Id: Ic0cde7c087d54a80a57d2a2574fa1f3932192367
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86311
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx
index f743c58fd67b..911a9b7ff70a 100644
--- a/svx/source/engine3d/obj3d.cxx
+++ b/svx/source/engine3d/obj3d.cxx
@@ -520,7 +520,7 @@ basegfx::B2DPolyPolygon E3dCompoundObject::TakeXorPoly() 
const
 sal_uInt32 E3dCompoundObject::GetHdlCount() const
 {
 // 8 corners + 1 E3dVolumeMarker (= Wireframe representation)
-return 9L;
+return 9;
 }
 
 void E3dCompoundObject::AddToHdlList(SdrHdlList& rHdlList) const
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index db6238c704ba..d1d898379fdf 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1190,7 +1190,7 @@ basegfx::B2DPolyPolygon SdrObject::TakeContour() const
 
 sal_uInt32 SdrObject::GetHdlCount() const
 {
-return 8L;
+return 8;
 }
 
 void SdrObject::AddToHdlList(SdrHdlList& rHdlList) const
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index 7c5aa3bf9196..efbc2803cb2f 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -424,11 +424,11 @@ sal_uInt32 SdrCircObj::GetHdlCount() const
 {
 if(SdrCircKind::Full != meCircleKind)
 {
-return 10L;
+return 10;
 }
 else
 {
-return 8L;
+return 8;
 }
 }
 
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 135b934be8b4..67b598ce14b3 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -767,7 +767,7 @@ SdrGrafObj& SdrGrafObj::operator=( const SdrGrafObj& rObj )
 
 sal_uInt32 SdrGrafObj::GetHdlCount() const
 {
-return 8L;
+return 8;
 }
 
 void SdrGrafObj::AddToHdlList(SdrHdlList& rHdlList) const
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index e950dc8f14e3..8ac271db2904 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -749,7 +749,7 @@ basegfx::B2DPolyPolygon SdrMeasureObj::TakeXorPoly() const
 
 sal_uInt32 SdrMeasureObj::GetHdlCount() const
 {
-return 6L;
+return 6;
 }
 
 void SdrMeasureObj::AddToHdlList(SdrHdlList& rHdlList) const
@@ -1079,7 +1079,7 @@ void SdrMeasureObj::RecalcSnapRect()
 
 sal_uInt32 SdrMeasureObj::GetSnapPointCount() const
 {
-return 2L;
+return 2;
 }
 
 Point SdrMeasureObj::GetSnapPoint(sal_uInt32 i) const
@@ -1095,7 +1095,7 @@ bool SdrMeasureObj::IsPolyObj() const
 
 sal_uInt32 SdrMeasureObj::GetPointCount() const
 {
-return 2L;
+return 2;
 }
 
 Point SdrMeasureObj::GetPoint(sal_uInt32 i) const
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 4ce65ca33f61..ef76a53b1dca 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1120,7 +1120,7 @@ void SdrTextObj::RecalcSnapRect()
 
 sal_uInt32 SdrTextObj::GetSnapPointCount() const
 {
-return 4L;
+return 4;
 }
 
 Point SdrTextObj::GetSnapPoint(sal_uInt32 i) const
diff --git a/svx/source/svdraw/svdotxdr.cxx b/svx/source/svdraw/svdotxdr.cxx
index b340340a1a3c..182f4d99f9fc 100644
--- a/svx/source/svdraw/svdotxdr.cxx
+++ b/svx/source/svdraw/svdotxdr.cxx
@@ -35,7 +35,7 @@
 
 sal_uInt32 SdrTextObj::GetHdlCount() const
 {
-return 8L;
+return 8;
 }
 
 void SdrTextObj::AddToHdlList(SdrHdlList& rHdlList) const
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index a85f4d1be5a2..c39d6787e134 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -1702,7 +1702,7 @@ std::size_t SvMemoryStream::GetData( void* pData, 
std::size_t nCount )
 std::size_t SvMemoryStream::PutData( const void* pData, std::size_t nCount )
 {
 if( GetError() )
-return 0L;
+return 0;
 
 std::size_t nMaxCount = nSize-nPos;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-06 Thread Yusuf Keten (via logerrit)
 xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c9253b9007059496521f24ef8348e80bb120e1e6
Author: Yusuf Keten 
AuthorDate: Wed Jan 1 00:27:27 2020 +0300
Commit: Stephan Bergmann 
CommitDate: Mon Jan 6 11:08:03 2020 +0100

tdf#54938 Adapt supportsService implementations to cppu::supportsService

Change-Id: I061db162c44a7196c58f4ae6dae2f37c7ac9213a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86057
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx 
b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index 1ac8d052b5c3..64caec48cce4 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include "securityenvironment_nssimpl.hxx"
+#include 
 #include 
 
 #include 
@@ -143,8 +144,7 @@ OUString SAL_CALL 
SecurityEnvironment_NssImpl::getImplementationName() {
 
 /* XServiceInfo */
 sal_Bool SAL_CALL SecurityEnvironment_NssImpl::supportsService( const 
OUString& serviceName) {
-Sequence< OUString > seqServiceNames = getSupportedServiceNames() ;
-return comphelper::findValue(seqServiceNames, serviceName) != -1;
+return cppu::supportsService(this, serviceName);
 }
 
 /* XServiceInfo */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-02 Thread Yusuf Keten (via logerrit)
 sot/source/sdstor/stgdir.cxx|2 +-
 svx/source/form/fmshimp.cxx |2 +-
 svx/source/sdr/contact/viewcontactofvirtobj.cxx |2 +-
 svx/source/svdraw/svdobj.cxx|2 +-
 svx/source/svdraw/svdocapt.cxx  |2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 9ef226c581ddf025e36aebefaa48c051354c520b
Author: Yusuf Keten 
AuthorDate: Sun Dec 29 02:52:10 2019 +0300
Commit: Mike Kaganski 
CommitDate: Thu Jan 2 19:58:48 2020 +0100

tdf#96505 Get rid of cargo cult long integer literals

Change-Id: I6b21f25738458a1d85905a3a02eb17c51a626b0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85932
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index f31488fd07c2..4002d637230d 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -478,7 +478,7 @@ sal_Int32 StgDirEntry::Write( const void* p, sal_Int32 nLen 
)
 if( nNew > m_pStgStrm->GetSize() )
 {
 if( !SetSize( nNew ) )
-return 0L;
+return 0;
 m_pStgStrm->Pos2Page( m_nPos );
 }
 nLen = m_pStgStrm->Write( p, nLen );
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 845fbf030b85..ca14eef60bd8 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -2461,7 +2461,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest_Lock, 
FmSearchContext&, rfmscCont
 rfmscContextInfo.arrFields.clear();
 rfmscContextInfo.xCursor = nullptr;
 rfmscContextInfo.strUsedFields.clear();
-return 0L;
+return 0;
 }
 
 rfmscContextInfo.xCursor = xIter;
diff --git a/svx/source/sdr/contact/viewcontactofvirtobj.cxx 
b/svx/source/sdr/contact/viewcontactofvirtobj.cxx
index c78670aa03fb..4efb3d65797d 100644
--- a/svx/source/sdr/contact/viewcontactofvirtobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofvirtobj.cxx
@@ -56,7 +56,7 @@ sal_uInt32 ViewContactOfVirtObj::GetObjectCount() const
 
 // As can be seen, with primitives, the problem will be solved using
 // a transformPrimitive, so this solution can stay with primitives.
-return 0L;
+return 0;
 }
 
 drawinglayer::primitive2d::Primitive2DContainer 
ViewContactOfVirtObj::createViewIndependentPrimitive2DSequence() const
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 76338b2a144e..db6238c704ba 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1691,7 +1691,7 @@ bool SdrObject::IsPolyObj() const
 
 sal_uInt32 SdrObject::GetPointCount() const
 {
-return 0L;
+return 0;
 }
 
 Point SdrObject::GetPoint(sal_uInt32 /*i*/) const
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index 81b34988f0bc..dc7bdaf3aa4d 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -654,7 +654,7 @@ void SdrCaptionObj::NbcSetTailPos(const Point& rPos)
 sal_uInt32 SdrCaptionObj::GetSnapPointCount() const
 {
 // TODO: Implementation missing.
-return 0L;
+return 0;
 }
 
 Point SdrCaptionObj::GetSnapPoint(sal_uInt32 /*i*/) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2019-12-31 Thread Yusuf Keten (via logerrit)
 svx/source/gallery2/galbrws1.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b5b68303b17e88163ec6fc946c7908492b554498
Author: Yusuf Keten 
AuthorDate: Tue Dec 31 21:19:05 2019 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jan 1 07:40:17 2020 +0100

tdf#75280 Convert inappropriate use of sal_uIntPtr to better integer types

Change-Id: I5a1bbbc677f41fec342484b5244a32ce3a624bd8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86049
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index 796586ebb995..8a435a5c31df 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -135,7 +135,7 @@ GalleryBrowser1::GalleryBrowser1(
 mpThemes->SetSelectHdl( LINK( this, GalleryBrowser1, SelectThemeHdl ) );
 mpThemes->SetAccessibleName(SvxResId(RID_SVXSTR_GALLERYPROPS_GALTHEME));
 
-for( sal_uInt64 i = 0, nCount = mpGallery->GetThemeCount(); i < nCount; 
i++ )
+for( size_t i = 0, nCount = mpGallery->GetThemeCount(); i < nCount; i++ )
 ImplInsertThemeEntry( mpGallery->GetThemeInfo( i ) );
 
 ImplAdjustControls();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2019-12-18 Thread Yusuf Keten (via logerrit)
 cppcanvas/source/inc/action.hxx  |5 +
 cppcanvas/source/inc/canvasgraphichelper.hxx |5 +
 cppcanvas/source/inc/implrenderer.hxx|5 +
 cppcanvas/source/inc/outdevstate.hxx |5 +
 cppcanvas/source/inc/tools.hxx   |5 +
 5 files changed, 5 insertions(+), 20 deletions(-)

New commits:
commit 583c1c34ae9c974f68d21ee6b74baf87ab08c6cf
Author: Yusuf Keten 
AuthorDate: Wed Dec 18 22:13:49 2019 +0300
Commit: Muhammet Kara 
CommitDate: Thu Dec 19 04:40:17 2019 +0100

tdf#124176: Use pragma once instead of include guards

Change-Id: Id65f17c9785e9db3eecfb1fba6902a04906077e5
Reviewed-on: https://gerrit.libreoffice.org/85428
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cppcanvas/source/inc/action.hxx b/cppcanvas/source/inc/action.hxx
index 67e67c5aa4dd..bf122292a2fd 100644
--- a/cppcanvas/source/inc/action.hxx
+++ b/cppcanvas/source/inc/action.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CPPCANVAS_SOURCE_INC_ACTION_HXX
-#define INCLUDED_CPPCANVAS_SOURCE_INC_ACTION_HXX
+#pragma once
 
 #include 
 
@@ -146,6 +145,4 @@ namespace cppcanvas
 }
 }
 
-#endif // INCLUDED_CPPCANVAS_SOURCE_INC_ACTION_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppcanvas/source/inc/canvasgraphichelper.hxx 
b/cppcanvas/source/inc/canvasgraphichelper.hxx
index 48e0b9c35cd2..c1c23657a3f4 100644
--- a/cppcanvas/source/inc/canvasgraphichelper.hxx
+++ b/cppcanvas/source/inc/canvasgraphichelper.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CPPCANVAS_SOURCE_INC_CANVASGRAPHICHELPER_HXX
-#define INCLUDED_CPPCANVAS_SOURCE_INC_CANVASGRAPHICHELPER_HXX
+#pragma once
 
 #include 
 #include 
@@ -69,6 +68,4 @@ namespace cppcanvas
 }
 }
 
-#endif // INCLUDED_CPPCANVAS_SOURCE_INC_CANVASGRAPHICHELPER_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppcanvas/source/inc/implrenderer.hxx 
b/cppcanvas/source/inc/implrenderer.hxx
index c1224a40c212..6c260c3f3ecd 100644
--- a/cppcanvas/source/inc/implrenderer.hxx
+++ b/cppcanvas/source/inc/implrenderer.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CPPCANVAS_SOURCE_INC_IMPLRENDERER_HXX
-#define INCLUDED_CPPCANVAS_SOURCE_INC_IMPLRENDERER_HXX
+#pragma once
 
 #include 
 
@@ -245,6 +244,4 @@ namespace cppcanvas
 }
 }
 
-#endif // INCLUDED_CPPCANVAS_SOURCE_INC_IMPLRENDERER_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppcanvas/source/inc/outdevstate.hxx 
b/cppcanvas/source/inc/outdevstate.hxx
index 5c1a4c0d9166..590a7b2ec674 100644
--- a/cppcanvas/source/inc/outdevstate.hxx
+++ b/cppcanvas/source/inc/outdevstate.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CPPCANVAS_SOURCE_INC_OUTDEVSTATE_HXX
-#define INCLUDED_CPPCANVAS_SOURCE_INC_OUTDEVSTATE_HXX
+#pragma once
 
 #include 
 #include 
@@ -124,6 +123,4 @@ namespace cppcanvas
 }
 }
 
-#endif // INCLUDED_CPPCANVAS_SOURCE_INC_OUTDEVSTATE_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppcanvas/source/inc/tools.hxx b/cppcanvas/source/inc/tools.hxx
index 80a238881790..fab00805a93e 100644
--- a/cppcanvas/source/inc/tools.hxx
+++ b/cppcanvas/source/inc/tools.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CPPCANVAS_SOURCE_INC_TOOLS_HXX
-#define INCLUDED_CPPCANVAS_SOURCE_INC_TOOLS_HXX
+#pragma once
 
 #include 
 #include 
@@ -33,6 +32,4 @@ namespace cppcanvas
 }
 }
 
-#endif // INCLUDED_CPPCANVAS_SOURCE_INC_TOOLS_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2019-12-18 Thread Yusuf Keten (via logerrit)
 cui/source/dialogs/SpellAttrib.hxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit eb57eb632c715bb32d94f5988b295bb766ad0c57
Author: Yusuf Keten 
AuthorDate: Wed Dec 18 20:00:26 2019 +0300
Commit: Muhammet Kara 
CommitDate: Wed Dec 18 21:21:12 2019 +0100

tdf#124176:  Use pragma once instead of include guards

Change-Id: I1f6d66a0d4a06338671579e9be2dbdc5cd673d50
Reviewed-on: https://gerrit.libreoffice.org/85411
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/cui/source/dialogs/SpellAttrib.hxx 
b/cui/source/dialogs/SpellAttrib.hxx
index 26921b666e82..c086fe3d086a 100644
--- a/cui/source/dialogs/SpellAttrib.hxx
+++ b/cui/source/dialogs/SpellAttrib.hxx
@@ -16,8 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_CUI_SOURCE_DIALOGS_SPELLATTRIB_HXX
-#define INCLUDED_CUI_SOURCE_DIALOGS_SPELLATTRIB_HXX
+#pragma once
 
 #include 
 #include 
@@ -115,6 +114,5 @@ struct SpellErrorDescription
 };
 
 }//namespace svx
-#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits