[Libreoffice-commits] dev-tools.git: esc-reporting/esc-collect.py

2017-05-16 Thread jan Iversen
 esc-reporting/esc-collect.py |   23 ---
 1 file changed, 12 insertions(+), 11 deletions(-)

New commits:
commit e5c2d3d87af00bcfaa685a4af96784463ba6670e
Author: jan Iversen 
Date:   Wed May 17 07:36:06 2017 +0200

esc-report, collect committer list using ssh (new format)

diff --git a/esc-reporting/esc-collect.py b/esc-reporting/esc-collect.py
index 6931773..af44973 100755
--- a/esc-reporting/esc-collect.py
+++ b/esc-reporting/esc-collect.py
@@ -562,18 +562,19 @@ def get_gerrit(cfg):
 searchDate, rawList = util_load_data_file(cfg, fileName, 'gerrit', 
{'patch': {}, 'committers' : []})
 print("Updating gerrit dump from " + rawList['newest-entry'])
 
-urlBase = 'https://gerrit.libreoffice.org/'
-uid = cfg['gerrit']['user']
-upw = cfg['gerrit']['password']
 rawList['committers'] = []
-tmp = util_load_url(urlBase + 'a/groups/Committers/members', uUser=uid, 
uPass=upw)
-for row in tmp:
-  for i in 'username', 'email':
-if not i in row:
-  row[i] = '*dummy*'
-  rawList['committers'].append(row)
-
-url = urlBase + 'changes/?q=after:' + searchDate.strftime("%Y-%m-%d") + \
+os.system('ssh gerrit.libreoffice.org "gerrit ls-members Committers" > 
/tmp/committerList')
+fp = open('/tmp/committerList', encoding='utf-8')
+tmp = fp.read().split('\n')[1:-1]
+fp.close()
+for line in tmp:
+  row = line.split('\t')
+  rawList['committers'].append({"_account_id": int(row[0]),
+"email": row[3],
+"name": row[2],
+"username": row[1]})
+
+url = 'https://gerrit.libreoffice.org/changes/?q=after:' + 
searchDate.strftime("%Y-%m-%d") + \
  '&o=DETAILED_LABELS&o=DETAILED_ACCOUNTS&o=MESSAGES&limit=200&start='
 offset = 0
 if 'offset' in rawList:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: wsd/ClientSession.cpp

2017-05-16 Thread Pranav Kant
 wsd/ClientSession.cpp |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 1449d81671ff9563bd494526b4316fc0d6a8d893
Author: Pranav Kant 
Date:   Wed May 17 10:29:53 2017 +0530

wsd: Don't filter out 'save' command

Fallback from 1cb75cbcb8c87481bf341c5ac058a36c13529dc8

Change-Id: I47c8a470e5f4ab4d48859365d4435ae79c5fa82d

diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 8ce4c327..479bc2b9 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -133,6 +133,7 @@ bool ClientSession::_handleInput(const char *buffer, int 
length)
  tokens[0] != "renderfont" &&
  tokens[0] != "requestloksession" &&
  tokens[0] != "resetselection" &&
+ tokens[0] != "save" &&
  tokens[0] != "saveas" &&
  tokens[0] != "selectgraphic" &&
  tokens[0] != "selecttext" &&
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - include/xmloff sc/inc sc/source sc/uiconfig xmloff/source

2017-05-16 Thread Kohei Yoshida
 include/xmloff/xmltoken.hxx |4 +
 sc/inc/document.hxx |3 +
 sc/inc/global.hxx   |   15 +
 sc/inc/table.hxx|2 
 sc/source/core/data/document10.cxx  |   23 
 sc/source/core/data/table7.cxx  |   82 
 sc/source/filter/xml/xmlexprt.cxx   |   10 +++
 sc/source/filter/xml/xmlimprt.cxx   |4 +
 sc/source/filter/xml/xmlimprt.hxx   |6 +-
 sc/source/filter/xml/xmlsubti.cxx   |   10 +++
 sc/source/filter/xml/xmlsubti.hxx   |4 +
 sc/source/filter/xml/xmltabi.cxx|   24 -
 sc/source/ui/docshell/docfunc.cxx   |   46 +
 sc/source/ui/docshell/editable.cxx  |   22 
 sc/source/ui/inc/editable.hxx   |   14 +
 sc/source/ui/inc/protectiondlg.hxx  |4 +
 sc/source/ui/miscdlgs/protectiondlg.cxx |   24 +++--
 sc/source/ui/view/cellsh.cxx|   26 ++
 sc/uiconfig/scalc/ui/protectsheetdlg.ui |   48 ++
 xmloff/source/core/xmltoken.cxx |4 +
 xmloff/source/token/tokens.txt  |4 +
 21 files changed, 369 insertions(+), 10 deletions(-)

New commits:
commit 720560335c2e3a8e72026d87d8d5f0056f4df188
Author: Kohei Yoshida 
Date:   Thu May 11 18:07:56 2017 -0400

tdf#43535: support additional sheet protection options.

New options are:

* insert columns.
* insert rows.
* delete columns.
* delete rows.

Change-Id: I076b0d01bee0fff0623e2f1137c09938a6110939
Reviewed-on: https://gerrit.libreoffice.org/37695
Tested-by: Jenkins 
Reviewed-by: Kohei Yoshida 
(cherry picked from commit 034be10413ed4915090678ad4f1d48596cf5e206)

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 1698737e6605..59f27f32f5c4 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -600,6 +600,8 @@ namespace xmloff { namespace token {
 XML_DEFAULT_STYLE_NAME,
 XML_DEGREE,
 XML_DELAY,
+XML_DELETE_COLUMNS,
+XML_DELETE_ROWS,
 XML_DELETION,
 XML_DELETIONS,
 XML_DENOMALIGN,
@@ -1031,6 +1033,8 @@ namespace xmloff { namespace token {
 XML_INFORMATION,
 XML_INITIAL_CREATOR,
 XML_INPROCEEDINGS,
+XML_INSERT_COLUMNS,
+XML_INSERT_ROWS,
 XML_INSERTION,
 XML_INSERTION_CUT_OFF,
 XML_INSERTION_POSITION,
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 5e4336019fb1..bd9313346ecc 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -782,6 +782,9 @@ public:
 SCCOL nEndCol, SCROW nEndRow,
 const ScMarkData& rMark ) const;
 
+bool IsEditActionAllowed( sc::ColRowEditAction eAction, SCTAB nTab, 
SCCOLROW nStart, SCCOLROW nEnd ) const;
+bool IsEditActionAllowed( sc::ColRowEditAction eAction, const ScMarkData& 
rMark, SCCOLROW nStart, SCCOLROW nEnd ) const;
+
 SC_DLLPUBLIC bool GetMatrixFormulaRange( const ScAddress& rCellPos, 
ScRange& rMatrix );
 
 boolIsEmbedded() const { return bIsEmbedded;}
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 429a867709df..78ea62923445 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -431,6 +431,21 @@ enum ScDBObject
 ScDbQuery
 };
 
+namespace sc {
+
+enum class ColRowEditAction
+{
+Unknown,
+InsertColumnsBefore,
+InsertColumnsAfter,
+InsertRowsBefore,
+InsertRowsAfter,
+DeleteColumns,
+DeleteRows
+};
+
+}
+
 struct ScImportParam
 {
 SCCOL   nCol1;
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 26a729227829..9b2219eda8c2 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -321,6 +321,8 @@ public:
 voidSetProtection(const ScTableProtection* pProtect);
 ScTableProtection* GetProtection();
 
+bool IsEditActionAllowed( sc::ColRowEditAction eAction, SCCOLROW nStart, 
SCCOLROW nEnd ) const;
+
 SizeGetPageSize() const;
 voidSetPageSize( const Size& rSize );
 voidSetRepeatArea( SCCOL nStartCol, SCCOL nEndCol, SCROW 
nStartRow, SCROW nEndRow );
diff --git a/sc/source/core/data/document10.cxx 
b/sc/source/core/data/document10.cxx
index 7b6ce1cc4a7a..35632d44536f 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -880,4 +880,27 @@ bool ScDocument::CopyAdjustRangeName( SCTAB& rSheet, 
sal_uInt16& rIndex, ScRange
 return true;
 }
 
+bool ScDocument::IsEditActionAllowed(
+sc::ColRowEditAction eAction, SCTAB nTab, SCCOLROW nStart, SCCOLROW nEnd ) 
const
+{
+const ScTable* pTab = FetchTable(nTab);
+if (!pTab)
+return false;
+
+return pTab->IsEditActionAllowed(eAction, nStart, nEnd);
+}
+
+bool ScDocument::IsEditActionAllowed(
+sc::ColRowEditAction eAction, const ScMarkData& rMark, SCCOLROW nStart, 
SCCOLROW 

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

2017-05-16 Thread Kohei Yoshida
 sc/qa/unit/ucalc.cxx |  153 +++
 sc/qa/unit/ucalc.hxx |4 +
 2 files changed, 157 insertions(+)

New commits:
commit 7ae50f522f94987afe85674f6691fc37c55bd3d1
Author: Kohei Yoshida 
Date:   Mon May 15 22:36:08 2017 -0400

tdf#43535: add unit test for this.

Change-Id: I4e6b27f82d1344ac77b02867e1e717c510a133b6
Reviewed-on: https://gerrit.libreoffice.org/37696
Tested-by: Jenkins 
Reviewed-by: Kohei Yoshida 

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index f573cc8d8d86..3f6a38820abc 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -68,6 +68,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -6949,6 +6950,158 @@ void Test::testPrecisionAsShown()
 m_pDoc->DeleteTab(0);
 }
 
+void Test::testProtectedSheetEditByRow()
+{
+ScDocFunc& rDocFunc = getDocShell().GetDocFunc();
+m_pDoc->InsertTab(0, "Protected");
+
+{
+// Remove protected flags from rows 2-5.
+ScPatternAttr aAttr(m_pDoc->GetPool());
+aAttr.GetItemSet().Put(ScProtectionAttr(false));
+m_pDoc->ApplyPatternAreaTab(0, 1, MAXCOL, 4, 0, aAttr);
+
+// Protect the sheet without any options.
+ScTableProtection aProtect;
+aProtect.setProtected(true);
+m_pDoc->SetTabProtection(0, &aProtect);
+
+// Try to delete row 3.  It should fail.
+ScRange aRow3(0,2,0,MAXCOL,2,0);
+ScMarkData aMark;
+aMark.SelectOneTable(0);
+bool bDeleted = rDocFunc.DeleteCells(aRow3, &aMark, DEL_DELROWS, true);
+CPPUNIT_ASSERT_MESSAGE("deletion of row 3 should fail.", !bDeleted);
+
+// Protect the sheet but allow row deletion.
+aProtect.setOption(ScTableProtection::DELETE_ROWS, true);
+m_pDoc->SetTabProtection(0, &aProtect);
+
+// Now we should be able to delete row 3.
+bDeleted = rDocFunc.DeleteCells(aRow3, &aMark, DEL_DELROWS, true);
+CPPUNIT_ASSERT_MESSAGE("deletion of row 3 should succeed.", bDeleted);
+
+// But, row deletion should still fail on a protected row.
+ScRange aRow10(0,9,0,MAXCOL,9,0);
+bDeleted = rDocFunc.DeleteCells(aRow10, &aMark, DEL_DELROWS, true);
+CPPUNIT_ASSERT_MESSAGE("deletion of row 10 should not be allowed.", 
!bDeleted);
+
+// Try inserting a new row.  It should fail.
+bool bInserted = rDocFunc.InsertCells(aRow3, &aMark, 
INS_INSROWS_AFTER, true, true);
+CPPUNIT_ASSERT_MESSAGE("row insertion at row 3 should fail.", 
!bInserted);
+
+// Allow row insertions.
+aProtect.setOption(ScTableProtection::INSERT_ROWS, true);
+m_pDoc->SetTabProtection(0, &aProtect);
+
+bInserted = rDocFunc.InsertCells(aRow3, &aMark, INS_INSROWS_AFTER, 
true, true);
+CPPUNIT_ASSERT_MESSAGE("row insertion at row 3 should succeed.", 
bInserted);
+
+// Row insertion is allowed even when the rows above and below have 
protected flags set.
+bInserted = rDocFunc.InsertCells(aRow10, &aMark, INS_INSROWS_AFTER, 
true, true);
+CPPUNIT_ASSERT_MESSAGE("row insertion at row 10 should succeed.", 
bInserted);
+}
+
+m_pDoc->InsertTab(1, "Matrix"); // This sheet is unprotected.
+
+{
+// Insert matrix into B2:C3.
+ScMarkData aMark;
+aMark.SelectOneTable(1);
+m_pDoc->InsertMatrixFormula(1, 1, 2, 2, aMark, "={1;2|3;4}");
+
+CPPUNIT_ASSERT_EQUAL(1.0, m_pDoc->GetValue(ScAddress(1,1,1)));
+CPPUNIT_ASSERT_EQUAL(2.0, m_pDoc->GetValue(ScAddress(2,1,1)));
+CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(1,2,1)));
+CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(ScAddress(2,2,1)));
+
+// Try to insert a row at row 3.  It should fail because of matrix's 
presence.
+
+ScRange aRow3(0,2,1,MAXCOL,2,1);
+bool bInserted = rDocFunc.InsertCells(aRow3, &aMark, 
INS_INSROWS_BEFORE, true, true);
+CPPUNIT_ASSERT_MESSAGE("row insertion at row 3 should fail.", 
!bInserted);
+}
+
+m_pDoc->DeleteTab(1);
+m_pDoc->DeleteTab(0);
+}
+
+void Test::testProtectedSheetEditByColumn()
+{
+ScDocFunc& rDocFunc = getDocShell().GetDocFunc();
+m_pDoc->InsertTab(0, "Protected");
+
+{
+// Remove protected flags from columns B to E.
+ScPatternAttr aAttr(m_pDoc->GetPool());
+aAttr.GetItemSet().Put(ScProtectionAttr(false));
+m_pDoc->ApplyPatternAreaTab(1, 0, 4, MAXROW, 0, aAttr);
+
+// Protect the sheet without any options.
+ScTableProtection aProtect;
+aProtect.setProtected(true);
+m_pDoc->SetTabProtection(0, &aProtect);
+
+// Try to delete column C.  It should fail.
+ScRange aCol3(2,0,0,2,MAXROW,0);
+ScMarkData aMark;
+aMark.SelectOneTable(0);
+bool bDeleted = rDocFunc.DeleteCells(aCol3, &aMark, DEL_DELCOLS, true);
+CPPUNIT_ASSERT_MESSAGE("deletion of column 3 should fail.", !bDeleted);
+
+// Protec

[Libreoffice-commits] core.git: include/xmloff sc/inc sc/source sc/uiconfig xmloff/source

2017-05-16 Thread Kohei Yoshida
 include/xmloff/xmltoken.hxx |4 +
 sc/inc/document.hxx |3 +
 sc/inc/global.hxx   |   15 +
 sc/inc/table.hxx|2 
 sc/source/core/data/document10.cxx  |   23 
 sc/source/core/data/table7.cxx  |   82 
 sc/source/filter/xml/xmlexprt.cxx   |   10 +++
 sc/source/filter/xml/xmlimprt.cxx   |4 +
 sc/source/filter/xml/xmlimprt.hxx   |6 +-
 sc/source/filter/xml/xmlsubti.cxx   |   10 +++
 sc/source/filter/xml/xmlsubti.hxx   |4 +
 sc/source/filter/xml/xmltabi.cxx|   24 -
 sc/source/ui/docshell/docfunc.cxx   |   46 +
 sc/source/ui/docshell/editable.cxx  |   22 
 sc/source/ui/inc/editable.hxx   |   14 +
 sc/source/ui/inc/protectiondlg.hxx  |4 +
 sc/source/ui/miscdlgs/protectiondlg.cxx |   24 +++--
 sc/source/ui/view/cellsh.cxx|   26 ++
 sc/uiconfig/scalc/ui/protectsheetdlg.ui |   48 ++
 xmloff/source/core/xmltoken.cxx |4 +
 xmloff/source/token/tokens.txt  |4 +
 21 files changed, 369 insertions(+), 10 deletions(-)

New commits:
commit 034be10413ed4915090678ad4f1d48596cf5e206
Author: Kohei Yoshida 
Date:   Thu May 11 18:07:56 2017 -0400

tdf#43535: support additional sheet protection options.

New options are:

* insert columns.
* insert rows.
* delete columns.
* delete rows.

Change-Id: I076b0d01bee0fff0623e2f1137c09938a6110939
Reviewed-on: https://gerrit.libreoffice.org/37695
Tested-by: Jenkins 
Reviewed-by: Kohei Yoshida 

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 9ab65abfd195..d746ae78c5d0 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -605,6 +605,8 @@ namespace xmloff { namespace token {
 XML_DEFAULT_STYLE_NAME,
 XML_DEGREE,
 XML_DELAY,
+XML_DELETE_COLUMNS,
+XML_DELETE_ROWS,
 XML_DELETION,
 XML_DELETIONS,
 XML_DENOMALIGN,
@@ -1037,6 +1039,8 @@ namespace xmloff { namespace token {
 XML_INFORMATION,
 XML_INITIAL_CREATOR,
 XML_INPROCEEDINGS,
+XML_INSERT_COLUMNS,
+XML_INSERT_ROWS,
 XML_INSERTION,
 XML_INSERTION_CUT_OFF,
 XML_INSERTION_POSITION,
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 2c0f1318fc63..87c89958acf2 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -791,6 +791,9 @@ public:
 SCCOL nEndCol, SCROW 
nEndRow,
 const ScMarkData& rMark ) 
const;
 
+bool IsEditActionAllowed( sc::ColRowEditAction eAction, SCTAB nTab, 
SCCOLROW nStart, SCCOLROW nEnd ) const;
+bool IsEditActionAllowed( sc::ColRowEditAction eAction, const ScMarkData& 
rMark, SCCOLROW nStart, SCCOLROW nEnd ) const;
+
 SC_DLLPUBLIC bool GetMatrixFormulaRange( const ScAddress& rCellPos, 
ScRange& rMatrix );
 
 boolIsEmbedded() const { return bIsEmbedded;}
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 1c67775099cb..7219b9bd2a04 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -428,6 +428,21 @@ enum ScDBObject
 ScDbQuery
 };
 
+namespace sc {
+
+enum class ColRowEditAction
+{
+Unknown,
+InsertColumnsBefore,
+InsertColumnsAfter,
+InsertRowsBefore,
+InsertRowsAfter,
+DeleteColumns,
+DeleteRows
+};
+
+}
+
 struct ScImportParam
 {
 SCCOL   nCol1;
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 87ba9c6df206..c5941b0a085f 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -350,6 +350,8 @@ public:
 voidSetProtection(const ScTableProtection* pProtect);
 ScTableProtection* GetProtection();
 
+bool IsEditActionAllowed( sc::ColRowEditAction eAction, SCCOLROW nStart, 
SCCOLROW nEnd ) const;
+
 SizeGetPageSize() const;
 voidSetPageSize( const Size& rSize );
 voidSetRepeatArea( SCCOL nStartCol, SCCOL nEndCol, SCROW 
nStartRow, SCROW nEndRow );
diff --git a/sc/source/core/data/document10.cxx 
b/sc/source/core/data/document10.cxx
index 161729063e4b..1273a17bc87f 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -881,4 +881,27 @@ bool ScDocument::CopyAdjustRangeName( SCTAB& rSheet, 
sal_uInt16& rIndex, ScRange
 return true;
 }
 
+bool ScDocument::IsEditActionAllowed(
+sc::ColRowEditAction eAction, SCTAB nTab, SCCOLROW nStart, SCCOLROW nEnd ) 
const
+{
+const ScTable* pTab = FetchTable(nTab);
+if (!pTab)
+return false;
+
+return pTab->IsEditActionAllowed(eAction, nStart, nEnd);
+}
+
+bool ScDocument::IsEditActionAllowed(
+sc::ColRowEditAction eAction, const ScMarkData& rMark, SCCOLROW nStart, 
SCCOLROW nEnd ) const
+{
+ScMarkData::const_iterator it = rM

[Libreoffice-commits] online.git: wsd/ClientSession.cpp wsd/DocumentBroker.cpp wsd/DocumentBroker.hpp wsd/Storage.cpp wsd/Storage.hpp

2017-05-16 Thread Ashod Nakashian
 wsd/ClientSession.cpp  |1 
 wsd/DocumentBroker.cpp |   19 +
 wsd/DocumentBroker.hpp |1 
 wsd/Storage.cpp|   46 ---
 wsd/Storage.hpp|   52 +
 5 files changed, 98 insertions(+), 21 deletions(-)

New commits:
commit ec2fd0844f997f9a7347229e282daeb8dc4471bc
Author: Ashod Nakashian 
Date:   Tue May 16 16:38:44 2017 -0400

wsd: use WOPI host instance ID to support hostname aliases

The docKey creation moved to Storage where we first
invoke WOPI (if/when it's a WOPI-hosted doc and WOPI enabled)
and see if the user has access to the document at all.
If they do, we expect the server to give us a
unique ID to use for identifying the host regardless
of hostname aliases.

If a unique ID is not returned (i.e. empty or missing)
we use the hostname and port in its place as fallback.
This will break hostname aliases, but it will still work.

Change-Id: I407b0087395f9df6ad9cc6e037570487999be4a4
Reviewed-on: https://gerrit.libreoffice.org/37697
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 5a0af025..8ce4c327 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -736,7 +736,6 @@ bool ClientSession::forwardToClient(const 
std::shared_ptr& payload)
 
 std::string ClientSession::getAccessToken() const
 {
-std::string accessToken;
 Poco::URI::QueryParameters queryParams = _uriPublic.getQueryParameters();
 for (auto& param: queryParams)
 {
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index e5924f87..66a5de80 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -102,15 +102,7 @@ Poco::URI DocumentBroker::sanitizeURI(const std::string& 
uri)
 
 std::string DocumentBroker::getDocKey(const Poco::URI& uri)
 {
-// If multiple host-names are used to access us, then
-// we force same document (when opened from
-// alias hosts) to load as separate documents and sharing doesn't
-// work. Worse, saving overwrites one another.
-// But we also do not want different WOPI hosts using the same path
-// for some file getting shared across WOPI hosts
-std::string docKey;
-Poco::URI::encode(uri.getHost() + ":" + std::to_string(uri.getPort()) + 
uri.getPath(), "", docKey);
-return docKey;
+return StorageBase::getUniqueDocId(uri);
 }
 
 /// The Document Broker Poll - one of these in a thread per document
@@ -409,6 +401,7 @@ bool DocumentBroker::load(const 
std::shared_ptr& session, const s
 LOG_ERR("Failed to create Storage instance for [" << _docKey << "] 
in " << jailPath.toString());
 return false;
 }
+
 firstInstance = true;
 }
 
@@ -423,6 +416,14 @@ bool DocumentBroker::load(const 
std::shared_ptr& session, const s
 std::unique_ptr wopifileinfo = 
wopiStorage->getWOPIFileInfo(session->getAccessToken());
 userid = wopifileinfo->_userid;
 username = wopifileinfo->_username;
+if (firstInstance)
+{
+_hostInstanceId = wopifileinfo->_hostInstanceId;
+}
+else if (!_hostInstanceId.empty() && _hostInstanceId != 
wopifileinfo->_hostInstanceId)
+{
+throw UnauthorizedRequestException("Unauthorized WOPI host.");
+}
 
 if (!wopifileinfo->_userCanWrite)
 {
diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index 46481cba..8ac67ee2 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/DocumentBroker.hpp
@@ -369,6 +369,7 @@ private:
 Poco::URI _uriJailed;
 std::string _jailId;
 std::string _filename;
+std::string _hostInstanceId;
 
 /// The last time we tried saving, regardless of whether the
 /// document was modified and saved or not.
diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp
index e07ffd55..bdaeab56 100644
--- a/wsd/Storage.cpp
+++ b/wsd/Storage.cpp
@@ -124,7 +124,7 @@ void StorageBase::initialize()
 #endif
 }
 
-bool isLocalhost(const std::string& targetHost)
+bool StorageBase::isLocalhost(const std::string& targetHost)
 {
 std::string targetAddress;
 try
@@ -201,7 +201,7 @@ std::unique_ptr StorageBase::create(const 
Poco::URI& uri, const std
 {
 LOG_INF("Public URI [" << uri.toString() << "] considered WOPI.");
 const auto& targetHost = uri.getHost();
-if (WopiHosts.match(targetHost) || isLocalhost(targetHost))
+if (isWopiHostAuthorized(targetHost))
 {
 return std::unique_ptr(new WopiStorage(uri, jailRoot, 
jailPath));
 }
@@ -212,6 +212,39 @@ std::unique_ptr StorageBase::create(const 
Poco::URI& uri, const std
 throw BadRequestException("No Storage configured or invalid URI.");
 }
 
+std::string StorageBase::getUniqueDocId(const Poco::URI& uri)
+{
+std::string docId;
+if (uri.isRelative() || uri.getScheme() == "file")
+{

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

2017-05-16 Thread Julien Nabet
 filter/source/xslt/odf2xhtml/export/xhtml/body.xsl |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 296c2296f5565556eea9fab51563050f28bbcafc
Author: Julien Nabet 
Date:   Wed May 17 00:13:18 2017 +0200

Related tdf#107696: deal with non empty header without number

See first case of 
https://bugs.documentfoundation.org/show_bug.cgi?id=107696#c11

Change-Id: Ic76301cb10ae891901be7dd5a385356c1cc0523b
Reviewed-on: https://gerrit.libreoffice.org/37694
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl 
b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index 03d4a8fce087..823d048254c5 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -1222,7 +1222,7 @@



-   
+   
 

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


[Libreoffice-commits] help.git: Changes to 'refs/tags/cp-5.3-12'

2017-05-16 Thread Andras Timar
Tag 'cp-5.3-12' created by Andras Timar  at 
2017-05-16 22:13 +

cp-5.3-12

Changes since libreoffice-5-3-branch-point-28:
---
 0 files changed
---
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] translations.git: Changes to 'refs/tags/cp-5.3-12'

2017-05-16 Thread Christian Lohmaier
Tag 'cp-5.3-12' created by Andras Timar  at 
2017-05-16 22:13 +

cp-5.3-12

Changes since cp-5.3-10:
Christian Lohmaier (1):
  update translations for 5.3.3 rc2

---
 source/am/cui/source/options.po|8 
 source/am/cui/source/tabpages.po   |8 
 source/am/cui/uiconfig/ui.po   |8 
 source/am/fpicker/source/office.po |   10 
 source/am/officecfg/registry/data/org/openoffice/Office.po |6 
 source/am/sc/source/ui/src.po  |8 
 source/am/sfx2/source/dialog.po|   12 
 source/am/svtools/source/dialogs.po|8 
 source/am/svtools/source/misc.po   |8 
 source/am/svx/source/stbctrls.po   |8 
 source/am/svx/uiconfig/ui.po   |   10 
 source/bg/sc/uiconfig/scalc/ui.po  |   20 
 source/bg/sfx2/source/dialog.po|   12 
 source/bg/svx/source/dialog.po |   30 
 source/bg/svx/source/form.po   |   10 
 source/bg/svx/source/stbctrls.po   |8 
 source/bg/svx/source/tbxctrls.po   |6 
 source/bg/svx/uiconfig/ui.po   |  289 
 source/bg/sw/source/ui/utlui.po|   21 
 source/bg/sw/source/uibase/utlui.po|6 
 source/bg/sw/uiconfig/swriter/ui.po|5 
 source/br/cui/uiconfig/ui.po   |   70 -
 source/br/extensions/source/bibliography.po|   12 
 source/br/extensions/source/propctrlr.po   |  152 ++--
 source/br/sc/source/ui/src.po  |   12 
 source/ca/helpcontent2/source/text/scalc/00.po |   20 
 source/ca/helpcontent2/source/text/scalc/01.po |8 
 source/ca/helpcontent2/source/text/scalc/guide.po  |   10 
 source/ca/helpcontent2/source/text/shared/01.po|6 
 source/ca/helpcontent2/source/text/shared/guide.po |5 
 source/ca/helpcontent2/source/text/shared/optionen.po  |8 
 source/ca/helpcontent2/source/text/simpress/guide.po   |   10 
 source/ca/helpcontent2/source/text/swriter/01.po   |   13 
 source/ca/helpcontent2/source/text/swriter/guide.po|   25 
 source/ca/officecfg/registry/data/org/openoffice/Office/UI.po  |8 
 source/ca/sc/uiconfig/scalc/ui.po  |6 
 source/ca/svx/uiconfig/ui.po   |   12 
 source/cy/cui/uiconfig/ui.po   |8 
 source/cy/sfx2/source/dialog.po|   12 
 source/cy/sfx2/uiconfig/ui.po  |   15 
 source/cy/svtools/source/dialogs.po|8 
 source/cy/svtools/source/misc.po   |8 
 source/cy/svx/source/stbctrls.po   |   10 
 source/cy/svx/uiconfig/ui.po   |   10 
 source/da/cui/uiconfig/ui.po   |8 
 source/da/helpcontent2/source/text/scalc/01.po |   12 
 source/da/sfx2/source/dialog.po|   14 
 source/da/sfx2/uiconfig/ui.po  |   17 
 source/da/svtools/source/dialogs.po|   10 
 source/da/svtools/source/java.po   |   12 
 source/da/svtools/source/misc.po   |   10 
 source/da/svx/source/stbctrls.po   |8 
 source/da/svx/uiconfig/ui.po   |   12 
 source/de/editeng/source/items.po  |   10 
 source/de/formula/source/core/resource.po  |8 
 source/de/helpcontent2/source/auxiliary.po |6 
 source/de/helpcontent2/source/text/sbasic/shared/01.po |   10 
 source/de/helpcontent2/source/text/scalc.po|6 
 source/de/helpcontent2/source/text/scalc/00.po |6 
 source/de/helpcontent2/source/text/scalc/01.po |  100 +-
 source/de/helpcontent2/source/text/scalc/guide.po  |   34 
 source/de/helpcontent2/source/text/schart/01.po|6 
 source/de/helpcontent2/source/text/shared/00.po|   10 
 source/de/helpcontent2/source/text/shared/01.po|   12 
 source/de/helpcontent2/source/text/shared/explorer/database.po |8 
 source/de/helpcontent2/source/text/shared/guide.po |   16 
 source/de/helpcontent2/source/text/shared/optionen.po

[Libreoffice-commits] core.git: Changes to 'refs/tags/cp-5.3-12'

2017-05-16 Thread Jan Holesovsky
Tag 'cp-5.3-12' created by Andras Timar  at 
2017-05-16 22:13 +

cp-5.3-12

Changes since cp-5.3-11-77:
---
 0 files changed
---
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] dictionaries.git: Changes to 'refs/tags/cp-5.3-12'

2017-05-16 Thread Olivier R
Tag 'cp-5.3-12' created by Andras Timar  at 
2017-05-16 22:13 +

cp-5.3-12

Changes since cp-5.3-10:
Olivier R (1):
  tdf#107558 French spelling dictionary (6.0.3) and thesaurus

---
 fr_FR/README_fr.txt   |4 
 fr_FR/description.xml |2 
 fr_FR/fr.aff  |17751 ++--
 fr_FR/fr.dic  |155369 
+-
 fr_FR/package-description.txt |2 
 fr_FR/thes_fr.dat |  206 
 6 files changed, 88495 insertions(+), 84839 deletions(-)
---
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-05-16 Thread Caolán McNamara
 dbaccess/source/ui/inc/imageprovider.hxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 32dc38e319b1d87ba6e5828b6ead32c568c81eff
Author: Caolán McNamara 
Date:   Tue May 16 11:38:27 2017 +0100

fix documentation now

Change-Id: I1583b0f7fb0f99166606e327cdda3bbdcbe698da
Reviewed-on: https://gerrit.libreoffice.org/37691
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/dbaccess/source/ui/inc/imageprovider.hxx 
b/dbaccess/source/ui/inc/imageprovider.hxx
index f680c3ada06a..d9e7b53e55b3 100644
--- a/dbaccess/source/ui/inc/imageprovider.hxx
+++ b/dbaccess/source/ui/inc/imageprovider.hxx
@@ -103,8 +103,7 @@ namespace dbaui
 the type of the object. Must be one of the 
css.sdb.application.DatabaseObject
 constants.
 @return
-the resource ID image to be used for the object type. Must be 
fed into a
-ModuleRes instance to actually load the image.
+the resource image name to be used for the object type.
 */
 static OUString getDefaultImageResourceID(sal_Int32 
_nDatabaseObjectType);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: helpcontent2

2017-05-16 Thread Ilmari Lauhakangas
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit eddb61e8f0a8edc26f0ad0fb9a14621a611020ec
Author: Ilmari Lauhakangas 
Date:   Fri May 5 16:49:59 2017 +0300

Updated core
Project: help  c18afa518a3f076885d2bd22520c6c5c4d4caf9a

tdf#107298 Snap Position renamed to Constrain Objects

Change-Id: I28f0809eedc6d23cf52a262a805e680bf3c39c1b
Reviewed-on: https://gerrit.libreoffice.org/37293
Reviewed-by: Gabor Kelemen 
Tested-by: Gabor Kelemen 

diff --git a/helpcontent2 b/helpcontent2
index 1d2c1291f700..c18afa518a3f 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 1d2c1291f700f729c28a209d2422a8d2f926e347
+Subproject commit c18afa518a3f076885d2bd22520c6c5c4d4caf9a
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] help.git: source/text

2017-05-16 Thread Ilmari Lauhakangas
 source/text/shared/optionen/01070300.xhp |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c18afa518a3f076885d2bd22520c6c5c4d4caf9a
Author: Ilmari Lauhakangas 
Date:   Fri May 5 16:49:59 2017 +0300

tdf#107298 Snap Position renamed to Constrain Objects

Change-Id: I28f0809eedc6d23cf52a262a805e680bf3c39c1b
Reviewed-on: https://gerrit.libreoffice.org/37293
Reviewed-by: Gabor Kelemen 
Tested-by: Gabor Kelemen 

diff --git a/source/text/shared/optionen/01070300.xhp 
b/source/text/shared/optionen/01070300.xhp
index ecd6c0810..07ab047de 100644
--- a/source/text/shared/optionen/01070300.xhp
+++ b/source/text/shared/optionen/01070300.xhp
@@ -39,7 +39,7 @@
  
   
   
-  If you 
have activated the snap grid but wish to move or create individual objects 
without snap positions, keep the Shift key pressed to deactivate this function 
for as long as needed.
+  If you 
have activated the snap grid but wish to move or create individual objects 
without constraining them, keep the Shift key pressed to deactivate this 
function for as long as needed.
   
   Snap
 
@@ -81,9 +81,9 @@
 Snap to 
Object Points
 Snap to Object 
Points icon in the Options 
bar.
 
-Snap range
+Snap 
range
   Defines the snap distance between the 
mouse pointer and the object contour. $[officename] Impress snaps to a snap 
point if the mouse pointer is nearer than the distance selected in the 
Snap range control.
-  Snap position
+  Constrain Objects
 
 When creating or moving objects
   Specifies that graphic objects are restricted 
vertically, horizontally or diagonally (45°) when creating or moving 
them. You can temporarily deactivate this setting by pressing the Shift 
key.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] help.git: source/text

2017-05-16 Thread Laurent Balland-Poirier
 source/text/sbasic/guide/sample_code.xhp |2 +-
 source/text/sbasic/shared/03030107.xhp   |2 --
 source/text/sbasic/shared/03030203.xhp   |7 +++
 source/text/sbasic/shared/03030302.xhp   |7 +++
 source/text/sbasic/shared/03030303.xhp   |6 ++
 source/text/sbasic/shared/03050100.xhp   |6 ++
 source/text/sbasic/shared/03050200.xhp   |2 +-
 source/text/sbasic/shared/03080201.xhp   |6 ++
 source/text/sbasic/shared/03090203.xhp   |3 +--
 source/text/sbasic/shared/03090404.xhp   |4 ++--
 source/text/sbasic/shared/03090408.xhp   |6 ++
 source/text/sbasic/shared/03102450.xhp   |3 +--
 source/text/sbasic/shared/03103200.xhp   |6 ++
 source/text/sbasic/shared/03103300.xhp   |6 ++
 source/text/sbasic/shared/03120201.xhp   |6 ++
 source/text/sbasic/shared/03130100.xhp   |2 +-
 source/text/sbasic/shared/03130700.xhp   |6 ++
 source/text/sbasic/shared/03131000.xhp   |6 ++
 source/text/sbasic/shared/03131300.xhp   |6 ++
 source/text/sbasic/shared/03131400.xhp   |6 ++
 source/text/sbasic/shared/03132100.xhp   |2 +-
 source/text/sbasic/shared/03132200.xhp   |6 ++
 22 files changed, 38 insertions(+), 68 deletions(-)

New commits:
commit 1d2c1291f700f729c28a209d2422a8d2f926e347
Author: Laurent Balland-Poirier 
Date:   Mon Jan 30 23:19:12 2017 +0100

Basic: add localize=false for some bascode lines

Change-Id: I78884c0421ef8ad935ca7214b9116fda29d2797f
update: remove duplicate empty line at end of files
Reviewed-on: https://gerrit.libreoffice.org/33766
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/source/text/sbasic/guide/sample_code.xhp 
b/source/text/sbasic/guide/sample_code.xhp
index a5141068d..334d88cd0 100644
--- a/source/text/sbasic/guide/sample_code.xhp
+++ b/source/text/sbasic/guide/sample_code.xhp
@@ -94,7 +94,7 @@
 MsgBox oCMD1.Dbg_Properties
 REM execute 
dialog
 oDialog1.Execute()
-End 
Sub
+End Sub
 
 Add an 
Entry to a ListBox
 
diff --git a/source/text/sbasic/shared/03030107.xhp 
b/source/text/sbasic/shared/03030107.xhp
index 31b5db488..4b50b0f65 100644
--- a/source/text/sbasic/shared/03030107.xhp
+++ b/source/text/sbasic/shared/03030107.xhp
@@ -27,13 +27,11 @@
 
 
 
-
 
 
   CdateToIso function
 
 
-
 CDateToIso Function [Runtime]
 Returns the 
date in ISO format without separators (MMDD) from a serial date number that 
is generated by the DateSerial or the DateValue or the CDateFromIso 
function.
 The year part 
consists of at least four digits, with leading zeros if the absolute value is 
less than 1000, it can be negative with a leading minus sign if the date passed 
denotes a year before the common era (BCE) and it can have more than four 
digits if the absolute value is greater than . The formatted string 
returned can be in the range "-327680101" to "327671231".
diff --git a/source/text/sbasic/shared/03030203.xhp 
b/source/text/sbasic/shared/03030203.xhp
index 07bdde963..162ace2eb 100644
--- a/source/text/sbasic/shared/03030203.xhp
+++ b/source/text/sbasic/shared/03030203.xhp
@@ -27,20 +27,18 @@
 
 
 
-
 
 
   Now function
 
 
-
 Now 
Function [Runtime]
 Returns the 
current system date and time as a Date value.
 
 
 Syntax:
 
-Now
+Now
 
 
 Return 
value:
@@ -54,4 +52,5 @@
 
 
 
-
\ No newline at end of file
+
+
diff --git a/source/text/sbasic/shared/03030302.xhp 
b/source/text/sbasic/shared/03030302.xhp
index 410d2acff..92f053cac 100644
--- a/source/text/sbasic/shared/03030302.xhp
+++ b/source/text/sbasic/shared/03030302.xhp
@@ -27,20 +27,18 @@
 
 
 
-
 
 
   Time statement
 
 
-
 Time Statement 
[Runtime]
 This function 
returns the current system time as a string in the format 
"HH:MM:SS".
 
 
 Syntax:
 
-Time
+Time
 
 
 Parameters:
@@ -54,4 +52,5 @@
 
 
 
-
\ No newline at end of file
+
+
diff --git a/source/text/sbasic/shared/03030303.xhp 
b/source/text/sbasic/shared/03030303.xhp
index bf440cf91..e50ce722a 100644
--- a/source/text/sbasic/shared/03030303.xhp
+++ b/source/text/sbasic/shared/03030303.xhp
@@ -27,13 +27,11 @@
 
 
 
-
 
 
   Timer function
 
 
-
 Timer 
Function [Runtime]
 Returns a 
value that specifies the number of seconds that have elapsed since 
midnight.
 
@@ -41,7 +39,7 @@
 
 Syntax:
 
-Timer
+Timer
 
 
 Return 
value:
@@ -62,4 +60,4 @@
 
 
 
-
\ No newline at end of file
+
diff --git a/source/text/sbasic/shared/03050100.xhp 
b/source/text/sbasic/shared/03050100.xhp
index 7ae49da66..19677a7b4 100644
--- a/source/text/sbasic/shared/03050100.xhp
+++ b/source/text/sbasic/shared/03050100.xhp
@@ -27,20 +27,18 @@
 
 
 
-
 
 
   Erl function
 
 
-
 Erl 
Function [Runtime]
 Returns the 
line number where an error occurred during program execution.
 
 
 Syntax:
 
-Erl
+Erl
 
 
 Return 
value:
@@ -67,4 +65,4 @@
 
 
 
-
\ No newline at end of file
+
diff --git a/source/text/sbasic/shared/03050200.xhp 
b/source/text/sbasic/shared/03050200.xhp
index 2dcec6380..7bd0ded26 100644
--- a/

[Libreoffice-commits] core.git: helpcontent2

2017-05-16 Thread Laurent Balland-Poirier
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 96e145476b8ef1f0cb5299c470df2493ae689f60
Author: Laurent Balland-Poirier 
Date:   Mon Jan 30 23:19:12 2017 +0100

Updated core
Project: help  1d2c1291f700f729c28a209d2422a8d2f926e347

Basic: add localize=false for some bascode lines

Change-Id: I78884c0421ef8ad935ca7214b9116fda29d2797f
update: remove duplicate empty line at end of files
Reviewed-on: https://gerrit.libreoffice.org/33766
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index c1b5c626539f..1d2c1291f700 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit c1b5c626539f3893c07c11380c5cfe94bc5f8d36
+Subproject commit 1d2c1291f700f729c28a209d2422a8d2f926e347
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] help.git: source/text

2017-05-16 Thread Olivier Hallot
 source/text/sbasic/shared/03020409.xhp |   28 ++--
 source/text/sbasic/shared/03020414.xhp |   12 ++--
 2 files changed, 20 insertions(+), 20 deletions(-)

New commits:
commit c1b5c626539f3893c07c11380c5cfe94bc5f8d36
Author: Olivier Hallot 
Date:   Tue May 16 16:36:56 2017 -0300

Mute l10n for numbers

Change-Id: I3fe0ef570e49899449444dad5f29107dc7534071
Reviewed-on: https://gerrit.libreoffice.org/37689
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/source/text/sbasic/shared/03020409.xhp 
b/source/text/sbasic/shared/03020409.xhp
index 8c1196fd9..1c0e167ad 100644
--- a/source/text/sbasic/shared/03020409.xhp
+++ b/source/text/sbasic/shared/03020409.xhp
@@ -69,10 +69,10 @@
   
   
 
-  ATTR_NORMAL
+  ATTR_NORMAL
 
 
-  0
+  0
 
 
Normal 
files.
@@ -80,10 +80,10 @@
   
   
 
-  ATTR_READONLY
+  ATTR_READONLY
 
 
-  1
+  1
 
 

Read-only files.
@@ -91,10 +91,10 @@
   
   
 
-  ATTR_HIDDEN
+  ATTR_HIDDEN
 
 
-  2
+  2
 
 
Hidden file
@@ -102,10 +102,10 @@
   
   
 
-  ATTR_SYSTEM
+  ATTR_SYSTEM
 
 
-  4
+  4
 
 
System file
@@ -113,10 +113,10 @@
   
   
 
-  ATTR_VOLUME
+  ATTR_VOLUME
 
 
-  8
+  8
 
 
Returns 
the name of the volume
@@ -124,10 +124,10 @@
   
   
 
-  ATTR_DIRECTORY
+  ATTR_DIRECTORY
 
 
-  16
+  16
 
 
Returns 
the name of the directory only.
@@ -135,10 +135,10 @@
   
   
 
-  ATTR_ARCHIVE
+  ATTR_ARCHIVE
 
 
-  32
+  32
 
 
File 
was changed since last backup (Archive bit).
diff --git a/source/text/sbasic/shared/03020414.xhp 
b/source/text/sbasic/shared/03020414.xhp
index fbd727499..13b3a701b 100644
--- a/source/text/sbasic/shared/03020414.xhp
+++ b/source/text/sbasic/shared/03020414.xhp
@@ -62,10 +62,10 @@
   
   
 
-  ATTR_NORMAL
+  ATTR_NORMAL
 
 
-  0
+  0
 
 
Normal 
files.
@@ -73,10 +73,10 @@
   
   
 
-  ATTR_READONLY
+  ATTR_READONLY
 
 
-  1
+  1
 
 

Read-only files.
@@ -84,10 +84,10 @@
   
   
 
-  ATTR_HIDDEN
+  ATTR_HIDDEN
 
 
-  2
+  2
 
 
Hidden file
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: helpcontent2

2017-05-16 Thread Olivier Hallot
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 72bffbc475d6d93ee2999ae0a4bec334e1be059e
Author: Olivier Hallot 
Date:   Tue May 16 16:36:56 2017 -0300

Updated core
Project: help  c1b5c626539f3893c07c11380c5cfe94bc5f8d36

Mute l10n for numbers

Change-Id: I3fe0ef570e49899449444dad5f29107dc7534071
Reviewed-on: https://gerrit.libreoffice.org/37689
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index f930a0c40fa6..c1b5c626539f 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit f930a0c40fa65c778b9e6b2fa75d7581bb3f82dc
+Subproject commit c1b5c626539f3893c07c11380c5cfe94bc5f8d36
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/touch include/vcl sc/source sw/source vcl/inc vcl/source

2017-05-16 Thread Caolán McNamara
 include/touch/touch.h|   19 ---
 include/vcl/commandevent.hxx |3 --
 sc/source/ui/view/tabview.cxx|   17 -
 sw/source/uibase/uiview/viewport.cxx |   43 ---
 vcl/inc/salwtype.hxx |2 -
 vcl/source/window/winproc.cxx|   40 +++-
 6 files changed, 10 insertions(+), 114 deletions(-)

New commits:
commit f0eec7572dfa630f903e91ac44a41f3503112846
Author: Caolán McNamara 
Date:   Tue May 16 10:42:49 2017 +0100

ExternalZoom and ExternalScroll are unused

which leads to CommandWheelMode::ZOOM_SCALE becoming unused

and so touch/touch.h is unnecessary

Change-Id: I7cb9a4f6af2719deb0d768e35d514b59010daf79
Reviewed-on: https://gerrit.libreoffice.org/37671
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/touch/touch.h b/include/touch/touch.h
deleted file mode 100644
index e20fe3fe5a3e..
--- a/include/touch/touch.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#ifndef INCLUDED_TOUCH_TOUCH_H
-#define INCLUDED_TOUCH_TOUCH_H
-
-#define MOBILE_MAX_ZOOM_IN 600
-#define MOBILE_MAX_ZOOM_OUT 80
-#define MOBILE_ZOOM_SCALE_MULTIPLIER 1
-
-#endif // INCLUDED_TOUCH_TOUCH_H
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/commandevent.hxx b/include/vcl/commandevent.hxx
index 68ea0c5184d7..778348b3d1a3 100644
--- a/include/vcl/commandevent.hxx
+++ b/include/vcl/commandevent.hxx
@@ -129,8 +129,7 @@ enum class CommandWheelMode
 NONE  = 0,
 SCROLL= 1,
 ZOOM  = 2,
-ZOOM_SCALE= 3,
-DATAZOOM  = 4
+DATAZOOM  = 3
 };
 
 // Magic value used in mnLines field in CommandWheelData
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 7610296acd76..2510be1f891a 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -968,8 +968,7 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, 
ScSplitPos ePos )
 
 bool bDone = false;
 const CommandWheelData* pData = rCEvt.GetWheelData();
-if ( pData && (pData->GetMode() == CommandWheelMode::ZOOM ||
-   pData->GetMode() == CommandWheelMode::ZOOM_SCALE ) )
+if (pData && pData->GetMode() == CommandWheelMode::ZOOM)
 {
 if ( !aViewData.GetViewShell()->GetViewFrame()->GetFrame().IsInPlace() 
)
 {
@@ -979,16 +978,10 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, 
ScSplitPos ePos )
 const Fraction& rOldY = aViewData.GetZoomY();
 long nOld = (long)(( rOldY.GetNumerator() * 100 ) / 
rOldY.GetDenominator());
 long nNew;
-if ( pData->GetMode() == CommandWheelMode::ZOOM_SCALE )
-{
-nNew = 100 * (long) ((nOld / 100.0) * (pData->GetDelta() / 
100.0));
-} else
-{
-if ( pData->GetDelta() < 0 )
-nNew = std::max( (long) MINZOOM, 
basegfx::zoomtools::zoomOut( nOld ));
-else
-nNew = std::min( (long) MAXZOOM, 
basegfx::zoomtools::zoomIn( nOld ));
-}
+if ( pData->GetDelta() < 0 )
+nNew = std::max( (long) MINZOOM, basegfx::zoomtools::zoomOut( 
nOld ));
+else
+nNew = std::min( (long) MAXZOOM, basegfx::zoomtools::zoomIn( 
nOld ));
 if ( nNew != nOld )
 {
 // scroll wheel doesn't set the AppOptions default
diff --git a/sw/source/uibase/uiview/viewport.cxx 
b/sw/source/uibase/uiview/viewport.cxx
index e56fcd6c330c..c909c1dd8835 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -41,7 +41,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
@@ -1217,48 +1216,6 @@ bool SwView::HandleWheelCommands( const CommandEvent& 
rCEvt )
 SetZoom( SvxZoomType::PERCENT, nFact );
 bOk = true;
 }
-else if (pWData && CommandWheelMode::ZOOM_SCALE == pWData->GetMode())
-{
-// mobile touch zoom (pinch) section
-// remember the center location to reach in logic
-
-Size winSize = GetViewFrame()->GetWindow().GetOutputSizePixel();
-Point centerInPixels(winSize.getWidth() / 2, winSize.getHeight() / 2);
-const Point & preZoomTargetCenterInLogic = 
GetEditWin().PixelToLogic(centerInPixels);
-
-double scale = double(pWData->GetDelta()) / 
double(MOBILE_ZOOM_SCALE_MULTIPLIER);
-
-int preZoomByVCL = m_pWrtShell->GetViewOptions()->

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

2017-05-16 Thread Maxim Monastirsky
 cui/source/customize/acccfg.cxx  |2 +-
 cui/source/customize/cfgutil.cxx |   19 +++
 cui/source/inc/cfgutil.hxx   |4 ++--
 3 files changed, 14 insertions(+), 11 deletions(-)

New commits:
commit 4e52299a6aff1386151223a99e7ed3a49496d967
Author: Maxim Monastirsky 
Date:   Tue May 16 02:22:30 2017 +0300

tdf#107853 tdf#107854 Hide useless style families

Change-Id: I9918cbbf6b030e0f1f0a5dee153bedc8a53f91d8
Reviewed-on: https://gerrit.libreoffice.org/37688
Tested-by: Jenkins 
Reviewed-by: Maxim Monastirsky 

diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index dfaf2004d173..f5d90803fc58 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -924,7 +924,7 @@ void SfxAcceleratorConfigPage::Init(const 
uno::ReferencegetModel();
 
-m_aStylesInfo.setModel(xModel);
+m_aStylesInfo.init(m_sModuleLongName, xModel);
 m_pFunctionBox->SetStylesInfo(&m_aStylesInfo);
 m_pGroupLBox->SetStylesInfo(&m_aStylesInfo);
 m_bStylesInfoInitialized = true;
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index ad171a755354..408c74331950 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -76,8 +76,9 @@ using namespace ::com::sun::star::document;
 SfxStylesInfo_Impl::SfxStylesInfo_Impl()
 {}
 
-void SfxStylesInfo_Impl::setModel(const css::uno::Reference< 
css::frame::XModel >& xModel)
+void SfxStylesInfo_Impl::init(const OUString& rModuleName, const 
css::uno::Reference< css::frame::XModel >& xModel)
 {
+m_aModuleName = rModuleName;
 m_xDoc = xModel;
 }
 
@@ -171,12 +172,14 @@ std::vector< SfxStyleInfo_Impl > 
SfxStylesInfo_Impl::getStyleFamilies()
 css::uno::Reference< css::container::XNameAccess > xCont = 
xModel->getStyleFamilies();
 css::uno::Sequence< OUString > lFamilyNames = xCont->getElementNames();
 std::vector< SfxStyleInfo_Impl > lFamilies;
-sal_Int32 c = lFamilyNames.getLength();
-sal_Int32 i = 0;
-for(i=0; iShow();
 
 get(m_pCategories, "categories");
+const OUString 
aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(xFrame));
 m_pCategories->SetFunctionListBox(m_pCommands);
-m_pCategories->Init(comphelper::getProcessComponentContext(), xFrame,
-vcl::CommandInfoProvider::GetModuleIdentifier(xFrame), 
bShowSlots);
+m_pCategories->Init(comphelper::getProcessComponentContext(), xFrame, 
aModuleName, bShowSlots);
 
 m_pCategories->SetSelectHdl(
 LINK( this, SvxScriptSelectorDialog, SelectHdl ) );
@@ -1211,7 +1214,7 @@ SvxScriptSelectorDialog::SvxScriptSelectorDialog(
 if (xController.is())
 xModel = xController->getModel();
 
-m_aStylesInfo.setModel(xModel);
+m_aStylesInfo.init(aModuleName, xModel);
 m_pCommands->SetStylesInfo(&m_aStylesInfo);
 m_pCategories->SetStylesInfo(&m_aStylesInfo);
 
diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx
index d053555bba86..acc0020daa1f 100644
--- a/cui/source/inc/cfgutil.hxx
+++ b/cui/source/inc/cfgutil.hxx
@@ -61,13 +61,13 @@ struct SfxStyleInfo_Impl
 struct SfxStylesInfo_Impl
 {
 private:
-
+OUString m_aModuleName;
 css::uno::Reference< css::frame::XModel > m_xDoc;
 
 public:
 
 SfxStylesInfo_Impl();
-void setModel(const css::uno::Reference< css::frame::XModel >& xModel);
+void init(const OUString& rModuleName, const css::uno::Reference< 
css::frame::XModel >& xModel);
 
 static bool parseStyleCommand(SfxStyleInfo_Impl& aStyle);
 void getLabel4Style(SfxStyleInfo_Impl& aStyle);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-05-16 Thread Julien Nabet
 basctl/source/basicide/baside2.cxx  |2 --
 basctl/source/basicide/baside2b.cxx |1 -
 include/vcl/textview.hxx|2 --
 vcl/source/edit/textview.cxx|   10 --
 4 files changed, 15 deletions(-)

New commits:
commit 7865aa4c9e08e5dccf3627a68daf439a26e1bd4d
Author: Julien Nabet 
Date:   Tue May 16 18:43:19 2017 +0200

Remove unused mpVirtDev (vcl/textview)

Unused since commit 72edb6967f245f0c99c6a61e0ce8d0a245600cba
"loplugin:unusedmethods in vcl"

+ remove useless EraseVirtualDevice

Change-Id: I1b932bb49e9f84e3ddb5c3ab69b3d1b3131233e2
Reviewed-on: https://gerrit.libreoffice.org/37685
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/basctl/source/basicide/baside2.cxx 
b/basctl/source/basicide/baside2.cxx
index 7a03c14aa61a..d24597ed819a 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -1195,8 +1195,6 @@ void ModulWindow::Activating ()
 void ModulWindow::Deactivating()
 {
 Hide();
-if ( GetEditView() )
-GetEditView()->EraseVirtualDevice();
 }
 
 sal_uInt16 ModulWindow::StartSearchAndReplace( const SvxSearchItem& 
rSearchItem, bool bFromStart )
diff --git a/basctl/source/basicide/baside2b.cxx 
b/basctl/source/basicide/baside2b.cxx
index afc85ea00b70..8b9137db9262 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1004,7 +1004,6 @@ void EditorWindow::CreateEditEngine()
 
 pProgress.reset();
 
-pEditView->EraseVirtualDevice();
 pEditEngine->SetModified( false );
 pEditEngine->EnableUndo( true );
 
diff --git a/include/vcl/textview.hxx b/include/vcl/textview.hxx
index b46bc5f3891c..ba96f89dba56 100644
--- a/include/vcl/textview.hxx
+++ b/include/vcl/textview.hxx
@@ -169,8 +169,6 @@ public:
 
 voidSetPaintSelection( bool bPaint);
 
-voidEraseVirtualDevice();
-
 // aus dem protected Teil hierher verschoben
 // For 'SvtXECTextCursor' (TL). Must ggf nochmal anders gel?st werden.
 TextPaM PageUp( const TextPaM& rPaM );
diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx
index 083f3a984df9..c6cb9618e4cf 100644
--- a/vcl/source/edit/textview.cxx
+++ b/vcl/source/edit/textview.cxx
@@ -157,8 +157,6 @@ struct ImpTextView
 
 std::unique_ptr mpDDInfo;
 
-VclPtr  mpVirtDev;
-
 std::unique_ptr mpSelEngine;
 std::unique_ptr mpSelFuncSet;
 
@@ -185,7 +183,6 @@ TextView::TextView( ExtTextEngine* pEng, vcl::Window* 
pWindow ) :
 
 mpImpl->mpWindow = pWindow;
 mpImpl->mpTextEngine = pEng;
-mpImpl->mpVirtDev = nullptr;
 
 mpImpl->mbPaintSelection = true;
 mpImpl->mbAutoScroll = true;
@@ -235,8 +232,6 @@ TextView::~TextView()
 mpImpl->mpSelEngine.reset();
 mpImpl->mpSelFuncSet.reset();
 
-mpImpl->mpVirtDev.disposeAndClear();
-
 if ( mpImpl->mpWindow->GetCursor() == mpImpl->mpCursor.get() )
 mpImpl->mpWindow->SetCursor( nullptr );
 
@@ -476,11 +471,6 @@ void TextView::ImpShowHideSelection(const TextSelection* 
pRange)
 }
 }
 
-void TextView::EraseVirtualDevice()
-{
-mpImpl->mpVirtDev.disposeAndClear();
-}
-
 bool TextView::KeyInput( const KeyEvent& rKeyEvent )
 {
 bool bDone  = true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-05-16 Thread Marco Cecchetti
 sc/source/ui/undo/undoblk.cxx  |   14 ++
 sc/source/ui/undo/undoblk2.cxx |   10 +-
 2 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 6e3f9d38c0bdeff606d36ce8daabd3ad8ee1b6bb
Author: Marco Cecchetti 
Date:   Wed May 3 17:22:27 2017 +0200

lok: sc: invalidate col/row header on undo row/col operations

Change-Id: Ia0b2174cfcc3f2b3075e8f6eee1eb0f56b64db44
Reviewed-on: https://gerrit.libreoffice.org/37686
Tested-by: Jenkins 
Reviewed-by: Marco Cecchetti 

diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 291151d11a6d..1c2757c40897 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -23,6 +23,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "undoblk.hxx"
 #include "undoutil.hxx"
@@ -257,7 +259,19 @@ void ScUndoInsertCells::DoChange( const bool bUndo )
 }
 pDocShell->PostDataChanged();
 if (pViewShell)
+{
 pViewShell->CellContentChanged();
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+if (eCmd == INS_INSCOLS_BEFORE || eCmd == INS_INSCOLS_AFTER || 
eCmd == INS_CELLSRIGHT)
+ScTabViewShell::notifyAllViewsHeaderInvalidation("column",  
pViewShell->GetViewData().GetTabNo());
+
+if (eCmd == INS_INSROWS_BEFORE || eCmd == INS_INSROWS_AFTER || 
eCmd == INS_CELLSDOWN)
+ScTabViewShell::notifyAllViewsHeaderInvalidation("row",  
pViewShell->GetViewData().GetTabNo());
+}
+
+}
 }
 
 void ScUndoInsertCells::Undo()
diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx
index 50404d5e09fc..cdf75b9f1882 100644
--- a/sc/source/ui/undo/undoblk2.cxx
+++ b/sc/source/ui/undo/undoblk2.cxx
@@ -30,6 +30,8 @@
 
 #include "undoolk.hxx"
 
+#include 
+#include 
 
 /** Change column widths or row heights */
 ScUndoWidthOrHeight::ScUndoWidthOrHeight( ScDocShell* pNewDocShell,
@@ -94,6 +96,7 @@ void ScUndoWidthOrHeight::Undo()
 if (pUndoTab)   // Outlines are 
included when saving ?
 rDoc.SetOutlineTable( nStartTab, pUndoTab );
 
+ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
 SCTAB nTabCount = rDoc.GetTableCount();
 ScMarkData::iterator itr = aMarkData.begin(), itrEnd = aMarkData.end();
 for (; itr != itrEnd && *itr < nTabCount; ++itr)
@@ -117,7 +120,6 @@ void ScUndoWidthOrHeight::Undo()
 
 DoSdrUndoAction( pDrawUndo, &rDoc );
 
-ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
 if (pViewShell)
 {
 pViewShell->UpdateScrollBars();
@@ -125,6 +127,12 @@ void ScUndoWidthOrHeight::Undo()
 SCTAB nCurrentTab = pViewShell->GetViewData().GetTabNo();
 if ( nCurrentTab < nStartTab || nCurrentTab > nEndTab )
 pViewShell->SetTabNo( nStartTab );
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+OString aPayload = bWidth ? "column" : "row";
+ScTabViewShell::notifyAllViewsHeaderInvalidation(aPayload, 
pViewShell->GetViewData().GetTabNo());
+}
 }
 
 EndUndo();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] help.git: source/text

2017-05-16 Thread Laurent Balland-Poirier
 source/text/schart/00/0004.xhp |2 +-
 source/text/schart/01/04050100.xhp |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit f930a0c40fa65c778b9e6b2fa75d7581bb3f82dc
Author: Laurent Balland-Poirier 
Date:   Sat Feb 25 15:09:48 2017 +0100

Update menu entry for Insert Trend Line in chart

Add emph tag in the same way as other menu commands

Change-Id: I968b391485b1cb4fa8083704ca91fd44af087b1f
Reviewed-on: https://gerrit.libreoffice.org/34644
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/source/text/schart/00/0004.xhp 
b/source/text/schart/00/0004.xhp
index 2f105d1e6..816a88aca 100644
--- a/source/text/schart/00/0004.xhp
+++ b/source/text/schart/00/0004.xhp
@@ -89,7 +89,7 @@
 
 Choose Insert - X Error Bars  or Insert - Y 
Error Bars (Charts)
 
-Choose Insert - Trend Lines (Charts)
+Choose Insert - Trend Line (Charts)
 
 Choose Insert - Special Character (Charts)
 
diff --git a/source/text/schart/01/04050100.xhp 
b/source/text/schart/01/04050100.xhp
index 367cf541f..c0037b468 100644
--- a/source/text/schart/01/04050100.xhp
+++ b/source/text/schart/01/04050100.xhp
@@ -116,10 +116,10 @@
 
 
   
-To insert 
a trend line for a data series, select the data series in the chart. Choose 
Insert - Trend Lines, or right-click to open the 
context menu, and choose Insert - Trend 
Line.
+To insert 
a trend line for a data series, select the data series in the chart. Choose 
Insert - Trend Line, or right-click to open the 
context menu, and choose Insert Trend 
Line.
   
-  
 
+  
 Mean Value Lines are special trend lines that show the mean 
value. Use Insert - Mean Value Lines to insert 
mean value lines for data series.
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: helpcontent2

2017-05-16 Thread Laurent Balland-Poirier
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ad605e2e0606ee2c5c0fb23b84a0f011af62d124
Author: Laurent Balland-Poirier 
Date:   Sat Feb 25 15:09:48 2017 +0100

Updated core
Project: help  f930a0c40fa65c778b9e6b2fa75d7581bb3f82dc

Update menu entry for Insert Trend Line in chart

Add emph tag in the same way as other menu commands

Change-Id: I968b391485b1cb4fa8083704ca91fd44af087b1f
Reviewed-on: https://gerrit.libreoffice.org/34644
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index 90643687005e..f930a0c40fa6 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 90643687005e1a21c4067f253cc6adeda0c421e0
+Subproject commit f930a0c40fa65c778b9e6b2fa75d7581bb3f82dc
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] help.git: source/text

2017-05-16 Thread Laurent Balland-Poirier
 source/text/shared/01/05020301.xhp |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 90643687005e1a21c4067f253cc6adeda0c421e0
Author: Laurent Balland-Poirier 
Date:   Wed Mar 1 14:53:04 2017 +0100

Clarify examples for l10n using space as thousands separator

Number Format Code
In locale using space as thousands separator, some examples
may be not correctly interpreted.
This patch adds some text to explain how to solve this.

Beautify a little bit some examples.

Complete fraction description: any digit symbol (0, # or ?)
can be used to described any of the three parts of the fraction.

Change-Id: I5bab1da21b33cddfa0a63fbe5e3d53d64ed0103c
Reviewed-on: https://gerrit.libreoffice.org/34755
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/source/text/shared/01/05020301.xhp 
b/source/text/shared/01/05020301.xhp
index 9c5ba9834..d2db2494a 100644
--- a/source/text/shared/01/05020301.xhp
+++ b/source/text/shared/01/05020301.xhp
@@ -66,7 +66,7 @@
 
 Decimal 
Places and Significant Digits
 Use zero (0), 
the number sign (#) or the question mark (?) as placeholders in your number 
format code to represent numbers. The (#) only displays significant digits, 
while the (0) displays zeroes if there are fewer digits in the number than in 
the number format. The (?) works as the (#) but adds a space character to keep 
decimal alignment if there is a hidden non-significant zero.
-Use question 
marks (?) to represent the number of digits to include in the numerator and the 
denominator of a fraction. Fractions that do not fit the pattern that you 
define are displayed as floating point numbers.
+Use question 
marks (?), zeroes (0) or number signs (#) to represent the number of digits to 
include in the numerator and the denominator of a fraction. Fractions that do 
not fit the pattern that you define are displayed as floating point 
numbers.
 If a number 
contains more digits to the right of the decimal delimiter than there are 
placeholders in the format, the number is rounded accordingly. If a number 
contains more digits to the left of the decimal delimiter than there are 
placeholders in the format, the entire number is displayed. Use the following 
list as a guide for using placeholders when you create a number format 
code:
 
 
@@ -168,7 +168,7 @@
 
 
 Thousands Separator
-Depending on 
your language setting, you can use a comma, a period or a blank as a thousands 
separator. You can also use the separator to reduce the size of the number that 
is displayed by a multiple of 1000 for each separator.
+Depending on 
your language setting, you can use a comma, a period or a blank as a thousands 
separator. You can also use the separator to reduce the size of the number that 
is displayed by a multiple of 1000 for each separator. The examples below use 
comma as thousands separator:
 
 
   
@@ -201,7 +201,7 @@
 Including Text in Number Format Codes
 
 Text 
and Numbers
-To include 
text in a number format that is applied to a cell containing numbers, place a 
double quotation mark (") in front of and behind the text, or a backslash (\) 
before a single character. For example, enter #.# "meters" to 
display "3.5 meters" or #.# \m to display "3.5 m".
+To include 
text in a number format that is applied to a cell containing numbers, place a 
double quotation mark (") in front of and behind the text, or a backslash (\) 
before a single character. For example, enter #.# "meters" to 
display "3.5 meters" or #.# \m to display "3.5 m". If you use 
space as thousands separator, you need to insert spaces between quotes in the 
previous examples: #.#" meters" or #.#\ \m to get the 
correct result.
 
 Text 
and Text
 To include 
text in a number format that is applied to a cell that might contain text, 
enclose the text by double quotation marks (" "), and then add an at sign (@). 
For example, enter "Total for "@ to display "Total for 
December".
@@ -271,7 +271,7 @@
 To display 
numbers as percentages, add the percent sign (%) to the number 
format.
 
 Scientific Notation
-Scientific 
notation lets you write very large numbers or very small fractions in a compact 
form. For example, in scientific notation, 65 is written as 6.5 x 10^5, and 
0.65 as 6.5 x 10^-5. Translators: use the decimal delimiter of 
your language (period or comma) for all number format codes in 
Calc.In %PRODUCTNAME, these numbers 
are written as 6.5E+5 and 6.5E-5, respectively. To create a number format that 
displays numbers using scientific notation, enter a # or 0, and then one of the 
following codes E-, E+, e- or e+. If sign is omitted after E or e, it won't 
appear for positive value of exponent. To get engineering notation, enter 3 
digits (0 or #) in the integer part. For instance: ###.##E+00
+Scientific 
notation lets you write very large numbers or very small fractions in a compact 
form. For example, in scientific notati

[Libreoffice-commits] core.git: helpcontent2

2017-05-16 Thread Laurent Balland-Poirier
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 963c1f40cdc0fa29027755c4dc0998cb8b286c4a
Author: Laurent Balland-Poirier 
Date:   Wed Mar 1 14:53:04 2017 +0100

Updated core
Project: help  90643687005e1a21c4067f253cc6adeda0c421e0

Clarify examples for l10n using space as thousands separator

Number Format Code
In locale using space as thousands separator, some examples
may be not correctly interpreted.
This patch adds some text to explain how to solve this.

Beautify a little bit some examples.

Complete fraction description: any digit symbol (0, # or ?)
can be used to described any of the three parts of the fraction.

Change-Id: I5bab1da21b33cddfa0a63fbe5e3d53d64ed0103c
Reviewed-on: https://gerrit.libreoffice.org/34755
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index ab17f13c6d60..90643687005e 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit ab17f13c6d60d2d6ad7ff6ce3734ba81c77f881d
+Subproject commit 90643687005e1a21c4067f253cc6adeda0c421e0
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Changes to 'refs/tags/2.1.1-rc1'

2017-05-16 Thread Andras Timar
Tag '2.1.1-rc1' created by Andras Timar  at 
2017-05-16 18:30 +

2.1.1-rc1

Changes since 2.1.1-beta2-19:
---
 0 files changed
---
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - debian/changelog loolwsd.spec.in

2017-05-16 Thread Andras Timar
 debian/changelog |6 ++
 loolwsd.spec.in  |2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit bda51ba86eb6e67253d40a876318b3abde14321b
Author: Andras Timar 
Date:   Tue May 16 20:29:42 2017 +0200

Bump version for packages 2.1.1-3

Change-Id: I58a2142554ab5ab1972bccd34db6acbb809d8c38

diff --git a/debian/changelog b/debian/changelog
index b2367944..522927af 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+loolwsd (2.1.1-3) unstable; urgency=medium
+
+  * see the git log: http://col.la/cool21
+
+ -- Andras Timar   Tue, 16 May 2017 19:30:00 +0100
+
 loolwsd (2.1.1-2) unstable; urgency=medium
 
   * see the git log: http://col.la/cool21
diff --git a/loolwsd.spec.in b/loolwsd.spec.in
index db2b1941..67f5a085 100644
--- a/loolwsd.spec.in
+++ b/loolwsd.spec.in
@@ -12,7 +12,7 @@ Name:   loolwsd%{name_suffix}
 Name:   loolwsd
 %endif
 Version:@PACKAGE_VERSION@
-Release:2%{?dist}
+Release:3%{?dist}
 Vendor: Collabora
 Summary:LibreOffice On-Line WebSocket Daemon
 License:MPL
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: Backward compatibility or valid input

2017-05-16 Thread Tamas Zolnai
Hi Caolan,

On Monday, May 15, 2017 12:33 BST, Caolán McNamara  wrote: 
 
> On Fri, 2017-05-12 at 18:20 +0100, Tamas Zolnai wrote:
> > Caolan, I don't see a bug number in the commit message. So I don't
> > know what was the actual test case there. Do you remember something
> > about what was the issue? Maybe we can find a better solution for
> > that.
> 
> I've sent Tomas a document which reproduces the original problem.
> 
> The document generator is LibreOffice 4.4.5.2, and the document is one
> with redlines enabled where there are a massive amount of duplicate
> frames anchored to the same paragraph which results in a document which
> on load is slow to load and unuseably slow to scroll through or work
> with.
> 
> I think the source to *that* problem may have been 'Fix single node
> CopyRange' 9099e21b89184bd4e39def497e483cac4a77ec5a and that problem
> may have been fixed with 'Revert "Fix single node CopyRange"'
> e84f0a9b3223f49b0829f2f55dacbf11ae201c1e
> 
> If that commit was not the root of the duplicate frames then it was
> something of that nature, such that on every save of documents with
> frames anchored to certain locations of redlines the frames got
> duplicated. So on load the document is impossibly slow to work with.
> 
> The catch was what to do about the existing documents containing
> duplicate frames generated with versions before the fix went in.
> 
> I take your point that "it used to work and now it doesn't" wrt
> anonymous/duplicate frame names, but I didn't see any great solutions
> to the pressing need to get documents generated by ourselves to load
> again and LibreOffice (normally) always writes unique frame and the
> spec can be read to indicate that they have to be unique which gave a
> way out to repair the existing pool of affected documents by dropping
> frames with duplicate names.
 
Thanks for the test document and the explanation. I think this conflict can be 
solved by checking also the frame's size and positions next to the frame name. 
With that we can distinguish the real duplicates from those which only have the 
same name. I will change the code accordingly.
I can reproduce the issue with the test document you sent (slow import), so 
I'll make sure not to reintroduce that by by the code change.

Thanks,
Tamás

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


[Libreoffice-commits] dev-tools.git: esc-reporting/esc-collect.py

2017-05-16 Thread jan Iversen
 esc-reporting/esc-collect.py |   27 +++
 1 file changed, 15 insertions(+), 12 deletions(-)

New commits:
commit 6b31dcdd5048cb549144a5a697d966ef909e7d10
Author: jan Iversen 
Date:   Tue May 16 19:50:13 2017 +0200

esc-report, remove auth from patch collection

diff --git a/esc-reporting/esc-collect.py b/esc-reporting/esc-collect.py
index 685e673..6931773 100755
--- a/esc-reporting/esc-collect.py
+++ b/esc-reporting/esc-collect.py
@@ -54,23 +54,26 @@ def util_load_file(fileName):
 
 
 
-def util_load_url(url, useDict=False, useRaw=False, uUser=None, uPass=None):
+def util_load_url(url, useDict=False, useRaw=False, useSkipJSON=False, 
uUser=None, uPass=None):
 try:
   if uUser is None:
 r = requests.get(url)
-if useDict:
-  try:
-rawData = xmltodict.parse(x)
-  except Exception as e:
-rawData = {'response': {'result': {'project': {},
-'contributor_fact': {
-elif useRaw:
-  rawData = r.text
-else:
-  rawData = r.json()
   else:
 r = requests.get(url, auth=HTTPDigestAuth(uUser, uPass))
+useSkipJSON = True
+
+  if useDict:
+try:
+  rawData = xmltodict.parse(x)
+except Exception as e:
+  rawData = {'response': {'result': {'project': {},
+'contributor_fact': {
+  elif useRaw:
+rawData = r.text
+  elif useSkipJSON:
 rawData = json.loads(r.text[5:])
+  else:
+rawData = r.json()
   r.close()
 except Exception as e:
   print('Error load url ' + url + ' due to ' + str(e))
@@ -576,7 +579,7 @@ def get_gerrit(cfg):
 if 'offset' in rawList:
   offset = int(rawList['offset'])
 while True:
-  tmp = util_load_url(url + str(offset), uUser=uid, uPass=upw)
+  tmp = util_load_url(url + str(offset), useSkipJSON=True)
   for row in tmp:
 for i in 'email', 'username', 'name':
   if not i in row['owner']:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: compilerplugins/clang

2017-05-16 Thread Stephan Bergmann
 compilerplugins/clang/comparisonwithconstant.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 133d06baefc5e36ae3b5a1713c3fded26cdabe2f
Author: Stephan Bergmann 
Date:   Tue May 16 19:44:25 2017 +0200

Remove unused var

Change-Id: Id0266ad01eaabf2d9555e99f4a4c1c2300bb8be7

diff --git a/compilerplugins/clang/comparisonwithconstant.cxx 
b/compilerplugins/clang/comparisonwithconstant.cxx
index cf721a83c4e3..8decc5c475cc 100644
--- a/compilerplugins/clang/comparisonwithconstant.cxx
+++ b/compilerplugins/clang/comparisonwithconstant.cxx
@@ -57,7 +57,6 @@ bool ComparisonWithConstant::VisitBinaryOperator(const 
BinaryOperator* binaryOp)
 if (binaryOp->getLHS()->isValueDependent() || 
binaryOp->getRHS()->isValueDependent()) {
 return true;
 }
-APValue result;
 if (!binaryOp->getLHS()->isEvaluatable(compiler.getASTContext())) {
 return true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] dev-tools.git: esc-reporting/esc-collect.py

2017-05-16 Thread jan Iversen
 esc-reporting/esc-collect.py |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 0f509b76f5506ca51ca2a5170221aa72f62516a9
Author: jan Iversen 
Date:   Tue May 16 19:41:16 2017 +0200

esc-report, restrict gerrit auth to committer list

diff --git a/esc-reporting/esc-collect.py b/esc-reporting/esc-collect.py
index f003fcc..685e673 100755
--- a/esc-reporting/esc-collect.py
+++ b/esc-reporting/esc-collect.py
@@ -559,11 +559,11 @@ def get_gerrit(cfg):
 searchDate, rawList = util_load_data_file(cfg, fileName, 'gerrit', 
{'patch': {}, 'committers' : []})
 print("Updating gerrit dump from " + rawList['newest-entry'])
 
-urlBase = 'https://gerrit.libreoffice.org/a/'
+urlBase = 'https://gerrit.libreoffice.org/'
 uid = cfg['gerrit']['user']
 upw = cfg['gerrit']['password']
 rawList['committers'] = []
-tmp = util_load_url(urlBase + 'groups/Committers/members', uUser=uid, 
uPass=upw)
+tmp = util_load_url(urlBase + 'a/groups/Committers/members', uUser=uid, 
uPass=upw)
 for row in tmp:
   for i in 'username', 'email':
 if not i in row:
@@ -708,6 +708,11 @@ def runCfg(platform):
 
 def runBuild(cfg):
 try:
+  gerritData = get_gerrit(cfg)
+except Exception as e:
+  print('ERROR: get_gerrit failed with ' + str(e))
+  pass
+try:
   crashData = get_crash(cfg)
 except Exception as e:
   print('ERROR: get_crash failed with ' + str(e))
@@ -728,11 +733,6 @@ def runBuild(cfg):
   print('ERROR: get_esc_bugzilla failed with ' + str(e))
   pass
 try:
-  gerritData = get_gerrit(cfg)
-except Exception as e:
-  print('ERROR: get_gerrit failed with ' + str(e))
-  pass
-try:
   gitData = get_git(cfg)
 except Exception as e:
   print('ERROR: get_git failed with ' + str(e))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: helpcontent2

2017-05-16 Thread Olivier Hallot
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9c613898532510c85a118f3081bfc06cf6572683
Author: Olivier Hallot 
Date:   Tue May 16 14:35:31 2017 -0300

Updated core
Project: help  ab17f13c6d60d2d6ad7ff6ce3734ba81c77f881d

Mute L10n in some  lines

Change-Id: I2503568589b869b717f5c997434340d00892a275
Reviewed-on: https://gerrit.libreoffice.org/37687
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index fd99f1798a44..ab17f13c6d60 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit fd99f1798a440ccdfb34e910285a7c5c9a9ff08d
+Subproject commit ab17f13c6d60d2d6ad7ff6ce3734ba81c77f881d
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] help.git: source/text

2017-05-16 Thread Olivier Hallot
 source/text/sbasic/shared/03103800.xhp |   18 +-
 source/text/sbasic/shared/03103900.xhp |   20 ++--
 2 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit ab17f13c6d60d2d6ad7ff6ce3734ba81c77f881d
Author: Olivier Hallot 
Date:   Tue May 16 14:35:31 2017 -0300

Mute L10n in some  lines

Change-Id: I2503568589b869b717f5c997434340d00892a275
Reviewed-on: https://gerrit.libreoffice.org/37687
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/source/text/sbasic/shared/03103800.xhp 
b/source/text/sbasic/shared/03103800.xhp
index eb3475225..75400f3e9 100644
--- a/source/text/sbasic/shared/03103800.xhp
+++ b/source/text/sbasic/shared/03103800.xhp
@@ -38,24 +38,24 @@
 
 For example, 
the following command:
 
-MyObj.Prop1.Command = 5
+MyObj.Prop1.Command = 5
 
 corresponds to 
the command block:
 
-Dim ObjVar as 
Object
-Dim ObjProp as 
Object
-ObjName As 
String = "MyObj"
-ObjVar = 
FindObject( ObjName As String )
-PropName As 
String = "Prop1"
-ObjProp = 
FindPropertyObject( ObjVar, PropName As String )
-ObjProp.Command 
= 5
+Dim ObjVar as Object
+Dim ObjProp as Object
+ObjName As String = "MyObj"
+ObjVar = FindObject( ObjName As String )
+PropName As String = "Prop1"
+ObjProp = FindPropertyObject( ObjVar, PropName As String 
)
+ObjProp.Command = 5
 
 This allows 
names to be dynamically created at run-time. For example:
 "TextEdit1" to 
TextEdit5" in a loop to create five control names.
 See also: 
FindPropertyObject
 Syntax:
 
-FindObject( 
ObjName As String )
+FindObject( ObjName As String )
 
 Parameters:
 
diff --git a/source/text/sbasic/shared/03103900.xhp 
b/source/text/sbasic/shared/03103900.xhp
index 127da9c65..5ec50e594 100644
--- a/source/text/sbasic/shared/03103900.xhp
+++ b/source/text/sbasic/shared/03103900.xhp
@@ -38,24 +38,24 @@
 
 For instance, 
the command:
 
-   MyObj.Prop1.Command = 5
+   MyObj.Prop1.Command = 5
 
-corresponds to 
the following command block:
+corresponds to 
the following command block:
 
-Dim ObjVar as 
Object
-Dim ObjProp as 
Object
-ObjName As 
String = "MyObj"
-ObjVar = 
FindObject( ObjName As String )
-PropName As 
String = "Prop1"
-ObjProp = 
FindPropertyObject( ObjVar, PropName As String )
-ObjProp.Command 
= 5
+Dim ObjVar as Object
+Dim ObjProp as Object
+ObjName As String = "MyObj"
+ObjVar = FindObject( ObjName As String )
+PropName As String = "Prop1"
+ObjProp = FindPropertyObject( ObjVar, PropName As String 
)
+ObjProp.Command = 5
 
 To dynamically 
create Names at run-time, use:
 "TextEdit1" to 
TextEdit5" in a loop to create five names.
 See also: 
FindObject
 Syntax:
 
-FindPropertyObject( ObjVar, PropName As String )
+FindPropertyObject( ObjVar, PropName As String )
 
 Parameters:
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-05-16 Thread Miklos Vajna
 sw/qa/extras/ooxmlexport/data/tdf107889.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx|8 ++
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |3 ++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx|2 +
 writerfilter/source/dmapper/DomainMapper_Impl.hxx|5 
 writerfilter/source/dmapper/PropertyMap.cxx  |   18 ++-
 writerfilter/source/dmapper/PropertyMap.hxx  |2 -
 7 files changed, 31 insertions(+), 7 deletions(-)

New commits:
commit 659c0227a50d298780d72902314e03df8824bc06
Author: Miklos Vajna 
Date:   Tue May 16 15:26:53 2017 +0200

tdf#107889 DOCX import: consider page breaks for multi-page floattables

This is the DOCX equivalent of commit
6aba29576df7a2a40e54040d4dd09d94d6594741 (tdf#107773 DOC import:
consider page breaks for multi-page floattables, 2017-05-11): a specific
case where it's clearly superior to import a multi-page floating table
as a multi-page one, rather than a floating one.

Change-Id: I71a92d2b10e52e505665831caacad2948d22b4e1
Reviewed-on: https://gerrit.libreoffice.org/37683
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf107889.docx 
b/sw/qa/extras/ooxmlexport/data/tdf107889.docx
new file mode 100644
index ..452c4aa13063
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf107889.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 73077b4fe40a..ce8a77a02c8c 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -499,6 +499,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf100072, "tdf100072.docx")
 CPPUNIT_ASSERT(getShape(1)->getPosition().X > 0);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf107889, "tdf107889.docx")
+{
+uno::Reference xDrawPageSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xDrawPage = 
xDrawPageSupplier->getDrawPage();
+// This was 1, multi-page table was imported as a floating one.
+CPPUNIT_ASSERT_EQUAL(static_cast(0), xDrawPage->getCount());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx 
b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 7ed678863e37..db2c4fa4d5c9 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -1178,6 +1178,9 @@ void DomainMapperTableHandler::endTable(unsigned int 
nestedTableLevel, bool bTab
 xTextAppendAndConvert->convertToTextFrame(xStart, xEnd, 
comphelper::containerToSequence(aFrameProperties));
 }
 }
+
+// We're right after a table conversion.
+m_rDMapper_Impl.m_bConvertedTable = true;
 }
 
 m_aTableProperties.reset();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index af1991b67e44..fc076998fa9b 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1227,6 +1227,8 @@ void DomainMapper_Impl::finishParagraph( const 
PropertyMapPtr& pPropertyMap )
 
 xTextRange = xTextAppend->finishParagraph( 
comphelper::containerToSequence(aProperties) );
 m_xPreviousParagraph.set(xTextRange, uno::UNO_QUERY);
+// We're no longer right after a table conversion.
+m_bConvertedTable = false;
 
 if (xCursor.is())
 {
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index b43d310db917..65274fcc7d46 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -308,6 +308,8 @@ struct FloatingTableInfo
 css::uno::Reference m_xEnd;
 css::uno::Sequence m_aFrameProperties;
 sal_Int32 m_nTableWidth;
+/// Break type of the section that contains this table.
+sal_Int32 m_nBreakType = -1;
 
 FloatingTableInfo(css::uno::Reference const& xStart,
 css::uno::Reference const& xEnd,
@@ -753,6 +755,9 @@ public:
 
 DeletableTabStopm_aCurrentTabStop;
 
+/// If we're right after the end of a table.
+bool m_bConvertedTable = false;
+
 bool IsOOXMLImport() const { return m_eDocumentType == 
SourceDocumentType::OOXML; }
 
 bool IsRTFImport() const { return m_eDocumentType == 
SourceDocumentType::RTF; }
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx 
b/writerfilter/source/dmapper/PropertyMap.cxx
index 8e308940e7e0..3df7c864cd55 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1021,12 +1021,17 @@ void SectionPropertyMap::HandleMargins

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

2017-05-16 Thread Marco Cecchetti
 include/sfx2/lokhelper.hxx |2 --
 sc/source/ui/inc/tabvwsh.hxx   |2 ++
 sc/source/ui/view/tabvwshc.cxx |   17 +
 sc/source/ui/view/viewfunc.cxx |   24 +++-
 sfx2/source/view/lokhelper.cxx |   11 ---
 5 files changed, 34 insertions(+), 22 deletions(-)

New commits:
commit d849231dd2064ebed96d17bf54286a33954304ab
Author: Marco Cecchetti 
Date:   Tue May 2 10:20:11 2017 +0200

lok: sc: make row/col header updating, on row/col operations, tab-aware

Now, on inserting/removing or resizing a row/col, the row/col header
invalidation callback is notified to another view only if it is
displaying the same tab of the view where the row/col operation is
occurring.

Conflicts:
sc/source/ui/view/tabvwshc.cxx

Change-Id: Ic65fd82b2e3009420c7b481e7e8c1ff8bb11bcce
Reviewed-on: https://gerrit.libreoffice.org/37241
Tested-by: Jenkins 
Reviewed-by: Marco Cecchetti 

diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 4dc088d64d59..669d0f78d226 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -42,8 +42,6 @@ public:
 static void notifyOtherView(SfxViewShell* pThisView, SfxViewShell* 
pOtherView, int nType, const OString& rKey, const OString& rPayload);
 /// Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to 
setOptionalFeatures() if needed.
 static void notifyInvalidation(SfxViewShell* pThisView, const OString& 
rPayload);
-/// Emits a LOK_CALLBACK_INVALIDATE_HEADER for all views.
-static void notifyAllViewsHeaderInvalidation(const OString& rPayload);
 /// A special value to signify 'infinity'.
 /// This value is chosen such that sal_Int32 will not overflow when 
manipulated.
 static const long MaxTwips = 1e9;
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index c08e4ee2a08f..e138c35aca4c 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -394,6 +394,8 @@ public:
 void afterCallbackRegistered() override;
 /// See SfxViewShell::NotifyCursor().
 void NotifyCursor(SfxViewShell* pViewShell) const override;
+/// Emits a LOK_CALLBACK_INVALIDATE_HEADER for all views whose current tab 
is equal to nCurrentTabIndex
+static void notifyAllViewsHeaderInvalidation(const OString& rPayload, 
SCTAB nCurrentTabIndex = -1);
 };
 
 #endif
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 20d02dd9a1ea..7cbcaed65b9b 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -77,6 +77,9 @@
 
 #include "PivotLayoutDialog.hxx"
 
+#include 
+#include 
+
 void ScTabViewShell::SetCurRefDlgId( sal_uInt16 nNew )
 {
 //  CurRefDlgId is stored in ScModule to find if a ref dialog is open,
@@ -543,6 +546,20 @@ void ScTabViewShell::NotifyCursor(SfxViewShell* 
pOtherShell) const
 pWin->updateLibreOfficeKitCellCursor(pOtherShell);
 }
 
+void ScTabViewShell::notifyAllViewsHeaderInvalidation(const OString& rPayload, 
SCTAB nCurrentTabIndex)
+{
+SfxViewShell* pViewShell = SfxViewShell::GetFirst();
+while (pViewShell)
+{
+ScTabViewShell* pTabViewShell = 
dynamic_cast(pViewShell);
+if (pTabViewShell && (nCurrentTabIndex == -1 || 
pTabViewShell->getPart() == nCurrentTabIndex))
+{
+
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_HEADER, 
rPayload.getStr());
+}
+pViewShell = SfxViewShell::GetNext(*pViewShell);
+}
+}
+
 bool ScTabViewShell::UseSubTotal(ScRangeList* pRangeList)
 {
 bool bSubTotal = false;
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index f6a3c1084ffb..c0d8d028eb3d 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1478,11 +1478,14 @@ bool ScViewFunc::InsertCells( InsCellCmd eCmd, bool 
bRecord, bool bPartOfPaste )
 HelperNotifyChanges::NotifyIfChangesListeners(*pDocSh, aRange, 
aOperation);
 }
 
-if (bInsertCols)
-SfxLokHelper::notifyAllViewsHeaderInvalidation("column");
+if (comphelper::LibreOfficeKit::isActive())
+{
+if (bInsertCols)
+ScTabViewShell::notifyAllViewsHeaderInvalidation("column", 
GetViewData().GetTabNo());
 
-if (bInsertRows)
-SfxLokHelper::notifyAllViewsHeaderInvalidation("row");
+if (bInsertRows)
+ScTabViewShell::notifyAllViewsHeaderInvalidation("row", 
GetViewData().GetTabNo());
+}
 }
 return bSuccess;
 }
@@ -1550,11 +1553,14 @@ void ScViewFunc::DeleteCells( DelCellCmd eCmd )
 nCurY = aRange.aStart.Row();
 SetCursor( nCurX, nCurY );
 
-if (eCmd == DEL_DELCOLS)
-SfxLokHelper::notifyAllViewsHeaderInvalidation("column");
+if (comphelper::LibreOfficeKit::isActive())
+{
+

Re: [Firebird-devel] MacOS build fail "SSE4.2 instruction set not enabled"

2017-05-16 Thread Alex Peshkoff

On 05/12/17 22:13, Julien wrote:

I gave a try but had this:
lo/lode/dev/core/workdir/UnpackedTarball/firebird/src/common/CRC32C.cpp:41:10: 
error: always_inline function '_mm_crc32_u8' requires target feature 'sse4.1', 
but would be inlined into function 'CRC32C' that is compiled without support 
for 'sse4.1'
 return _mm_crc32_u8(hash_value, *value);
^
Are you sure msse4 shouldn't be added in CXXFLAGS instead of COMMON_FLAGS?


In linux COMMON_FLAGS is used and it appears to be correct choice from 
general POV - msse4 makes sense for both plain C & C++.
But what about darwin - yes, looks like it does not use COMMON_FLAGS at 
all, with CXXFLAGS this should work.


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


Re: Where is Python on Mac

2017-05-16 Thread Jens Tröger
Oh it's moved from Contents/MacOS/python to Contents/Resources/python.
And it's 3.5 now, too.  Thanks!

Jens


On Mon, May 15, 2017 at 10:07:28AM +0200, Stephan Bergmann wrote:
> On 05/12/2017 03:44 PM, Jens Tröger wrote:
> > I have noticed that the past few drops of LO for Mac do not ship with a 
> > Python 3 interpreter anymore, but seem to contain Uno related resources.
> 
> LO should still come with a bundled Python, but what might fool you is 
> 
>  
> "put python starter shell script to Resources folder of OS X app" (for 
> which Andras should thus know any details).

-- 
Jens Tröger
http://savage.light-speed.de/
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2017-05-16 Thread Stephan Bergmann
 sc/source/ui/undo/undoblk.cxx  |   14 --
 sc/source/ui/undo/undoblk2.cxx |   10 +-
 2 files changed, 1 insertion(+), 23 deletions(-)

New commits:
commit 7f2d6d8480f06434a1b5bc748ac2f3f80b2e71cb
Author: Stephan Bergmann 
Date:   Tue May 16 18:23:32 2017 +0200

Revert "lok: sc: invalidate col/row header on undo row/col operations"

This reverts commit 76d47e6f63e11d3509339ade6203757d63582d21, breaks the 
build.

diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 1c2757c40897..291151d11a6d 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -23,8 +23,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 
 #include "undoblk.hxx"
 #include "undoutil.hxx"
@@ -259,19 +257,7 @@ void ScUndoInsertCells::DoChange( const bool bUndo )
 }
 pDocShell->PostDataChanged();
 if (pViewShell)
-{
 pViewShell->CellContentChanged();
-
-if (comphelper::LibreOfficeKit::isActive())
-{
-if (eCmd == INS_INSCOLS_BEFORE || eCmd == INS_INSCOLS_AFTER || 
eCmd == INS_CELLSRIGHT)
-ScTabViewShell::notifyAllViewsHeaderInvalidation("column",  
pViewShell->GetViewData().GetTabNo());
-
-if (eCmd == INS_INSROWS_BEFORE || eCmd == INS_INSROWS_AFTER || 
eCmd == INS_CELLSDOWN)
-ScTabViewShell::notifyAllViewsHeaderInvalidation("row",  
pViewShell->GetViewData().GetTabNo());
-}
-
-}
 }
 
 void ScUndoInsertCells::Undo()
diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx
index cdf75b9f1882..50404d5e09fc 100644
--- a/sc/source/ui/undo/undoblk2.cxx
+++ b/sc/source/ui/undo/undoblk2.cxx
@@ -30,8 +30,6 @@
 
 #include "undoolk.hxx"
 
-#include 
-#include 
 
 /** Change column widths or row heights */
 ScUndoWidthOrHeight::ScUndoWidthOrHeight( ScDocShell* pNewDocShell,
@@ -96,7 +94,6 @@ void ScUndoWidthOrHeight::Undo()
 if (pUndoTab)   // Outlines are 
included when saving ?
 rDoc.SetOutlineTable( nStartTab, pUndoTab );
 
-ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
 SCTAB nTabCount = rDoc.GetTableCount();
 ScMarkData::iterator itr = aMarkData.begin(), itrEnd = aMarkData.end();
 for (; itr != itrEnd && *itr < nTabCount; ++itr)
@@ -120,6 +117,7 @@ void ScUndoWidthOrHeight::Undo()
 
 DoSdrUndoAction( pDrawUndo, &rDoc );
 
+ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
 if (pViewShell)
 {
 pViewShell->UpdateScrollBars();
@@ -127,12 +125,6 @@ void ScUndoWidthOrHeight::Undo()
 SCTAB nCurrentTab = pViewShell->GetViewData().GetTabNo();
 if ( nCurrentTab < nStartTab || nCurrentTab > nEndTab )
 pViewShell->SetTabNo( nStartTab );
-
-if (comphelper::LibreOfficeKit::isActive())
-{
-OString aPayload = bWidth ? "column" : "row";
-ScTabViewShell::notifyAllViewsHeaderInvalidation(aPayload, 
pViewShell->GetViewData().GetTabNo());
-}
 }
 
 EndUndo();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: wsd/Admin.cpp

2017-05-16 Thread Aditya Dewan
 wsd/Admin.cpp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f94b42d9a8de3c0f9269fc94659707e147d04512
Author: Aditya Dewan 
Date:   Tue May 16 15:43:57 2017 +0530

tdf#107762 admin-console: memory graph in 'Analytics' tab now working

Change-Id: I6a0ee82e813e80344eaf6ddb7d46eebed98ca5bb
Reviewed-on: https://gerrit.libreoffice.org/37672
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/wsd/Admin.cpp b/wsd/Admin.cpp
index 700b860b..8e899d26 100644
--- a/wsd/Admin.cpp
+++ b/wsd/Admin.cpp
@@ -327,7 +327,7 @@ void Admin::pollingThread()
 cpuWait += _cpuStatsTaskIntervalMs;
 }
 int memWait = _memStatsTaskIntervalMs -
-std::chrono::duration_cast(now - 
lastCPU).count();
+std::chrono::duration_cast(now - 
lastMem).count();
 if (memWait <= 0)
 {
 const auto totalMem = getTotalMemoryUsage();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - wsd/LOOLWSD.cpp

2017-05-16 Thread Ashod Nakashian
 wsd/LOOLWSD.cpp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d4b202fe4979832fe1f292735726f10b2b9f2330
Author: Ashod Nakashian 
Date:   Sun May 7 23:23:02 2017 -0400

wsd: build fix due to merge error

Change-Id: Ib1d7ce1b880c71b0b2fd8262a92e7e965211653e
Reviewed-on: https://gerrit.libreoffice.org/37375
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 5b3ac378..a889e42a 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -1460,7 +1460,7 @@ private:
 if (jailId.empty())
 {
 LOG_ERR("Invalid JailId in child URI [" << request.getURI() << 
"].");
-return SocketHandlerInterface::SocketOwnership::UNCHANGED;
+return;
 }
 
 in.clear();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: compilerplugins/clang sal/osl sal/qa

2017-05-16 Thread Stephan Bergmann
 compilerplugins/clang/comparisonwithconstant.cxx |4 +-
 sal/osl/unx/file.cxx |   40 +++
 sal/osl/unx/file_misc.cxx|   16 -
 sal/osl/unx/file_path_helper.cxx |8 ++--
 sal/osl/unx/file_stat.cxx|2 -
 sal/osl/unx/file_url.cxx |4 +-
 sal/osl/unx/nlsupport.cxx|2 -
 sal/osl/unx/pipe.cxx |2 -
 sal/osl/unx/process.cxx  |2 -
 sal/osl/unx/socket.cxx   |2 -
 sal/osl/unx/tempfile.cxx |4 +-
 sal/qa/osl/process/osl_process.cxx   |2 -
 sal/qa/osl/process/osl_process_child.cxx |2 -
 13 files changed, 45 insertions(+), 45 deletions(-)

New commits:
commit 189c3a098e0ee5b64e2ab40c3980a2a654315468
Author: Stephan Bergmann 
Date:   Tue May 16 17:19:11 2017 +0200

Extend loplugin:comparisonwithconstant beyond integral types

Change-Id: Id3a8fd5d8b9975d3ae49af0648b39454310495fa

diff --git a/compilerplugins/clang/comparisonwithconstant.cxx 
b/compilerplugins/clang/comparisonwithconstant.cxx
index c0fe91f9508c..cf721a83c4e3 100644
--- a/compilerplugins/clang/comparisonwithconstant.cxx
+++ b/compilerplugins/clang/comparisonwithconstant.cxx
@@ -58,10 +58,10 @@ bool ComparisonWithConstant::VisitBinaryOperator(const 
BinaryOperator* binaryOp)
 return true;
 }
 APValue result;
-if (!binaryOp->getLHS()->isIntegerConstantExpr(compiler.getASTContext())) {
+if (!binaryOp->getLHS()->isEvaluatable(compiler.getASTContext())) {
 return true;
 }
-if (binaryOp->getRHS()->isIntegerConstantExpr(compiler.getASTContext())) {
+if (binaryOp->getRHS()->isEvaluatable(compiler.getASTContext())) {
 return true;
 }
 if (!rewrite(binaryOp))
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 933780f87d8f..9d7b31d3a7d4 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -197,7 +197,7 @@ FileHandle_Impl::Allocator::Allocator()
 {
 m_cache  = rtl_cache_create (
 "osl_file_buffer_cache", pagesize, 0, nullptr, nullptr, nullptr, 
nullptr, nullptr, 0);
-if (nullptr != m_cache)
+if (m_cache != nullptr)
 m_bufsiz = pagesize;
 }
 }
@@ -210,7 +210,7 @@ FileHandle_Impl::Allocator::~Allocator()
 void FileHandle_Impl::Allocator::allocate (sal_uInt8 ** ppBuffer, size_t * 
pnSize)
 {
 OSL_PRECOND((nullptr != ppBuffer) && (nullptr != pnSize), 
"FileHandle_Impl::Allocator::allocate(): contract violation");
-if ((nullptr != ppBuffer) && (nullptr != pnSize))
+if ((ppBuffer != nullptr) && (pnSize != nullptr))
 {
 *ppBuffer = static_cast< sal_uInt8* >(rtl_cache_alloc(m_cache));
 *pnSize = m_bufsiz;
@@ -218,7 +218,7 @@ void FileHandle_Impl::Allocator::allocate (sal_uInt8 ** 
ppBuffer, size_t * pnSiz
 }
 void FileHandle_Impl::Allocator::deallocate (sal_uInt8 * pBuffer)
 {
-if (nullptr != pBuffer)
+if (pBuffer != nullptr)
 rtl_cache_free (m_cache, pBuffer);
 }
 
@@ -251,7 +251,7 @@ FileHandle_Impl::FileHandle_Impl (int fd, enum Kind kind, 
char const * path)
 rtl_string_newFromStr (&m_strFilePath, path);
 if (m_kind == KIND_FD) {
 Allocator::get().allocate (&m_buffer, &m_bufsiz);
-if (nullptr != m_buffer)
+if (m_buffer != nullptr)
 memset (m_buffer, 0, m_bufsiz);
 }
 }
@@ -431,7 +431,7 @@ oslFileError FileHandle_Impl::readFileAt (
 *pBytesRead = nBytes;
 return osl_File_E_None;
 }
-if (m_kind == KIND_MEM || nullptr == m_buffer)
+if (m_kind == KIND_MEM || m_buffer == nullptr)
 {
 // not buffered
 return readAt (nOffset, pBuffer, nBytesRequested, pBytesRead);
@@ -504,7 +504,7 @@ oslFileError FileHandle_Impl::writeFileAt (
 *pBytesWritten = nBytes;
 return osl_File_E_None;
 }
-if (nullptr == m_buffer)
+if (m_buffer == nullptr)
 {
 // not buffered
 return writeAt (nOffset, pBuffer, nBytesToWrite, pBytesWritten);
@@ -734,7 +734,7 @@ oslFileHandle osl::detail::createFileHandleFromFD( int fd )
 return nullptr; // EBADF
 
 FileHandle_Impl * pImpl = new FileHandle_Impl (fd);
-if (nullptr == pImpl)
+if (pImpl == nullptr)
 return nullptr; // ENOMEM
 
 // assume writeable
@@ -1107,7 +1107,7 @@ SAL_CALL osl_syncFile(oslFileHandle Handle)
 {
 FileHandle_Impl* pImpl = static_cast(Handle);
 
-if ((nullptr == pImpl) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && 
(pImpl->m_fd == -1)))
+if ((pImpl == nullptr) || ((pImpl->m_kind == FileHandle_Impl::KIND_FD) && 
(pImpl->m_fd == -1)))
 return osl_File_E_INVAL;
 
 if (pImpl->m_kind == FileHandle_Impl::KIND_MEM)
@@ -1138,7 +1138,7 @@ SAL_CALL osl_mapFile (
 {
 FileHandle_Impl* pImpl = static_cast(Handle);
 
-if ((nullptr ==

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - loleaflet/src

2017-05-16 Thread Pranav Kant
 loleaflet/src/layer/AnnotationManager.js |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 05e674231530b87fdc5bc3a35a89b6a1c53c
Author: Pranav Kant 
Date:   Tue Apr 25 21:04:46 2017 +0530

loleaflet: Warn, and don't crash, if we don't get expected data

It is possible that backend sends comment for which there is no parent
comment sent yet, as presently is the case as I am writing this. Warn
nicely in this case.

Change-Id: I2609dfdcdac69380b824d444ba8f64803996286c

diff --git a/loleaflet/src/layer/AnnotationManager.js 
b/loleaflet/src/layer/AnnotationManager.js
index 7fee34a6..cd55ae15 100644
--- a/loleaflet/src/layer/AnnotationManager.js
+++ b/loleaflet/src/layer/AnnotationManager.js
@@ -476,6 +476,11 @@ L.AnnotationManager = L.Class.extend({
adjustParentAdd: function(comment) {
if (comment.parent && comment.parent > '0') {
var parentIdx = this.getIndexOf(comment.parent);
+   if (parentIdx === -1) {
+   console.warn('adjustParentAdd: No parent 
comment to attach received comment to. ' +
+'Parent comment ID sought is :' + 
comment.parent + ' for current comment with ID : ' + comment.id);
+   return;
+   }
if (this._items[parentIdx + 1] && this._items[parentIdx 
+ 1]._data.parent === this._items[parentIdx]._data.id) {
this._items[parentIdx + 1]._data.parent = 
comment.id;
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - 3 commits - loleaflet/main.js loolwsd.spec.in Makefile.am net/loolnb.cpp

2017-05-16 Thread Jan Holesovsky
 Makefile.am   |6 +
 loleaflet/main.js |2 
 loolwsd.spec.in   |4 
 net/loolnb.cpp|  264 --
 4 files changed, 10 insertions(+), 266 deletions(-)

New commits:
commit 83d5e878e0fb3c343c96576a7e378a8f18f9c62f
Author: Jan Holesovsky 
Date:   Tue May 16 17:07:24 2017 +0200

Add a missing semicolon.

Change-Id: I899503f9f1627cf07812f517923138a619195d7e

diff --git a/loleaflet/main.js b/loleaflet/main.js
index 7b080577..fac14aaa 100644
--- a/loleaflet/main.js
+++ b/loleaflet/main.js
@@ -1,6 +1,6 @@
 // If not debug, don't print anything on the console
 // except in tile debug mode (Ctrl-Shift-Alt-d)
-console.log2 = console.log
+console.log2 = console.log;
 if (loleaflet_logging !== 'true') {
var methods = ['warn', 'info', 'debug', 'trace', 'log', 'assert', 
'time', 'timeEnd'];
for (var i = 0; i < methods.length; i++) {
commit 0033a7ffd6ba875785cb210c1282d8e7087178d6
Author: Michael Meeks 
Date:   Fri May 5 18:53:00 2017 +0100

loolnb - kill obsolete test app.

Change-Id: I5943cc0752f16d62d6eedf96351bb6f71a2311e6

diff --git a/Makefile.am b/Makefile.am
index 83f6f455..0ccabbae 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -81,7 +81,6 @@ noinst_PROGRAMS = clientnb \
   connect \
   lokitclient \
   loolforkit-nocaps \
-  loolnb \
   loolwsd_fuzzer
 
 connect_SOURCES = tools/Connect.cpp \
diff --git a/net/loolnb.cpp b/net/loolnb.cpp
deleted file mode 100644
index e268b067..
--- a/net/loolnb.cpp
+++ /dev/null
@@ -1,264 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include "config.h"
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include "Socket.hpp"
-#include "ServerSocket.hpp"
-#if ENABLE_SSL
-#include "SslSocket.hpp"
-#endif
-#include "WebSocketHandler.hpp"
-
-using Poco::MemoryInputStream;
-using Poco::StringTokenizer;
-
-constexpr int HttpPortNumber = 9191;
-constexpr int SslPortNumber = 9193;
-
-class SimpleResponseClient : public WebSocketHandler
-{
-public:
-SimpleResponseClient() : WebSocketHandler()
-{
-}
-
-virtual void handleIncomingMessage(SocketDisposition &disposition) override
-{
-LOG_TRC("incoming WebSocket message");
-if (_wsState == WSState::HTTP)
-{
-auto socket = _socket.lock();
-
-int number = 0;
-Poco::MemoryInputStream message(&socket->_inBuffer[0], 
socket->_inBuffer.size());
-Poco::Net::HTTPRequest req;
-req.read(message);
-
-// if we succeeded - remove that from our input buffer
-// FIXME: We should check if this is GET or POST. For GET, we only
-// can have a single request (headers only). For POST, we 
can/should
-// use Poco HTMLForm to parse the post message properly.
-// Otherwise, we should catch exceptions from the previous 
read/parse
-// and assume we don't have sufficient data, so we wait some more.
-socket->_inBuffer.clear();
-
-LOG_DBG("URI: " << req.getURI());
-
-Poco::StringTokenizer tokens(req.getURI(), "/?");
-if (tokens.count() == 4)
-{
-std::string subpool = tokens[2];
-number = std::stoi(tokens[3]);
-
-// complex algorithmic core:
-number = number + 1;
-
-std::string numberString = std::to_string(number);
-std::ostringstream oss;
-oss << "HTTP/1.1 200 OK\r\n"
-<< "Date: Once, Upon a time GMT\r\n" // Mon, 27 Jul 2009 
12:28:53 GMT
-<< "Server: madeup string (Linux)\r\n"
-<< "Content-Length: " << numberString.size() << "\r\n"
-<< "Content-Type: text/plain\r\n"
-<< "Connection: Closed\r\n"
-<< "\r\n"
-<< numberString;
-
-std::string str = oss.str();
-socket->_outBuffer.insert(socket->_outBuffer.end(), 
str.begin(), str.end());
-return;
-}
-else if (tokens.count() == 2 && tokens[1] == "ws")
-{
-upgradeToWebSocket(req);
-return;
-}
-}
-
-WebSocketHandler::handleIncomingMessage(disposition);
-}
-
-virtual void handleMessage(const bool fin, const WSOpCode code, 
std::vector &data) override
-{
-std::cerr 

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - loleaflet/dist loleaflet/main.js loleaflet/src loolwsd.xml.in wsd/FileServer.cpp wsd/LOOLWSD.cpp

2017-05-16 Thread Ashod Nakashian
 loleaflet/dist/loleaflet.html |2 ++
 loleaflet/main.js |   18 ++
 loleaflet/src/map/Map.js  |6 ++
 loolwsd.xml.in|5 +
 wsd/FileServer.cpp|4 
 wsd/LOOLWSD.cpp   |2 ++
 6 files changed, 25 insertions(+), 12 deletions(-)

New commits:
commit 1134a1440dbf7114bbd32472f910b49849ff60ce
Author: Ashod Nakashian 
Date:   Thu May 11 00:02:38 2017 -0400

Configurable timeouts

Timeouts to dimming the doc in the browser
are now configurable from WSD and is relayed
to loleflet as expected.

Out of focus timeout is now 60 seconds.

Change-Id: I8452e30976f6a81b0c3bb3ba5774daa244c1640c
Reviewed-on: https://gerrit.libreoffice.org/37489
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/loleaflet/dist/loleaflet.html b/loleaflet/dist/loleaflet.html
index bfa9ad3e..0d587090 100644
--- a/loleaflet/dist/loleaflet.html
+++ b/loleaflet/dist/loleaflet.html
@@ -87,6 +87,8 @@
   window.access_token = '%ACCESS_TOKEN%';
   window.access_token_ttl = '%ACCESS_TOKEN_TTL%';
   window.loleaflet_logging = '%LOLEAFLET_LOGGING%';
+  window.outOfFocusTimeoutSecs = %OUT_OF_FOCUS_TIMEOUT_SECS%;
+  window.idleTimeoutSecs = %IDLE_TIMEOUT_SECS%;
 
  
 
diff --git a/loleaflet/main.js b/loleaflet/main.js
index 4f32fce3..7b080577 100644
--- a/loleaflet/main.js
+++ b/loleaflet/main.js
@@ -102,15 +102,17 @@ if (wopiSrc != '') {
 
 document.title = title;
 var map = L.map('map', {
-server: host,
-doc: docURL,
-docParams: docParams,
-permission: permission,
-timestamp: timestamp,
-documentContainer: 'document-container',
-debug: debugMode,
+   server: host,
+   doc: docURL,
+   docParams: docParams,
+   permission: permission,
+   timestamp: timestamp,
+   documentContainer: 'document-container',
+   debug: debugMode,
wopi: isWopi,
-   alwaysActive: alwaysActive
+   alwaysActive: alwaysActive,
+   idleTimeoutSecs: idleTimeoutSecs,  // Dim when user is idle.
+   outOfFocusTimeoutSecs: outOfFocusTimeoutSecs, // Dim after switching 
tabs.
 });
 // toolbar.js (loaded in 

[Libreoffice-commits] core.git: compilerplugins/clang include/osl sal/osl sal/qa

2017-05-16 Thread Stephan Bergmann
 compilerplugins/clang/comparisonwithconstant.cxx |   50 ++-
 include/osl/file.hxx |   12 ++---
 sal/osl/unx/pipe.cxx |2 
 sal/osl/unx/socket.cxx   |2 
 sal/osl/unx/tempfile.cxx |   20 -
 sal/osl/unx/thread.cxx   |2 
 sal/qa/osl/file/osl_File.cxx |   28 ++--
 sal/qa/osl/file/osl_old_test_file.cxx|6 +-
 sal/qa/osl/pipe/osl_Pipe.cxx |2 
 sal/qa/osl/process/osl_process.cxx   |2 
 sal/qa/osl/process/osl_process_child.cxx |4 -
 11 files changed, 80 insertions(+), 50 deletions(-)

New commits:
commit e85fcef1af0c96b0e8334bd7b6256e0b02810e43
Author: Stephan Bergmann 
Date:   Tue May 16 16:49:03 2017 +0200

Try to fix loplugin:comparisonwithconstant's rewrite-with-macros issue

...that had plagued 2e293a731c1559c9869dfcb32491bc600fc18e4e "new
loplugin/rewriter comparisonwithconstant" (in sal/osl/unx/pipe.cxx), and
auto-rewrite the remaining occurrences in sal (that the mentioned commit had
failed to address, for whatever reason)

Change-Id: I3dc3bae8dd92ba8bf576f6e06e7c9ee21f883661

diff --git a/compilerplugins/clang/comparisonwithconstant.cxx 
b/compilerplugins/clang/comparisonwithconstant.cxx
index b4ced1e70f23..c0fe91f9508c 100644
--- a/compilerplugins/clang/comparisonwithconstant.cxx
+++ b/compilerplugins/clang/comparisonwithconstant.cxx
@@ -36,7 +36,8 @@ public:
 bool VisitBinaryOperator(const BinaryOperator *);
 private:
 bool rewrite(const BinaryOperator *);
-std::string getExprAsString(const Expr* expr);
+std::string getExprAsString(SourceRange range);
+SourceRange ignoreMacroExpansions(SourceRange range);
 };
 
 bool ComparisonWithConstant::VisitBinaryOperator(const BinaryOperator* 
binaryOp)
@@ -78,11 +79,18 @@ bool ComparisonWithConstant::rewrite(const BinaryOperator * 
binaryOp) {
 if (rewriter == nullptr) {
 return false;
 }
-const Expr* LHS = binaryOp->getLHS();
-const Expr* RHS = binaryOp->getRHS();
 
-const std::string lhsString = getExprAsString(LHS);
-const std::string rhsString = getExprAsString(RHS);
+auto lhsRange = 
ignoreMacroExpansions(binaryOp->getLHS()->getSourceRange());
+if (!lhsRange.isValid()) {
+return false;
+}
+auto rhsRange = 
ignoreMacroExpansions(binaryOp->getRHS()->getSourceRange());
+if (!rhsRange.isValid()) {
+return false;
+}
+
+const std::string lhsString = getExprAsString(lhsRange);
+const std::string rhsString = getExprAsString(rhsRange);
 
 /* we can't safely move around stuff containing comments, we mess up the 
resulting code */
 if ( lhsString.find("/*") != std::string::npos || lhsString.find("//") != 
std::string::npos ) {
@@ -94,10 +102,10 @@ bool ComparisonWithConstant::rewrite(const BinaryOperator 
* binaryOp) {
 
 // switch LHS and RHS
 RewriteOptions opts;
-if (!replaceText(SourceRange(LHS->getLocStart(), LHS->getLocEnd()), 
rhsString)) {
+if (!replaceText(lhsRange, rhsString)) {
 return false;
 }
-if (!replaceText(SourceRange(RHS->getLocStart(), RHS->getLocEnd()), 
lhsString)) {
+if (!replaceText(rhsRange, lhsString)) {
 return false;
 }
 
@@ -105,17 +113,39 @@ bool ComparisonWithConstant::rewrite(const BinaryOperator 
* binaryOp) {
 }
 
 // get the expression contents
-std::string ComparisonWithConstant::getExprAsString(const Expr* expr)
+std::string ComparisonWithConstant::getExprAsString(SourceRange range)
 {
 SourceManager& SM = compiler.getSourceManager();
-SourceLocation startLoc = expr->getLocStart();
-SourceLocation endLoc = expr->getLocEnd();
+SourceLocation startLoc = range.getBegin();
+SourceLocation endLoc = range.getEnd();
 const char *p1 = SM.getCharacterData( startLoc );
 const char *p2 = SM.getCharacterData( endLoc );
 unsigned n = Lexer::MeasureTokenLength( endLoc, SM, 
compiler.getLangOpts());
 return std::string( p1, p2 - p1 + n);
 }
 
+SourceRange ComparisonWithConstant::ignoreMacroExpansions(SourceRange range) {
+if (range.getBegin().isMacroID()) {
+SourceLocation loc;
+if (Lexer::isAtStartOfMacroExpansion(
+range.getBegin(), compiler.getSourceManager(),
+compiler.getLangOpts(), &loc))
+{
+range.setBegin(loc);
+}
+}
+if (range.getEnd().isMacroID()) {
+SourceLocation loc;
+if (Lexer::isAtEndOfMacroExpansion(
+range.getEnd(), compiler.getSourceManager(),
+compiler.getLangOpts(), &loc))
+{
+range.setEnd(loc);
+}
+}
+return range.getBegin().isMacroID() || range.getEnd().isMacroID()
+? SourceRange() : range;
+}
 
 loplugin::Plugin::Registration< ComparisonWithConstant > 
X("comparisonwithco

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - wsd/Admin.cpp

2017-05-16 Thread Aditya Dewan
 wsd/Admin.cpp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3a4fb3f1fa137872800d835c9bcf25ec065c1d15
Author: Aditya Dewan 
Date:   Tue May 16 15:43:57 2017 +0530

tdf#107762 admin-console: memory graph in 'Analytics' tab now working

Change-Id: I6a0ee82e813e80344eaf6ddb7d46eebed98ca5bb
Reviewed-on: https://gerrit.libreoffice.org/37674
Reviewed-by: pranavk 
Tested-by: pranavk 

diff --git a/wsd/Admin.cpp b/wsd/Admin.cpp
index a9039f2b..3c51afcd 100644
--- a/wsd/Admin.cpp
+++ b/wsd/Admin.cpp
@@ -322,7 +322,7 @@ void Admin::pollingThread()
 cpuWait += _cpuStatsTaskIntervalMs;
 }
 int memWait = _memStatsTaskIntervalMs -
-std::chrono::duration_cast(now - 
lastCPU).count();
+std::chrono::duration_cast(now - 
lastMem).count();
 if (memWait <= 0)
 {
 const auto totalMem = getTotalMemoryUsage();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - loleaflet/dist loleaflet/src wsd/ClientSession.cpp wsd/DocumentBroker.cpp wsd/DocumentBroker.hpp wsd/protocol.txt

2017-05-16 Thread Pranav Kant
 loleaflet/dist/toolbar/toolbar.js|5 +-
 loleaflet/src/control/Control.Menubar.js |   10 ++--
 loleaflet/src/control/Toolbar.js |   12 -
 wsd/ClientSession.cpp|8 +++
 wsd/DocumentBroker.cpp   |   70 ---
 wsd/DocumentBroker.hpp   |6 +-
 wsd/protocol.txt |   10 +++-
 7 files changed, 67 insertions(+), 54 deletions(-)

New commits:
commit 41942b923cde9adfea679288f8a818e9e87b825f
Author: Pranav Kant 
Date:   Mon May 15 11:29:04 2017 +0530

wsd: Save wrapper over .uno:Save

Document broker needs to know when the save request is sent and when the
save finished. It uses these parameters to avoid shutting down document,
in the document broker main polling loop, if save is already going on.
But direct .uno:Save commands issued from
loleaflet precludes document broker to keep track of it - in this case a
.uno:Save command issued from loleaflet followed by shutting-down the
wsd will prevent saving the document to storage, if document is huge
enough and LO core takes a bit of time to save it. A save wrapper
command, 'save', ensures that document broker is aware of all such save
requests (_saveRequestTime member variable) and doesn't close the
document until we completely save it (to storage and other cleanups).

Change-Id: I5ec73d45adff23b2e7543e93dfd0624a5e5af46d
(cherry picked from commit 1cb75cbcb8c87481bf341c5ac058a36c13529dc8)
Reviewed-on: https://gerrit.libreoffice.org/37643
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/dist/toolbar/toolbar.js 
b/loleaflet/dist/toolbar/toolbar.js
index bc2d9cd0..11ad3244 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -218,6 +218,9 @@ function onClick(id, item, subItem) {
map.toggleCommandState(item.uno);
}
}
+   else if (id === 'save') {
+   map.save(true, true);
+   }
else if (id === 'repair') {
map._socket.sendMessage('commandvalues 
command=.uno:DocumentRepair');
}
@@ -451,7 +454,7 @@ $(function () {
name: 'toolbar-up',
items: [
{type: 'html', id: 'left'},
-   {type: 'button',  id: 'save', img: 'save', hint: 
_('Save'), uno: 'Save'},
+   {type: 'button',  id: 'save', img: 'save', hint: 
_('Save')},
{type: 'break', id: 'savebreak'},
{type: 'button',  id: 'undo',  img: 'undo', hint: 
_('Undo'), uno: 'Undo'},
{type: 'button',  id: 'redo',  img: 'redo', hint: 
_('Redo'), uno: 'Redo'},
diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 89048a3b..8206ab5c 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -8,7 +8,7 @@ L.Control.Menubar = L.Control.extend({
options: {
text:  [
{name: _('File'), id: 'file', type: 'menu', menu: [
-   {name: _('Save'), id: 'save', type: 
'unocommand', uno: '.uno:Save'},
+   {name: _('Save'), id: 'save', type: 'action'},
{name: _('Print'), id: 'print', type: 'action'},
{name: _('See revision history'), id: 
'rev-history', type: 'action'},
{name: _('Download as'), id: 'downloadas', 
type: 'menu', menu: [
@@ -172,7 +172,7 @@ L.Control.Menubar = L.Control.extend({
 
presentation: [
{name: _('File'), id: 'file', type: 'menu', menu: [
-   {name: _('Save'), id: 'save', type: 
'unocommand', uno: '.uno:Save'},
+   {name: _('Save'), id: 'save', type: 'action'},
{name: _('Print'), id: 'print', type: 'action'},
{name: _('See revision history'), id: 
'rev-history', type: 'action'},
{name: _('Download as'), id: 'downloadas', 
type: 'menu', menu: [
@@ -232,7 +232,7 @@ L.Control.Menubar = L.Control.extend({
 
spreadsheet: [
{name: _('File'), id: 'file', type: 'menu', menu: [
-   {name: _('Save'), id: 'save', type: 
'unocommand', uno: '.uno:Save'},
+   {name: _('Save'), id: 'save', type: 'action'},
{name: _('Print'), id: 'print', type: 'action'},
{name: _('See revision history'), id: 
'rev-history', type: 'action'},
{name: _('Download as'), id:'downloadas', type: 
'menu', menu: [
@@ -417,7 +417,9 @@ L.Control.Menubar = L.Control.extend({

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - wsd/Exceptions.hpp wsd/LOOLWSD.cpp wsd/Storage.cpp

2017-05-16 Thread Ashod Nakashian
 wsd/Exceptions.hpp |   15 ++
 wsd/LOOLWSD.cpp|  129 +++--
 wsd/Storage.cpp|3 -
 3 files changed, 93 insertions(+), 54 deletions(-)

New commits:
commit 5d6eebb15778569feb195149a81ab1fed91f17a6
Author: Ashod Nakashian 
Date:   Sun May 14 22:58:02 2017 -0400

wsd: handle WOPI access failure

Show the user that authorization failed.

Change-Id: Iad63c11ac2033eee80062ecd43dff76f776924c3
Reviewed-on: https://gerrit.libreoffice.org/37610
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 
(cherry picked from commit 6e63c80763ebbb8e41063358ce8b39c00f63b929)
Reviewed-on: https://gerrit.libreoffice.org/37613
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/wsd/Exceptions.hpp b/wsd/Exceptions.hpp
index b97263e5..11c9de59 100644
--- a/wsd/Exceptions.hpp
+++ b/wsd/Exceptions.hpp
@@ -58,6 +58,21 @@ public:
 using LoolException::LoolException;
 };
 
+/// An access-denied exception that is meant to signify
+/// a storage authentication error.
+class AccessDeniedException : public LoolException
+{
+public:
+using LoolException::LoolException;
+};
+
+/// A service-unavailable exception that is meant to signify
+/// an internal error.
+class ServiceUnavailableException : public LoolException
+{
+public:
+using LoolException::LoolException;
+};
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index da1e6535..a191cded 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2033,79 +2033,102 @@ private:
 // First Upgrade.
 WebSocketHandler ws(_socket, request);
 
-if (LOOLWSD::NumConnections >= MAX_CONNECTIONS)
+// Response to clients beyond this point is done via WebSocket.
+try
 {
-LOG_ERR("Limit on maximum number of connections of " << 
MAX_CONNECTIONS << " reached.");
-shutdownLimitReached(ws);
-return;
-}
+if (LOOLWSD::NumConnections >= MAX_CONNECTIONS)
+{
+LOG_ERR("Limit on maximum number of connections of " << 
MAX_CONNECTIONS << " reached.");
+shutdownLimitReached(ws);
+return;
+}
 
-LOG_INF("Starting GET request handler for session [" << _id << "] on 
url [" << url << "].");
+LOG_INF("Starting GET request handler for session [" << _id << "] 
on url [" << url << "].");
 
-// Indicate to the client that document broker is searching.
-const std::string status("statusindicator: find");
-LOG_TRC("Sending to Client [" << status << "].");
-ws.sendMessage(status);
+// Indicate to the client that document broker is searching.
+const std::string status("statusindicator: find");
+LOG_TRC("Sending to Client [" << status << "].");
+ws.sendMessage(status);
 
-const auto uriPublic = DocumentBroker::sanitizeURI(url);
-const auto docKey = DocumentBroker::getDocKey(uriPublic);
-LOG_INF("Sanitized URI [" << url << "] to [" << uriPublic.toString() <<
-"] and mapped to docKey [" << docKey << "] for session [" << 
_id << "].");
+const auto uriPublic = DocumentBroker::sanitizeURI(url);
+const auto docKey = DocumentBroker::getDocKey(uriPublic);
+LOG_INF("Sanitized URI [" << url << "] to [" << 
uriPublic.toString() <<
+"] and mapped to docKey [" << docKey << "] for session [" 
<< _id << "].");
 
-// Check if readonly session is required
-bool isReadOnly = false;
-for (const auto& param : uriPublic.getQueryParameters())
-{
-LOG_DBG("Query param: " << param.first << ", value: " << 
param.second);
-if (param.first == "permission" && param.second == "readonly")
+// Check if readonly session is required
+bool isReadOnly = false;
+for (const auto& param : uriPublic.getQueryParameters())
 {
-isReadOnly = true;
+LOG_DBG("Query param: " << param.first << ", value: " << 
param.second);
+if (param.first == "permission" && param.second == "readonly")
+{
+isReadOnly = true;
+}
 }
-}
 
-LOG_INF("URL [" << url << "] is " << (isReadOnly ? "readonly" : 
"writable") << ".");
+LOG_INF("URL [" << url << "] is " << (isReadOnly ? "readonly" : 
"writable") << ".");
 
-// Request a kit process for this doc.
-auto docBroker = findOrCreateDocBroker(ws, url, docKey, _id, 
uriPublic);
-if (docBroker)
-{
-auto clientSession = createNewClientSession(&ws, _id, uriPublic, 
docBroker, isReadOnly);
-if (clientSession)
+// Request a kit process for this doc.
+auto docBroker = findOrCrea

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - net/Socket.cpp net/Socket.hpp wsd/LOOLWSD.cpp

2017-05-16 Thread Ashod Nakashian
 net/Socket.cpp  |1 +
 net/Socket.hpp  |3 +++
 wsd/LOOLWSD.cpp |3 +++
 3 files changed, 7 insertions(+)

New commits:
commit 684103104abfff50b18ad4cb1d591b25d1a0af59
Author: Ashod Nakashian 
Date:   Sun May 14 21:42:10 2017 -0400

wsd: fix server shutdown

Thread-affinity checks must be inhibited
not just on Socket, but on the SocketPoll as well,
before destroying DocumentBroker instances.

Also, properly initialize the inhibit statics.

Change-Id: I2ced1554d477f0c3faf09bda74034cbae99e4ce1
Reviewed-on: https://gerrit.libreoffice.org/37608
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 
(cherry picked from commit 7cff4fb08a2dba769a992300d24c0d5c3192b0a9)
Reviewed-on: https://gerrit.libreoffice.org/37612
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/net/Socket.cpp b/net/Socket.cpp
index 70b63e78..33652eb8 100644
--- a/net/Socket.cpp
+++ b/net/Socket.cpp
@@ -24,6 +24,7 @@
 #include "WebSocketHandler.hpp"
 
 int SocketPoll::DefaultPollTimeoutMs = 5000;
+std::atomic SocketPoll::InhibitThreadChecks(false);
 std::atomic Socket::InhibitThreadChecks(false);
 
 // help with initialization order
diff --git a/net/Socket.hpp b/net/Socket.hpp
index 89dd746e..8699db88 100644
--- a/net/Socket.hpp
+++ b/net/Socket.hpp
@@ -319,6 +319,7 @@ public:
 
 /// Default poll time - useful to increase for debugging.
 static int DefaultPollTimeoutMs;
+static std::atomic InhibitThreadChecks;
 
 /// Stop the polling thread.
 void stop()
@@ -370,6 +371,8 @@ public:
 /// Asserts in the debug builds, otherwise just logs.
 void assertCorrectThread() const
 {
+if (InhibitThreadChecks)
+return;
 // 0 owner means detached and can be invoked by any thread.
 const bool sameThread = (!isAlive() || _owner == std::thread::id(0) || 
std::this_thread::get_id() == _owner);
 if (!sameThread)
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 47323ed7..da1e6535 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -2189,6 +2189,7 @@ public:
 {
 // FIXME: add some stop-world magic before doing the dump(?)
 Socket::InhibitThreadChecks = true;
+SocketPoll::InhibitThreadChecks = true;
 
 os << "LOOLWSDServer:\n"
<< "  Ports: server " << ClientPortNumber
@@ -2217,6 +2218,7 @@ public:
 i.second->dumpState(os);
 
 Socket::InhibitThreadChecks = false;
+SocketPoll::InhibitThreadChecks = false;
 }
 
 private:
@@ -2495,6 +2497,7 @@ int LOOLWSD::innerMain()
 
 // Disable thread checking - we'll now cleanup lots of things if we can
 Socket::InhibitThreadChecks = true;
+SocketPoll::InhibitThreadChecks = true;
 
 DocBrokers.clear();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - loolwsd.xml.in wsd/DocumentBroker.cpp wsd/LOOLWSD.cpp wsd/LOOLWSD.hpp

2017-05-16 Thread Ashod Nakashian
 loolwsd.xml.in |   15 ---
 wsd/DocumentBroker.cpp |4 +++-
 wsd/LOOLWSD.cpp|1 +
 wsd/LOOLWSD.hpp|9 +
 4 files changed, 21 insertions(+), 8 deletions(-)

New commits:
commit fb2fdeb298c5bb4e2c31f9cac8a187fa7c2f2265
Author: Ashod Nakashian 
Date:   Sun May 7 13:28:57 2017 -0400

wsd: configurable idle document timeout

When a document is idle (no activity from
any views) for this timeout duration, the
document is saved and unloaded to minimize
resource consumption.

Change-Id: If6f09136ae40c7e84180fc8c8adbf6db8396d292
Reviewed-on: https://gerrit.libreoffice.org/37374
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 
(cherry picked from commit 7d823787bbdb8790aeca379c160873f3924b9942)
Reviewed-on: https://gerrit.libreoffice.org/37414
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loolwsd.xml.in b/loolwsd.xml.in
index 5640d08f..449d9797 100644
--- a/loolwsd.xml.in
+++ b/loolwsd.xml.in
@@ -14,6 +14,7 @@
 1
 
 4
+3600
 
 
 loleaflet.html
@@ -51,13 +52,13 @@
 /etc/loolwsd/cert.pem
 /etc/loolwsd/key.pem
 /etc/loolwsd/ca-chain.cert.pem
-   
-   1000
-   
-   
- 
-   
-   
+
+1000
+
+
+
+
+
 
 
 
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index bc5db5ed..0dac41b5 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -221,6 +221,8 @@ void DocumentBroker::pollThread()
 auto last30SecCheckTime = std::chrono::steady_clock::now();
 
 static const bool AutoSaveEnabled = !std::getenv("LOOL_NO_AUTOSAVE");
+static const size_t IdleDocTimeoutSecs = LOOLWSD::getConfigValue(
+  
"per_document.idle_timeout_secs", 3600);
 
 // Main polling loop goodness.
 while (!_stop && _poll->continuePolling() && !TerminationFlag)
@@ -276,7 +278,7 @@ void DocumentBroker::pollThread()
 }
 
 // Remove idle documents after 1 hour.
-const bool idle = (getIdleTimeSecs() >= 3600);
+const bool idle = (getIdleTimeSecs() >= IdleDocTimeoutSecs);
 
 // If all sessions have been removed, no reason to linger.
 if ((isLoaded() || _markToDestroy) && (_sessions.empty() || idle))
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 57d3f0d4..47323ed7 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -618,6 +618,7 @@ void LOOLWSD::initialize(Application& self)
 { "file_server_root_path", "loleaflet/.." },
 { "num_prespawn_children", "1" },
 { "per_document.max_concurrency", "4" },
+{ "per_document.idle_timeout_secs", "3600" },
 { "loleaflet_html", "loleaflet.html" },
 { "logging.color", "true" },
 { "logging.level", "trace" },
diff --git a/wsd/LOOLWSD.hpp b/wsd/LOOLWSD.hpp
index 72c3a9a1..46538dc0 100644
--- a/wsd/LOOLWSD.hpp
+++ b/wsd/LOOLWSD.hpp
@@ -81,6 +81,15 @@ public:
 return LOOLWSD::SSLTermination.get();
 }
 
+/// Returns the value of the specified application configuration,
+/// of the default, if one doesn't exist.
+template
+static
+T getConfigValue(const std::string& name, const T def)
+{
+return getConfigValue(Application::instance().config(), name, def);
+}
+
 /// Trace a new session and take a snapshot of the file.
 static void dumpNewSessionTrace(const std::string& id, const std::string& 
sessionId, const std::string& uri, const std::string& path);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - loleaflet/src

2017-05-16 Thread Ashod Nakashian
 loleaflet/src/map/Map.js |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit e02516d918ee0aaa9127721b1951957420b740a9
Author: Ashod Nakashian 
Date:   Sun May 7 11:37:51 2017 -0400

loleaflet: configurable dimming timeout and fire event

Two timeout are now configurable.
idleTimeoutSecs, which controls when to dim because
of user inactivity, even if the tab is in focus.
outOfFocusTimeoutSecs, which controls when to dim
when the tab loses focus.

Currently they are set to 15 minutes and 30 seconds
respectively by default.

User_Idle event is now fired on dimming.

Change-Id: I894f6df44825b6814872f1c4986fab8dcd4d6cef
Reviewed-on: https://gerrit.libreoffice.org/37373
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 
(cherry picked from commit f9ee1c6150854b98e4519cd90c971b4726a0785c)
Reviewed-on: https://gerrit.libreoffice.org/37413
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 755d99d0..49cb285c 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -18,7 +18,9 @@ L.Map = L.Evented.extend({
defaultZoom: 10,
tileWidthTwips: 3840,
tileHeightTwips: 3840,
-   urlPrefix: 'lool'
+   urlPrefix: 'lool',
+   idleTimeoutSecs: 15 * 60,  // Dim when user is idle.
+   outOfFocusTimeoutSecs: 30, // Dim after switching tabs.
},
 
lastActiveTime: Date.now(),
@@ -853,12 +855,13 @@ L.Map = L.Evented.extend({
 
this._doclayer && this._docLayer._onMessage('textselection:', 
null);
console.debug('_dim: sending userinactive');
+   map.fire('postMessage', {msgId: 'User_Idle'});
this._socket.sendMessage('userinactive');
},
 
_dimIfInactive: function () {
console.debug('_dimIfInactive: diff=' + (Date.now() - 
this.lastActiveTime));
-   if ((Date.now() - this.lastActiveTime) >= 10 * 60 * 1000) { // 
Dim 10 minutes after last user activity
+   if ((Date.now() - this.lastActiveTime) >= 
this.options.idleTimeoutSecs * 1000) {
this._dim();
} else {
this._startInactiveTimer();
@@ -894,7 +897,7 @@ L.Map = L.Evented.extend({
var map = this;
vex.timer = setTimeout(function() {
map._dim();
-   }, 30 * 1000); // Dim in 30 seconds.
+   }, this.options.outOfFocusTimeoutSecs * 1000);
},
 
_onLostFocus: function () {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - common/Util.cpp kit/ForKit.cpp kit/Kit.cpp kit/Kit.hpp wsd/DocumentBroker.cpp wsd/DocumentBroker.hpp wsd/LOOLWSD.cpp

2017-05-16 Thread Ashod Nakashian
 common/Util.cpp|   10 --
 kit/ForKit.cpp |   12 
 kit/Kit.cpp|   16 +++-
 kit/Kit.hpp|1 +
 wsd/DocumentBroker.cpp |2 +-
 wsd/DocumentBroker.hpp |8 +++-
 wsd/LOOLWSD.cpp|   15 +--
 7 files changed, 45 insertions(+), 19 deletions(-)

New commits:
commit a7340a54450f571c2b1a1b3e637a08c1b00f452e
Author: Ashod Nakashian 
Date:   Sun May 7 11:05:34 2017 -0400

wsd: random jail paths instead of pid

Jail paths are now generate from a PRNG
instead of using the PID of the kit process.

The PRN is converted to base-64 and used
as the directory name where a given
kit is jailed.

Change-Id: I8e4bc35d9ccdfdae0e542ab707c417cd29ad52f3
Reviewed-on: https://gerrit.libreoffice.org/37372
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 
(cherry picked from commit 9798eafb8c71ef9eafedb58478d260573eda2e71)
Reviewed-on: https://gerrit.libreoffice.org/37412
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/common/Util.cpp b/common/Util.cpp
index 3260d130..612f971e 100644
--- a/common/Util.cpp
+++ b/common/Util.cpp
@@ -99,8 +99,14 @@ namespace Util
 
 std::string getFilename(const size_t length)
 {
-std::string s = getB64String(length);
-std::replace(s.begin(), s.end(), '/', '_');
+std::string s = getB64String(length * 2);
+s.erase(std::remove_if(s.begin(), s.end(),
+   [](const std::string::value_type& c)
+   {
+   // Remove undesirable characters in a 
filename.
+   return c == '/' || c == ' ' || c == '+';
+   }),
+ s.end());
 return s.substr(0, length);
 }
 }
diff --git a/kit/ForKit.cpp b/kit/ForKit.cpp
index 035f69a9..cc6759de 100644
--- a/kit/ForKit.cpp
+++ b/kit/ForKit.cpp
@@ -193,6 +193,7 @@ static void cleanupChildren()
 std::vector jails;
 Process::PID exitedChildPid;
 int status;
+// Reap quickly without doing slow cleanup so WSD can spawn more rapidly.
 while ((exitedChildPid = waitpid(-1, &status, WUNTRACED | WNOHANG)) > 0)
 {
 const auto it = childJails.find(exitedChildPid);
@@ -221,7 +222,10 @@ static int createLibreOfficeKit(const std::string& 
childRoot,
 const std::string& loSubPath,
 bool queryVersion = false)
 {
-LOG_DBG("Forking a loolkit process.");
+// Generate a jail ID to be used for in the jail path.
+const std::string jailId = Util::rng::getFilename(16);
+
+LOG_DBG("Forking a loolkit process with jailId: " << jailId << ".");
 
 const Process::PID pid = fork();
 if (!pid)
@@ -248,9 +252,9 @@ static int createLibreOfficeKit(const std::string& 
childRoot,
 }
 
 #ifndef KIT_IN_PROCESS
-lokit_main(childRoot, sysTemplate, loTemplate, loSubPath, 
NoCapsForKit, queryVersion, DisplayVersion);
+lokit_main(childRoot, jailId, sysTemplate, loTemplate, loSubPath, 
NoCapsForKit, queryVersion, DisplayVersion);
 #else
-lokit_main(childRoot, sysTemplate, loTemplate, loSubPath, true, 
queryVersion, DisplayVersion);
+lokit_main(childRoot, jailId, sysTemplate, loTemplate, loSubPath, 
true, queryVersion, DisplayVersion);
 #endif
 }
 else
@@ -263,7 +267,7 @@ static int createLibreOfficeKit(const std::string& 
childRoot,
 else
 {
 LOG_INF("Forked kit [" << pid << "].");
-childJails[pid] = childRoot + std::to_string(pid);
+childJails[pid] = childRoot + jailId;
 }
 
 #ifndef KIT_IN_PROCESS
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 144c3b2c..628e9295 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1577,6 +1577,7 @@ void documentViewCallback(const int type, const char* 
payload, void* data)
 
 #ifndef BUILDING_TESTS
 void lokit_main(const std::string& childRoot,
+const std::string& jailId,
 const std::string& sysTemplate,
 const std::string& loTemplate,
 const std::string& loSubPath,
@@ -1610,12 +1611,6 @@ void lokit_main(const std::string& childRoot,
 assert(!loTemplate.empty());
 assert(!loSubPath.empty());
 
-// Ideally this will be a random ID, but forkit will cleanup
-// our jail directory when we die, and it's simpler to know
-// the jailId (i.e. the path) implicitly by knowing our pid.
-static const std::string pid = std::to_string(Process::id());
-static const std::string jailId = pid;
-
 LOG_DBG("Process started.");
 
 std::string userdir_url;
@@ -1772,7 +1767,10 @@ void lokit_main(const std::string& childRoot,
 assert(loKit);
 LOG_INF("Process is ready.");
 
-std::string requestUrl = std::string(NEW_CHI

[Libreoffice-commits] libcdr.git: src/lib

2017-05-16 Thread David Tardon
 src/lib/CDRContentCollector.cpp |4 
 src/lib/CDRParser.cpp   |4 
 src/lib/CDRPath.cpp |4 
 src/lib/CDRStylesCollector.cpp  |4 
 src/lib/CMXParser.cpp   |4 
 src/lib/CommonParser.cpp|4 
 6 files changed, 24 deletions(-)

New commits:
commit badddb69ec352d98d145e86577959d5523bdcc8d
Author: David Tardon 
Date:   Tue May 16 16:28:15 2017 +0200

one definition of M_PI is enough

Change-Id: I9ad24445117ecd8bcbd00ce664029ddc392f4846

diff --git a/src/lib/CDRContentCollector.cpp b/src/lib/CDRContentCollector.cpp
index ed6640a..d9e143e 100644
--- a/src/lib/CDRContentCollector.cpp
+++ b/src/lib/CDRContentCollector.cpp
@@ -15,10 +15,6 @@
 #include "CDRInternalStream.h"
 #include "libcdr_utils.h"
 
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
 #ifndef DUMP_PATTERN
 #define DUMP_PATTERN 0
 #endif
diff --git a/src/lib/CDRParser.cpp b/src/lib/CDRParser.cpp
index 43748fe..617dea6 100644
--- a/src/lib/CDRParser.cpp
+++ b/src/lib/CDRParser.cpp
@@ -31,10 +31,6 @@
 #define DUMP_PREVIEW_IMAGE 0
 #endif
 
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
 namespace
 {
 
diff --git a/src/lib/CDRPath.cpp b/src/lib/CDRPath.cpp
index 0ece4ed..45b0bc6 100644
--- a/src/lib/CDRPath.cpp
+++ b/src/lib/CDRPath.cpp
@@ -12,10 +12,6 @@
 #include "CDRPath.h"
 #include "CDRTypes.h"
 
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
 #ifndef DEBUG_SPLINES
 #define DEBUG_SPLINES 0
 #endif
diff --git a/src/lib/CDRStylesCollector.cpp b/src/lib/CDRStylesCollector.cpp
index 99f6caf..11a39f3 100644
--- a/src/lib/CDRStylesCollector.cpp
+++ b/src/lib/CDRStylesCollector.cpp
@@ -13,10 +13,6 @@
 #include "CDRInternalStream.h"
 #include "libcdr_utils.h"
 
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
 #ifndef DUMP_IMAGE
 #define DUMP_IMAGE 0
 #endif
diff --git a/src/lib/CMXParser.cpp b/src/lib/CMXParser.cpp
index 525fa01..5abc4f0 100644
--- a/src/lib/CMXParser.cpp
+++ b/src/lib/CMXParser.cpp
@@ -29,10 +29,6 @@
 #define DUMP_IMAGE 0
 #endif
 
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
 namespace
 {
 
diff --git a/src/lib/CommonParser.cpp b/src/lib/CommonParser.cpp
index 022a0af..2c3e4e4 100644
--- a/src/lib/CommonParser.cpp
+++ b/src/lib/CommonParser.cpp
@@ -12,10 +12,6 @@
 #include "libcdr_utils.h"
 #include "CommonParser.h"
 
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
 libcdr::CommonParser::CommonParser(libcdr::CDRCollector *collector)
   : m_collector(collector), m_precision(libcdr::PRECISION_UNKNOWN) {}
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] libcdr.git: 4 commits - configure.ac src/lib

2017-05-16 Thread David Tardon
 configure.ac  |6 +-
 src/lib/CDRContentCollector.h |2 
 src/lib/CDRParser.cpp |  107 --
 3 files changed, 58 insertions(+), 57 deletions(-)

New commits:
commit 157f80cc4f4cd295588eba55bdcbe56889e9225a
Author: David Tardon 
Date:   Tue May 16 16:18:35 2017 +0200

use a lookup table to get codepage from font name

Change-Id: Ia45f9aeb1d2993d751cf29e1855d640a90b3e2d3

diff --git a/configure.ac b/configure.ac
index 5fa92c6..78b34f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,6 +129,7 @@ AC_SUBST(ICU_LIBS)
 # ===
 
 AC_CHECK_HEADERS(
+   boost/algorithm/string.hpp \
boost/cstdint.hpp \
boost/optional.hpp \
boost/property_tree/json_parser.hpp \
diff --git a/src/lib/CDRParser.cpp b/src/lib/CDRParser.cpp
index becf7c5..43748fe 100644
--- a/src/lib/CDRParser.cpp
+++ b/src/lib/CDRParser.cpp
@@ -15,6 +15,7 @@
 #ifndef BOOST_ALL_NO_LIB
 #define BOOST_ALL_NO_LIB 1
 #endif
+#include 
 #include 
 #include 
 #include 
@@ -73,44 +74,35 @@ struct CDRStltRecord
 
 static void processNameForEncoding(librevenge::RVNGString &name, unsigned 
short &encoding)
 {
-  std::string fontName(name.cstr());
-  size_t length = fontName.length();
-  size_t found = std::string::npos;
+  namespace qi = boost::spirit::qi;
+
+  qi::symbols codepage;
+  codepage.add
+  ("EC ", 0xee)
+  ("cilliryC ", 0xcc)
+  ("ryC ", 0xcc)
+  ("RYC ", 0xcc)
+  ("citlaB ", 0xba)
+  ("keerG ", 0xa1)
+  ("ruT ", 0xa2)
+  ("RUT ", 0xa2)
+  ("werbeH ", 0xb1)
+  ("cibarA ", 0xb2)
+  ("iahT ", 0xde)
+  ;
 
-  if (length > 3 && (found=fontName.find(" CE", length - 3)) != 
std::string::npos)
-encoding = 0xee;
-  else if (length > 9 && (found=fontName.rfind(" Cyrillic", length - 9)) != 
std::string::npos)
-encoding = 0xcc;
-  else if (length > 4 && (found=fontName.rfind(" Cyr", length - 4)) != 
std::string::npos)
-encoding = 0xcc;
-  else if (length > 4 && (found=fontName.rfind(" CYR", length - 4)) != 
std::string::npos)
-encoding = 0xcc;
-  else if (length > 7 && (found=fontName.rfind(" Baltic", length - 7)) != 
std::string::npos)
-encoding = 0xba;
-  else if (length > 6 && (found=fontName.rfind(" Greek", length - 6)) != 
std::string::npos)
-encoding = 0xa1;
-  else if (length > 4 && (found=fontName.rfind(" Tur", length - 4)) != 
std::string::npos)
-encoding = 0xa2;
-  else if (length > 4 && (found=fontName.rfind(" TUR", length - 4)) != 
std::string::npos)
-encoding = 0xa2;
-  else if (length > 7 && (found=fontName.rfind(" Hebrew", length - 7)) != 
std::string::npos)
-encoding = 0xb1;
-  else if (length > 7 && (found=fontName.rfind(" Arabic", length - 7)) != 
std::string::npos)
-encoding = 0xb2;
-  else if (length > 5 && (found=fontName.rfind(" Thai", length - 5)) != 
std::string::npos)
-encoding = 0xde;
-  else if (length >= 4 && (found=fontName.find("GOST", 0, 4)) != 
std::string::npos)
+  std::string fontName(name.cstr());
+  unsigned short enc = encoding;
+  std::string revName;
+  if (qi::parse(fontName.rbegin(), fontName.rend(), codepage >> +qi::char_, 
enc, revName))
   {
-encoding = 0xcc;
-found = std::string::npos;
+encoding = enc;
+name = std::string(revName.rbegin(), revName.rend()).c_str();
   }
-
-  if (found != std::string::npos)
+  else if (boost::starts_with(fontName, "GOST"))
   {
-fontName.erase(found, std::string::npos);
-name = fontName.c_str();
+encoding = 0xcc;
   }
-  return;
 }
 
 static int parseColourString(const char *colourString, libcdr::CDRColor 
&colour, double &opacity)
commit 622861c10a26941233ec120528c281e69605a355
Author: David Tardon 
Date:   Tue May 16 15:48:45 2017 +0200

convert from Spirit.Classic to Qi

Change-Id: Id6dcd006cbc23f2928f0f7b0be90003dfd07f945

diff --git a/configure.ac b/configure.ac
index e7c1bef..5fa92c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -133,7 +133,7 @@ AC_CHECK_HEADERS(
boost/optional.hpp \
boost/property_tree/json_parser.hpp \
boost/property_tree/ptree.hpp \
-   boost/spirit/include/classic.hpp \
+   boost/spirit/include/qi.hpp \
 ,
[],
[AC_MSG_ERROR(Required boost headers not found. Install boost >= 
1.41.0)],
diff --git a/src/lib/CDRParser.cpp b/src/lib/CDRParser.cpp
index 3610349..becf7c5 100644
--- a/src/lib/CDRParser.cpp
+++ b/src/lib/CDRParser.cpp
@@ -18,7 +18,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include "libcdr_utils.h"
 #include "CDRDocumentStructure.h"
 #include "CDRInternalStream.h"
@@ -115,37 +115,44 @@ static void processNameForEncoding(librevenge::RVNGString 
&name, unsigned short
 
 static int parseColourString(const char *colourString, libcdr::CDRColor 
&colour, double &opacity)
 {
-  using namespace boost::spirit::classic;
+  using namespace boost::spirit::qi;
   bool bRes = false;
 
-  std::string colourModel;
+  boost::optional colourModel;
   unsigned val0, val1, val2, val3

[Libreoffice-commits] online.git: loleaflet/src

2017-05-16 Thread Marco Cecchetti
 loleaflet/src/layer/tile/ImpressTileLayer.js |  133 +--
 1 file changed, 105 insertions(+), 28 deletions(-)

New commits:
commit 2b8fc61dde36a9b7e4b9ff92a64ce4dbacfbd715
Author: Marco Cecchetti 
Date:   Sun May 14 15:16:24 2017 +0200

loleaflet: impress: comments that are being modified are shown twice

Reworked handling of annotation layout. Now it behaves more like
writer annotations.

Now scrolling up annotations leads to scrolling the current slide too
when it is required in order to show not visible annotations.

Moreover the top visible annotation is now remembered for each slide,
and when the top annotation is not the first one, a bit of the bottom
of the previous annotation is showed so that the user gets aware that
there are more annotations above.

Change-Id: I3d087a8db35143a5e3abcd3e95e5e612d7638891
Reviewed-on: https://gerrit.libreoffice.org/37628
Reviewed-by: Marco Cecchetti 
Tested-by: Marco Cecchetti 

diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js 
b/loleaflet/src/layer/tile/ImpressTileLayer.js
index ee7f2ae5..209232d8 100644
--- a/loleaflet/src/layer/tile/ImpressTileLayer.js
+++ b/loleaflet/src/layer/tile/ImpressTileLayer.js
@@ -7,9 +7,18 @@ L.ImpressTileLayer = L.TileLayer.extend({
extraSize: L.point(290, 0),
 
newAnnotation: function (comment) {
-   var annotation = L.annotation(this._map.getCenter(), comment, 
{noMenu: true}).addTo(this._map);
-   annotation.edit();
-   annotation.focus();
+   if (this._draft) {
+   return;
+   }
+   this.onAnnotationCancel();
+   this._draft = L.annotation(L.latLng(0, 0), comment, {noMenu: 
true}).addTo(this._map);
+   this._draft.edit();
+   var mapCenter = 
this._map.latLngToLayerPoint(this._map.getCenter());
+   var bounds = this._draft.getBounds();
+   var topLeft = mapCenter.subtract(L.point(bounds.max.x - 
bounds.min.x, (bounds.max.y - bounds.min.y)/2));
+   this._draft.setLatLng(this._map.layerPointToLatLng(topLeft));
+   this.layoutAnnotations();
+   this._draft.focus();
},
 
beforeAdd: function (map) {
@@ -33,6 +42,7 @@ L.ImpressTileLayer = L.TileLayer.extend({
},
 
hideAnnotations: function (part) {
+   this._selectedAnnotation = undefined;
var annotations = this._annotations[this._partHashes[part]];
for (var index in annotations) {
annotations[index].hide();
@@ -54,27 +64,40 @@ L.ImpressTileLayer = L.TileLayer.extend({
onAdd: function (map) {
L.TileLayer.prototype.onAdd.call(this, map);
this._annotations = {};
-   this._topAnnotation = 0;
+   this._topAnnotation = [];
+   this._topAnnotation[this._selectedPart] = 0;
+   this._selectedAnnotation = undefined;
+   this._draft = null;
},
 
onAnnotationCancel: function (e) {
-   this._map.removeLayer(e.annotation);
+   if (this._draft) {
+   this._map.removeLayer(this._draft);
+   this._draft = null;
+   }
this._map.focus();
+   this._selectedAnnotation = undefined;
+   this.layoutAnnotations();
},
 
onAnnotationModify: function (annotation) {
-   var draft = L.annotation(this._map.getCenter(), 
annotation._data).addTo(this._map);
-   draft.edit();
-   draft.focus();
+   this.onAnnotationCancel();
+   this._selectedAnnotation = annotation._data.id;
+   annotation.edit();
+   this.scrollUntilAnnotationIsVisible(annotation);
+   annotation.focus();
},
 
onAnnotationReply: function (annotation) {
-   var draft = L.annotation(this._map.getCenter(), 
annotation._data).addTo(this._map);
-   draft.reply();
-   draft.focus();
+   this.onAnnotationCancel();
+   this._selectedAnnotation = annotation._data.id;
+   annotation.reply();
+   this.scrollUntilAnnotationIsVisible(annotation);
+   annotation.focus();
},
 
onAnnotationRemove: function (id) {
+   this.onAnnotationCancel();
var comment = {
Id: {
type: 'string',
@@ -87,14 +110,16 @@ L.ImpressTileLayer = L.TileLayer.extend({
 
onAnnotationSave: function (e) {
var comment;
-   if (e.annotation._data.id === 'new') {
+   if (this._draft) {
comment = {
Text: {
type: 'str

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

2017-05-16 Thread Marco Cecchetti
 sc/source/ui/view/tabview.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit ea3ef1a2a06b7ac0fa9f618498f9caf48ebc40bd
Author: Marco Cecchetti 
Date:   Mon May 8 21:10:00 2017 +0200

lok: sc: selection overlay was not updated on document size changed

Change-Id: I193f37d50ac3ff0ccbf7e39caab4bf25ed3c9a9c
Reviewed-on: https://gerrit.libreoffice.org/37402
Reviewed-by: Marco Cecchetti 
Tested-by: Marco Cecchetti 

diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 0a524c268df1..7610296acd76 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2399,6 +2399,7 @@ OUString ScTabView::getRowColumnHeaders(const 
tools::Rectangle& rRectangle)
 // Only invalidate if spreadsheet extended to the bottom
 if (aNewRowArea.getHeight())
 {
+UpdateSelectionOverlay();
 SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), 
aNewRowArea.toString());
 }
 }
@@ -2525,6 +2526,7 @@ OUString ScTabView::getRowColumnHeaders(const 
tools::Rectangle& rRectangle)
 // Only invalidate if spreadsheet extended to the bottom
 if (aNewColArea.getWidth())
 {
+UpdateSelectionOverlay();
 SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), 
aNewColArea.toString());
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-05-16 Thread Marco Cecchetti
 sc/source/ui/undo/undoblk.cxx  |   14 ++
 sc/source/ui/undo/undoblk2.cxx |   10 +-
 2 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 76d47e6f63e11d3509339ade6203757d63582d21
Author: Marco Cecchetti 
Date:   Wed May 3 17:22:27 2017 +0200

lok: sc: invalidate col/row header on undo row/col operations

Change-Id: Ifabce9941541a615840163168af6fedaf54575cd
Reviewed-on: https://gerrit.libreoffice.org/37243
Tested-by: Jenkins 
Reviewed-by: Marco Cecchetti 

diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 291151d11a6d..1c2757c40897 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -23,6 +23,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "undoblk.hxx"
 #include "undoutil.hxx"
@@ -257,7 +259,19 @@ void ScUndoInsertCells::DoChange( const bool bUndo )
 }
 pDocShell->PostDataChanged();
 if (pViewShell)
+{
 pViewShell->CellContentChanged();
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+if (eCmd == INS_INSCOLS_BEFORE || eCmd == INS_INSCOLS_AFTER || 
eCmd == INS_CELLSRIGHT)
+ScTabViewShell::notifyAllViewsHeaderInvalidation("column",  
pViewShell->GetViewData().GetTabNo());
+
+if (eCmd == INS_INSROWS_BEFORE || eCmd == INS_INSROWS_AFTER || 
eCmd == INS_CELLSDOWN)
+ScTabViewShell::notifyAllViewsHeaderInvalidation("row",  
pViewShell->GetViewData().GetTabNo());
+}
+
+}
 }
 
 void ScUndoInsertCells::Undo()
diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx
index 50404d5e09fc..cdf75b9f1882 100644
--- a/sc/source/ui/undo/undoblk2.cxx
+++ b/sc/source/ui/undo/undoblk2.cxx
@@ -30,6 +30,8 @@
 
 #include "undoolk.hxx"
 
+#include 
+#include 
 
 /** Change column widths or row heights */
 ScUndoWidthOrHeight::ScUndoWidthOrHeight( ScDocShell* pNewDocShell,
@@ -94,6 +96,7 @@ void ScUndoWidthOrHeight::Undo()
 if (pUndoTab)   // Outlines are 
included when saving ?
 rDoc.SetOutlineTable( nStartTab, pUndoTab );
 
+ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
 SCTAB nTabCount = rDoc.GetTableCount();
 ScMarkData::iterator itr = aMarkData.begin(), itrEnd = aMarkData.end();
 for (; itr != itrEnd && *itr < nTabCount; ++itr)
@@ -117,7 +120,6 @@ void ScUndoWidthOrHeight::Undo()
 
 DoSdrUndoAction( pDrawUndo, &rDoc );
 
-ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
 if (pViewShell)
 {
 pViewShell->UpdateScrollBars();
@@ -125,6 +127,12 @@ void ScUndoWidthOrHeight::Undo()
 SCTAB nCurrentTab = pViewShell->GetViewData().GetTabNo();
 if ( nCurrentTab < nStartTab || nCurrentTab > nEndTab )
 pViewShell->SetTabNo( nStartTab );
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+OString aPayload = bWidth ? "column" : "row";
+ScTabViewShell::notifyAllViewsHeaderInvalidation(aPayload, 
pViewShell->GetViewData().GetTabNo());
+}
 }
 
 EndUndo();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - helpcontent2

2017-05-16 Thread Olivier Hallot
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit eb6f420ed24b6bb8469b233154ead57c80c7be06
Author: Olivier Hallot 
Date:   Sat May 13 12:43:49 2017 -0300

Updated core
Project: help  fd99f1798a440ccdfb34e910285a7c5c9a9ff08d

tdf#84675 (part2) document hidden BASIC func/const

GetAttr()
SetAttr
Valid ATTR for SetAttr statement are
ATTR_NORMAL
ATTR_READONLY
ATTR_HIDDEN

Others ATTR_* were not implemented, see


http://opengrok.libreoffice.org/xref/core/basic/source/runtime/methods.cxx#4689

Change-Id: I51b50c13709b668c935b9a68981c20545648691d
Reviewed-on: https://gerrit.libreoffice.org/37576
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index 9a16735c5ebe..fd99f1798a44 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 9a16735c5ebee4513d02b8f28b2147ec9407c18a
+Subproject commit fd99f1798a440ccdfb34e910285a7c5c9a9ff08d
commit ae6b33cf20ff06bd059803fa03228e919987e1b0
Author: Olivier Hallot 
Date:   Fri May 12 15:46:17 2017 -0300

Updated core
Project: help  9a16735c5ebee4513d02b8f28b2147ec9407c18a

tdf#84675 (part) document hidden BASIC func/const

Help page for MsgBox function and MsgBox statement

Constants
MB_*
ID*

Fix: remove MB_DEFBUTTON1
fix bug#

Change-Id: Id8cbadc92a8e9c5902c3ff23b4e04bff3de3c03d
Reviewed-on: https://gerrit.libreoffice.org/37558
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index eaac057360cb..9a16735c5ebe 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit eaac057360cb1801c4f8b433411a8c8d1a20a539
+Subproject commit 9a16735c5ebee4513d02b8f28b2147ec9407c18a
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] help.git: 2 commits - source/text

2017-05-16 Thread Olivier Hallot
 source/text/sbasic/shared/03010101.xhp |  182 +++--
 source/text/sbasic/shared/03010102.xhp |  279 ++---
 source/text/sbasic/shared/03020409.xhp |  115 +++--
 source/text/sbasic/shared/03020414.xhp |   71 ++--
 4 files changed, 578 insertions(+), 69 deletions(-)

New commits:
commit fd99f1798a440ccdfb34e910285a7c5c9a9ff08d
Author: Olivier Hallot 
Date:   Sat May 13 12:43:49 2017 -0300

tdf#84675 (part2) document hidden BASIC func/const

GetAttr()
SetAttr
Valid ATTR for SetAttr statement are
ATTR_NORMAL
ATTR_READONLY
ATTR_HIDDEN

Others ATTR_* were not implemented, see


http://opengrok.libreoffice.org/xref/core/basic/source/runtime/methods.cxx#4689

Change-Id: I51b50c13709b668c935b9a68981c20545648691d
Reviewed-on: https://gerrit.libreoffice.org/37576
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/source/text/sbasic/shared/03020409.xhp 
b/source/text/sbasic/shared/03020409.xhp
index a26b96530..8c1196fd9 100644
--- a/source/text/sbasic/shared/03020409.xhp
+++ b/source/text/sbasic/shared/03020409.xhp
@@ -54,27 +54,114 @@
 
 
 Value
-0 : Normal 
files.
-1 : Read-only 
files.
-8 : Returns 
the name of the volume
-16 : Returns 
the name of the directory only.
-32 : File was 
changed since last backup (Archive bit).
+
+
+  
+
+  Named constant
+
+
+  Value
+
+
+  Definition
+
+  
+  
+
+  ATTR_NORMAL
+
+
+  0
+
+
+   Normal 
files.
+
+  
+  
+
+  ATTR_READONLY
+
+
+  1
+
+
+   
Read-only files.
+
+  
+  
+
+  ATTR_HIDDEN
+
+
+  2
+
+
+   Hidden file
+
+  
+  
+
+  ATTR_SYSTEM
+
+
+  4
+
+
+   System file
+
+  
+  
+
+  ATTR_VOLUME
+
+
+  8
+
+
+   Returns 
the name of the volume
+
+  
+  
+
+  ATTR_DIRECTORY
+
+
+  16
+
+
+   Returns 
the name of the directory only.
+
+  
+  
+
+  ATTR_ARCHIVE
+
+
+  32
+
+
+   File 
was changed since last backup (Archive bit).
+
+  
+
+
 If you want to 
know if a bit of the attribute byte is set, use the following query 
method:
 
 Example:
 
 Sub ExampleSetGetAttr
 On Error GoTo 
ErrorHandler ' Define target for error handler
-If Dir("C:\test",16)="" Then MkDir "C:\test"
-If Dir("C:\test\autoexec.sav")="" Then FileCopy 
"c:\autoexec.bat", "c:\test\autoexec.sav"
-SetAttr "c:\test\autoexec.sav" ,0
-FileCopy "c:\autoexec.bat", 
"c:\test\autoexec.sav"
-SetAttr "c:\test\autoexec.sav" ,1
-Print GetAttr( "c:\test\autoexec.sav" )
-End
+ If Dir("C:\test",16)="" Then MkDir "C:\test"
+ If Dir("C:\test\autoexec.sav")="" Then FileCopy 
"c:\autoexec.bat", "c:\test\autoexec.sav"
+ SetAttr "c:\test\autoexec.sav" ,0
+ FileCopy "c:\autoexec.bat", "c:\test\autoexec.sav"
+ SetAttr "c:\test\autoexec.sav" ,1
+ Print GetAttr( "c:\test\autoexec.sav" )
+ End
 ErrorHandler:
-Print Error
-End
+ Print Error
+ End
 End Sub
 
 
diff --git a/source/text/sbasic/shared/03020414.xhp 
b/source/text/sbasic/shared/03020414.xhp
index f7296ea16..fbd727499 100644
--- a/source/text/sbasic/shared/03020414.xhp
+++ b/source/text/sbasic/shared/03020414.xhp
@@ -47,9 +47,54 @@
 FileName: Name 
of the file, including the path, that you want to test attributes of. If you do 
not enter a path, SetAttr searches for the file in the current 
directory. You can also use URL notation.
  
Attribute: Bit pattern defining the attributes that you want to 
set or to clear:
  
Value 
-0 : Normal 
files.
-1 : Read-only 
files.
-32 : File was 
changed since last backup (Archive bit).
+
+
+  
+
+  Named constant
+
+
+  Value
+
+
+  Definition
+
+  
+  
+
+  ATTR_NORMAL
+
+
+  0
+
+
+   Normal 
files.
+
+  
+  
+
+  ATTR_READONLY
+
+
+  1
+
+
+   
Read-only files.
+
+  
+  
+
+  ATTR_HIDDEN
+
+
+  2
+
+
+   Hidden file
+
+  
+
+
 You can set 
multiple attributes by combining the respective values with a logic OR 
statement.
 
 
@@ -59,17 +104,17 @@
 Example:
 
 Sub ExampleSetGetAttr
-On Error 
GoTo ErrorHandler ' Define target for error handler
-If Dir("C:\test",16)="" Then MkDir "C:\test"
-If Dir("C:\test\autoexec.sav")="" Then FileCopy 
"c:\autoexec.bat", "c:\test\autoexec.sav"
-SetAttr "c:\test\autoexec.sav" ,0
-FileCopy "c:\autoexec.bat", 
"c:\test\autoexec.sav"
-SetAttr "c:\test\autoexec.sav" ,1
-Print GetAttr( "c:\test\autoexec.sav" )
-End
+ On Error GoTo 
ErrorHandler ' Define target for error handler
+ If Dir("C:\test",16)="" Then MkDir "C:\test"
+ If Dir("C:\test\autoexec.sav")="" Then FileCopy 
"c:\autoexec.bat", 

[Libreoffice-commits] core.git: helpcontent2

2017-05-16 Thread Olivier Hallot
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fa6e6fe53d22172ba50d3bfbcce883a012b8b64c
Author: Olivier Hallot 
Date:   Fri May 12 14:11:42 2017 -0300

Updated core
Project: help  eaac057360cb1801c4f8b433411a8c8d1a20a539

Add  in BASIC snipets.

Change-Id: I484036b9c9694a58f7f113b2cf1c04a1f0e2c4dc
Reviewed-on: https://gerrit.libreoffice.org/37552
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index 8c7ae43f5361..eaac057360cb 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 8c7ae43f5361145d88cbd2830e3e2eb802117b5e
+Subproject commit eaac057360cb1801c4f8b433411a8c8d1a20a539
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] help.git: source/text

2017-05-16 Thread Olivier Hallot
 source/text/sbasic/shared/03103800.xhp |   20 
 source/text/sbasic/shared/03103900.xhp |   22 +-
 2 files changed, 25 insertions(+), 17 deletions(-)

New commits:
commit eaac057360cb1801c4f8b433411a8c8d1a20a539
Author: Olivier Hallot 
Date:   Fri May 12 14:11:42 2017 -0300

Add  in BASIC snipets.

Change-Id: I484036b9c9694a58f7f113b2cf1c04a1f0e2c4dc
Reviewed-on: https://gerrit.libreoffice.org/37552
Reviewed-by: Olivier Hallot 
Tested-by: Olivier Hallot 

diff --git a/source/text/sbasic/shared/03103800.xhp 
b/source/text/sbasic/shared/03103800.xhp
index baea53fc4..eb3475225 100644
--- a/source/text/sbasic/shared/03103800.xhp
+++ b/source/text/sbasic/shared/03103800.xhp
@@ -37,15 +37,19 @@
 Enables an 
object to be addressed at run-time as a string parameter through the object 
name.
 
 For example, 
the following command:
-MyObj.Prop1.Command = 5
+
+MyObj.Prop1.Command = 5
+
 corresponds to 
the command block:
-Dim ObjVar as 
Object
-Dim ObjProp as 
Object
-ObjName As 
String = "MyObj"
-ObjVar = 
FindObject( ObjName As String )
-PropName As 
String = "Prop1"
-ObjProp = 
FindPropertyObject( ObjVar, PropName As String )
-ObjProp.Command = 5
+
+Dim ObjVar as 
Object
+Dim ObjProp as 
Object
+ObjName As 
String = "MyObj"
+ObjVar = 
FindObject( ObjName As String )
+PropName As 
String = "Prop1"
+ObjProp = 
FindPropertyObject( ObjVar, PropName As String )
+ObjProp.Command 
= 5
+
 This allows 
names to be dynamically created at run-time. For example:
 "TextEdit1" to 
TextEdit5" in a loop to create five control names.
 See also: 
FindPropertyObject
diff --git a/source/text/sbasic/shared/03103900.xhp 
b/source/text/sbasic/shared/03103900.xhp
index f3fd1d339..127da9c65 100644
--- a/source/text/sbasic/shared/03103900.xhp
+++ b/source/text/sbasic/shared/03103900.xhp
@@ -37,15 +37,19 @@
 Enables 
objects to be addressed at run-time as a string parameter using the object 
name.
 
 For instance, 
the command:
-MyObj.Prop1.Command = 5
-corresponds to 
the following command block:
-Dim ObjVar as 
Object
-Dim ObjProp as 
Object
-ObjName As 
String = "MyObj"
-ObjVar = 
FindObject( ObjName As String )
-PropName As 
String = "Prop1"
-ObjProp = 
FindPropertyObject( ObjVar, PropName As String )
-ObjProp.Command = 5
+
+   MyObj.Prop1.Command = 5
+
+corresponds to 
the following command block:
+
+Dim ObjVar as 
Object
+Dim ObjProp as 
Object
+ObjName As 
String = "MyObj"
+ObjVar = 
FindObject( ObjName As String )
+PropName As 
String = "Prop1"
+ObjProp = 
FindPropertyObject( ObjVar, PropName As String )
+ObjProp.Command 
= 5
+
 To dynamically 
create Names at run-time, use:
 "TextEdit1" to 
TextEdit5" in a loop to create five names.
 See also: 
FindObject
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] libvisio.git: src/lib

2017-05-16 Thread David Tardon
 src/lib/VSDXMLParserBase.cpp |   25 +
 1 file changed, 13 insertions(+), 12 deletions(-)

New commits:
commit 38692886d9f7e9f4bfb0f043d2019d6abf20c46b
Author: David Tardon 
Date:   Tue May 16 15:16:35 2017 +0200

nitpick

Change-Id: I48aebd0207376719f70bf590709a3df0eb3452df

diff --git a/src/lib/VSDXMLParserBase.cpp b/src/lib/VSDXMLParserBase.cpp
index b557078..81301d0 100644
--- a/src/lib/VSDXMLParserBase.cpp
+++ b/src/lib/VSDXMLParserBase.cpp
@@ -1983,21 +1983,22 @@ int 
libvisio::VSDXMLParserBase::readNURBSData(boost::optional &data,
 (
   lit("NURBS")
   >> '('
-  >> double_[ref(tmpData.lastKnot) = _1] >> -char_(',')
-  >> int_[ref(tmpData.degree) = _1] >> -char_(',')
-  >> int_[ref(tmpData.xType) = _1] >> -char_(',')
-  >> int_[ref(tmpData.yType) = _1] >> -char_(',')
+  >> double_[ref(tmpData.lastKnot) = _1] >> -lit(',')
+  >> int_[ref(tmpData.degree) = _1] >> -lit(',')
+  >> int_[ref(tmpData.xType) = _1] >> -lit(',')
+  >> int_[ref(tmpData.yType) = _1] >> -lit(',')
   >> // array of points, weights and knots
   (
 (
-  (double_[ref(point.first) = _1] >> -char_(',') >>
+  (double_[ref(point.first) = _1] >> -lit(',') >>
double_[ref(point.second) = _1]
   )[push_back(phx::ref(tmpData.points), 
phx::cref(point))]
-  >> -char_(',') >>
-  double_[push_back(phx::ref(tmpData.knots), _1)] 
>> -char_(',') >>
+  >> -lit(',') >>
+  double_[push_back(phx::ref(tmpData.knots),
+_1)] >> -lit(',') >>
   double_[push_back(phx::ref(tmpData.weights), _1)]
 )
-% -char_(',')
+% -lit(',')
   )
   >> ')'
 ),
@@ -2034,14 +2035,14 @@ int 
libvisio::VSDXMLParserBase::readPolylineData(boost::optional &
 (
   lit("POLYLINE")
   >> '('
-  >> int_[ref(tmpData.xType) = _1] >> -char_(',')
-  >> int_[ref(tmpData.yType) = _1] >> -char_(',')
+  >> int_[ref(tmpData.xType) = _1] >> -lit(',')
+  >> int_[ref(tmpData.yType) = _1] >> -lit(',')
   >> // array of points
   (
 (
-  double_[ref(point.first) = _1] >> -char_(',')
+  double_[ref(point.first) = _1] >> -lit(',')
   >> double_[ref(point.second) = _1]
-)[push_back(phx::ref(tmpData.points), 
phx::cref(point))] % -char_(',')
+)[push_back(phx::ref(tmpData.points), 
phx::cref(point))] % -lit(',')
   )
   >> ')'
 ),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-05-16 Thread Stephan Bergmann
 desktop/source/app/app.cxx |   32 +---
 1 file changed, 5 insertions(+), 27 deletions(-)

New commits:
commit a40e0d00ba597a12de42334ee78af9c5fc68e65e
Author: Stephan Bergmann 
Date:   Tue May 16 15:09:14 2017 +0200

Remove dead rtl::Static instances

...effectively dead ever since c1758889cbd5e8e4afb1044425c908715eb3e1cd 
"Heavily
simplified utl::ConfigManager" changed the references into them (rBrandName
etc.) into non-references (for reasons lost).

Change-Id: Ib77fb458ade9d9b53ec5c1cc1e38785a47c42c42

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 4a86547a56d9..50e1efe5f5cd 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -456,18 +456,8 @@ CommandLineArgs& Desktop::GetCommandLineArgs()
 
 namespace
 {
-struct BrandName
-: public rtl::Static< OUString, BrandName > {};
-struct Version
-: public rtl::Static< OUString, Version > {};
-struct AboutBoxVersion
-: public rtl::Static< OUString, AboutBoxVersion > {};
-struct AboutBoxVersionSuffix
-: public rtl::Static< OUString, AboutBoxVersionSuffix > {};
 struct OOOVendor
 : public rtl::Static< OUString, OOOVendor > {};
-struct Extension
-: public rtl::Static< OUString, Extension > {};
 }
 
 OUString ReplaceStringHookProc( const OUString& rStr )
@@ -478,23 +468,11 @@ OUString ReplaceStringHookProc( const OUString& rStr )
 static std::once_flag aInitOnce;
 std::call_once(aInitOnce, []
 {
-sBrandName = BrandName::get();
-sVersion = Version::get();
-sAboutBoxVersion = AboutBoxVersion::get();
-sAboutBoxVersionSuffix = AboutBoxVersionSuffix::get();
-sExtension = Extension::get();
-
-if ( sBrandName.isEmpty() )
-{
-sBrandName = utl::ConfigManager::getProductName();
-sVersion = utl::ConfigManager::getProductVersion();
-sAboutBoxVersion = utl::ConfigManager::getAboutBoxProductVersion();
-sAboutBoxVersionSuffix = 
utl::ConfigManager::getAboutBoxProductVersionSuffix();
-if (sExtension.isEmpty())
-{
-sExtension = utl::ConfigManager::getProductExtension();
-}
-}
+sBrandName = utl::ConfigManager::getProductName();
+sVersion = utl::ConfigManager::getProductVersion();
+sAboutBoxVersion = utl::ConfigManager::getAboutBoxProductVersion();
+sAboutBoxVersionSuffix = 
utl::ConfigManager::getAboutBoxProductVersionSuffix();
+sExtension = utl::ConfigManager::getProductExtension();
 } );
 
 OUString sRet(rStr);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - test/TileCacheTests.cpp

2017-05-16 Thread Ashod Nakashian
 test/TileCacheTests.cpp |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit f69365eb0de6513fed9a6ffa74899e28175e8737
Author: Ashod Nakashian 
Date:   Sun May 7 11:03:10 2017 -0400

wsd: correct the name of testDisconnectMultiView in output

Change-Id: Ibfcee83825bf8f48e635d93061bf4fd1306a95fc
Reviewed-on: https://gerrit.libreoffice.org/37371
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 
(cherry picked from commit 7633525904083bc427590834a4aa309f84bb32cc)
Reviewed-on: https://gerrit.libreoffice.org/37411
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/test/TileCacheTests.cpp b/test/TileCacheTests.cpp
index 227f7adb..16577b3f 100644
--- a/test/TileCacheTests.cpp
+++ b/test/TileCacheTests.cpp
@@ -354,19 +354,19 @@ void TileCacheTests::testCancelTilesMultiView()
 void TileCacheTests::testDisconnectMultiView()
 {
 std::string documentPath, documentURL;
-getDocumentPathAndURL("setclientpart.ods", documentPath, documentURL, 
"cancelTilesMultiView ");
+getDocumentPathAndURL("setclientpart.ods", documentPath, documentURL, 
"disconnectMultiView ");
 
 const size_t repeat = 4;
 for (size_t j = 1; j <= repeat; ++j)
 {
-std::cerr << "cancelTilesMultiView try #" << j << std::endl;
+std::cerr << "disconnectMultiView try #" << j << std::endl;
 
 // Wait to clear previous sessions.
 countLoolKitProcesses(InitialLoolKitCount);
 
 // Request a huge tile, and cancel immediately.
-auto socket1 = loadDocAndGetSocket(_uri, documentURL, 
"cancelTilesMultiView-1 ");
-auto socket2 = loadDocAndGetSocket(_uri, documentURL, 
"cancelTilesMultiView-2 ", true);
+auto socket1 = loadDocAndGetSocket(_uri, documentURL, 
"disconnectMultiView-1 ");
+auto socket2 = loadDocAndGetSocket(_uri, documentURL, 
"disconnectMultiView-2 ", true);
 
 sendTextFrame(socket1, "tilecombine part=0 width=256 height=256 
tileposx=0,3840,7680,11520,0,3840,7680,11520 
tileposy=0,0,0,0,3840,3840,3840,3840 tilewidth=3840 tileheight=3840", 
"cancelTilesMultiView-1 ");
 sendTextFrame(socket2, "tilecombine part=0 width=256 height=256 
tileposx=0,3840,7680,0 tileposy=0,0,0,22520 tilewidth=3840 tileheight=3840", 
"cancelTilesMultiView-2 ");
@@ -375,11 +375,11 @@ void TileCacheTests::testDisconnectMultiView()
 
 for (auto i = 0; i < 4; ++i)
 {
-getTileMessage(*socket2, "cancelTilesMultiView-2 ");
+getTileMessage(*socket2, "disconnectMultiView-2 ");
 }
 
 // Should never get more than 4 tiles on socket2.
-const auto res2 = getResponseString(socket2, "tile:", 
"cancelTilesMultiView-2 ", 500);
+const auto res2 = getResponseString(socket2, "tile:", 
"disconnectMultiView-2 ", 500);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - 2 commits - loleaflet/src

2017-05-16 Thread Marco Cecchetti
 loleaflet/src/control/Parts.js   |3 
 loleaflet/src/layer/marker/DivOverlay.js |2 
 loleaflet/src/layer/tile/CalcTileLayer.js|3 
 loleaflet/src/layer/tile/ImpressTileLayer.js |  133 +--
 4 files changed, 109 insertions(+), 32 deletions(-)

New commits:
commit 5379bf03be3e2f88809543e9a874a2e18133cace
Author: Marco Cecchetti 
Date:   Sun May 14 15:16:24 2017 +0200

loleaflet: impress: comments that are being modified are shown twice

Reworked handling of annotation layout. Now it behaves more like
writer annotations.

Now scrolling up annotations leads to scrolling the current slide too
when it is required in order to show not visible annotations.

Moreover the top visible annotation is now remembered for each slide,
and when the top annotation is not the first one, a bit of the bottom
of the previous annotation is showed so that the user gets aware that
there are more annotations above.

Change-Id: I3d087a8db35143a5e3abcd3e95e5e612d7638891
Reviewed-on: https://gerrit.libreoffice.org/37629
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js 
b/loleaflet/src/layer/tile/ImpressTileLayer.js
index ee7f2ae5..209232d8 100644
--- a/loleaflet/src/layer/tile/ImpressTileLayer.js
+++ b/loleaflet/src/layer/tile/ImpressTileLayer.js
@@ -7,9 +7,18 @@ L.ImpressTileLayer = L.TileLayer.extend({
extraSize: L.point(290, 0),
 
newAnnotation: function (comment) {
-   var annotation = L.annotation(this._map.getCenter(), comment, 
{noMenu: true}).addTo(this._map);
-   annotation.edit();
-   annotation.focus();
+   if (this._draft) {
+   return;
+   }
+   this.onAnnotationCancel();
+   this._draft = L.annotation(L.latLng(0, 0), comment, {noMenu: 
true}).addTo(this._map);
+   this._draft.edit();
+   var mapCenter = 
this._map.latLngToLayerPoint(this._map.getCenter());
+   var bounds = this._draft.getBounds();
+   var topLeft = mapCenter.subtract(L.point(bounds.max.x - 
bounds.min.x, (bounds.max.y - bounds.min.y)/2));
+   this._draft.setLatLng(this._map.layerPointToLatLng(topLeft));
+   this.layoutAnnotations();
+   this._draft.focus();
},
 
beforeAdd: function (map) {
@@ -33,6 +42,7 @@ L.ImpressTileLayer = L.TileLayer.extend({
},
 
hideAnnotations: function (part) {
+   this._selectedAnnotation = undefined;
var annotations = this._annotations[this._partHashes[part]];
for (var index in annotations) {
annotations[index].hide();
@@ -54,27 +64,40 @@ L.ImpressTileLayer = L.TileLayer.extend({
onAdd: function (map) {
L.TileLayer.prototype.onAdd.call(this, map);
this._annotations = {};
-   this._topAnnotation = 0;
+   this._topAnnotation = [];
+   this._topAnnotation[this._selectedPart] = 0;
+   this._selectedAnnotation = undefined;
+   this._draft = null;
},
 
onAnnotationCancel: function (e) {
-   this._map.removeLayer(e.annotation);
+   if (this._draft) {
+   this._map.removeLayer(this._draft);
+   this._draft = null;
+   }
this._map.focus();
+   this._selectedAnnotation = undefined;
+   this.layoutAnnotations();
},
 
onAnnotationModify: function (annotation) {
-   var draft = L.annotation(this._map.getCenter(), 
annotation._data).addTo(this._map);
-   draft.edit();
-   draft.focus();
+   this.onAnnotationCancel();
+   this._selectedAnnotation = annotation._data.id;
+   annotation.edit();
+   this.scrollUntilAnnotationIsVisible(annotation);
+   annotation.focus();
},
 
onAnnotationReply: function (annotation) {
-   var draft = L.annotation(this._map.getCenter(), 
annotation._data).addTo(this._map);
-   draft.reply();
-   draft.focus();
+   this.onAnnotationCancel();
+   this._selectedAnnotation = annotation._data.id;
+   annotation.reply();
+   this.scrollUntilAnnotationIsVisible(annotation);
+   annotation.focus();
},
 
onAnnotationRemove: function (id) {
+   this.onAnnotationCancel();
var comment = {
Id: {
type: 'string',
@@ -87,14 +110,16 @@ L.ImpressTileLayer = L.TileLayer.extend({
 
onAnnotationSave: function (e) {
var comment;
-   if (e.annotation._data.id === 'new') {

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

2017-05-16 Thread Justin Luth
 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx|   18 ++
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx |7 ---
 sw/source/filter/ww8/docxattributeoutput.cxx |7 +--
 3 files changed, 23 insertions(+), 9 deletions(-)

New commits:
commit c7e31f492140a064d9c152583bda3d111c8bee83
Author: Justin Luth 
Date:   Mon May 15 09:28:59 2017 +0300

tdf#107801 docx export: support w:kern

Writer only enables or disables pair kerning (autokern).
Word uses a minimum font size to determine which characters
to kern. Since these documents are round-tripping through
Writer, and every size is kerned by Writer, the minimum size is
forced to 1pt and the original minimum font size is lost.

This is a followup to commit 38b0c24fa5cbb4246e03d77ac022dfdc9fdede03
for related tdf#105454 DOCX import: fix unwanted enabled-by-default
kerning.

Tested in Word 2003, 2007, 2013.

Change-Id: I7678a544f455fd06bec5e7d864b5c27ab26bf6d3
Reviewed-on: https://gerrit.libreoffice.org/37574
Tested-by: Jenkins 
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/extras/ooxmlimport/data/kern.docx 
b/sw/qa/extras/ooxmlexport/data/kern.docx
similarity index 100%
rename from sw/qa/extras/ooxmlimport/data/kern.docx
rename to sw/qa/extras/ooxmlexport/data/kern.docx
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index 7370fe83da3d..73077b4fe40a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -91,10 +91,25 @@ DECLARE_OOXMLEXPORT_TEST(testTdf106970, "tdf106970.docx")
 CPPUNIT_ASSERT_EQUAL(static_cast(494), 
getProperty(getParagraph(4), "ParaBottomMargin"));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testKern, "kern.docx")
+{
+CPPUNIT_ASSERT(getProperty(getRun(getParagraph(1), 1), 
"CharAutoKerning"));
+// This failed: kerning was also enabled for the second paragraph.
+CPPUNIT_ASSERT(!getProperty(getRun(getParagraph(2), 1), 
"CharAutoKerning"));
+
+uno::Reference 
xStyle(getStyles("ParagraphStyles")->getByName("Default Style"), 
uno::UNO_QUERY);
+//tdf107801: kerning normally isn't enabled by default for .docx
+CPPUNIT_ASSERT_EQUAL_MESSAGE("AutoKern should be false", false, 
getProperty(xStyle, "CharAutoKerning"));
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf89377, 
"tdf89377_tableWithBreakBeforeParaStyle.docx")
 {
 // the paragraph style should set table's text-flow break-before-page
 CPPUNIT_ASSERT_EQUAL( 3, getPages() );
+
+uno::Reference 
xStyle(getStyles("ParagraphStyles")->getByName("Default Style"), 
uno::UNO_QUERY);
+//tdf107801: kerning info wasn't exported previously.
+CPPUNIT_ASSERT_EQUAL_MESSAGE("AutoKern should be true", true, 
getProperty(xStyle, "CharAutoKerning"));
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTdf104420, "tdf104420_lostParagraph.docx")
@@ -358,6 +373,9 @@ DECLARE_OOXMLEXPORT_TEST(testTdf103651, "tdf103651.docx")
 xTextField->getPropertyValue("Content") >>= sContent;
 // Comment in the first paragraph should not have smiley ( 0xf04a ).
 CPPUNIT_ASSERT_EQUAL( sal_Int32( -1 ) , sContent.indexOf( u'\xf04a' ));
+
+// this document has a w:kern setting in the DocDefault character 
properties.  Ensure it applies.
+CPPUNIT_ASSERT(getProperty(getRun(getParagraph(1), 1), 
"CharAutoKerning"));
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTdf99227, "tdf99227.docx")
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index a314b212b81a..87ccce61d9b5 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -669,13 +669,6 @@ DECLARE_OOXMLIMPORT_TEST(testN820504, "n820504.docx")
 CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, 
getProperty(getShape(1), "AnchorType"));
 }
 
-DECLARE_OOXMLIMPORT_TEST(testKern, "kern.docx")
-{
-CPPUNIT_ASSERT(getProperty(getRun(getParagraph(1), 1), 
"CharAutoKerning"));
-// This failed: kerning was also enabled for the second paragraph.
-CPPUNIT_ASSERT(!getProperty(getRun(getParagraph(2), 1), 
"CharAutoKerning"));
-}
-
 DECLARE_OOXMLIMPORT_TEST(testFdo43641, "fdo43641.docx")
 {
 uno::Reference xGroupShape(getShape(1), 
uno::UNO_QUERY);
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 83dfe43b5372..f82667c6ed2c 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6483,9 +6483,12 @@ void DocxAttributeOutput::CharWeight( const 
SvxWeightItem& rWeight )
 m_pSerializer->singleElementNS( XML_w, XML_b, FSNS( XML_w, XML_val ), 
"false", FSEND );
 }
 
-void DocxAttributeOutput::CharAutoKern( const SvxAutoKernItem& )
+void DocxAttributeOutput::CharAutoKern( const SvxAutoKernItem& rAutoKern )
 {
-SAL_INFO("sw.ww8", "TODO DocxAttributeOutput::CharAutoKern()" );
+// auto kerning is bound to a minimum f

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - loleaflet/src

2017-05-16 Thread Marco Cecchetti
 loleaflet/src/layer/tile/CalcTileLayer.js |   36 ++
 1 file changed, 27 insertions(+), 9 deletions(-)

New commits:
commit 566a332d5cc5c7e12269047cddd4353c7e6cfc96
Author: Marco Cecchetti 
Date:   Tue Apr 25 18:57:30 2017 +0200

loleaflet: misplaced comment mark on inserting/deleting/resizing row/col

Change-Id: Ib95870905d1bfc613ba454c7126501b3533e4ba5
Reviewed-on: https://gerrit.libreoffice.org/37083
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index c154d7a4..cb82396d 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -13,7 +13,7 @@ L.CalcTileLayer = L.TileLayer.extend({
},
 
newAnnotation: function (comment) {
-   var annotations = 
this._annotations[this._partNames[this._selectedPart]];
+   var annotations = this._annotations[this._selectedPart];
var annotation;
for (var key in annotations) {
if 
(this._cellCursor.contains(annotations[key]._annotation._data.cellPos)) {
@@ -72,7 +72,7 @@ L.CalcTileLayer = L.TileLayer.extend({
value: id
}
};
-   var tab = id.substring(0, id.indexOf('.'));
+   var tab = this._selectedPart;
this._map.sendUnoCommand('.uno:DeleteNote', comment);
this._annotations[tab][id].closePopup();
this._map.focus();
@@ -92,14 +92,15 @@ L.CalcTileLayer = L.TileLayer.extend({
},
 
showAnnotations: function () {
-   var annotations = 
this._annotations[this._partNames[this._selectedPart]];
+   var annotations = this._annotations[this._selectedPart];
for (var key in annotations) {
this.showAnnotation(annotations[key]);
}
},
 
hideAnnotations: function (part) {
-   var annotations = this._annotations[this._partNames[part]];
+
+   var annotations = this._annotations[part];
for (var key in annotations) {
this.hideAnnotation(annotations[key]);
}
@@ -175,7 +176,7 @@ L.CalcTileLayer = L.TileLayer.extend({
_onMessage: function (textMsg, img) {
if (textMsg.startsWith('comment:')) {
var obj = 
JSON.parse(textMsg.substring('comment:'.length + 1));
-   obj.comment.tab = obj.comment.id.substring(0, 
obj.comment.id.indexOf('.'));
+   obj.comment.tab = parseInt(obj.comment.tab);
if (obj.comment.action === 'Add') {
obj.comment.cellPos = 
L.LOUtil.stringToBounds(obj.comment.cellPos);
obj.comment.cellPos = 
L.latLngBounds(this._twipsToLatLng(obj.comment.cellPos.getBottomLeft()),
@@ -184,7 +185,7 @@ L.CalcTileLayer = L.TileLayer.extend({
this._annotations[obj.comment.tab] = {};
}

this._annotations[obj.comment.tab][obj.comment.id] = 
this.createAnnotation(obj.comment);
-   if (obj.comment.tab === 
this._partNames[this._selectedPart]) {
+   if (obj.comment.tab === this._selectedPart) {

this.showAnnotation(this._annotations[obj.comment.tab][obj.comment.id]);
}
} else if (obj.comment.action === 'Remove') {
@@ -205,8 +206,10 @@ L.CalcTileLayer = L.TileLayer.extend({
}
} else if (textMsg.startsWith('invalidateheader: column')) {
this._map.fire('updaterowcolumnheaders', {x: 
this._map._getTopLeftPoint().x, y: 0, offset: {x: undefined, y: 0}});
+   this._map._socket.sendMessage('commandvalues 
command=.uno:ViewAnnotationsPosition');
} else if (textMsg.startsWith('invalidateheader: row')) {
this._map.fire('updaterowcolumnheaders', {x: 0, y: 
this._map._getTopLeftPoint().y, offset: {x: 0, y: undefined}});
+   this._map._socket.sendMessage('commandvalues 
command=.uno:ViewAnnotationsPosition');
} else {
L.TileLayer.prototype._onMessage.call(this, textMsg, 
img);
}
@@ -436,7 +439,7 @@ L.CalcTileLayer = L.TileLayer.extend({
this.clearAnnotations();
for (var index in values.comments) {
comment = values.comments[index];
-   comment.tab = comment.id.substring(0, 
comment.id.indexOf('.'));
+   comment.tab = parseInt(comment.tab);

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - wsd/ClientSession.cpp wsd/ClientSession.hpp wsd/DocumentBroker.cpp wsd/Storage.cpp wsd/Storage.hpp

2017-05-16 Thread Jan Holesovsky
 wsd/ClientSession.cpp  |   13 +
 wsd/ClientSession.hpp  |7 +
 wsd/DocumentBroker.cpp |   31 ++-
 wsd/Storage.cpp|   65 +
 wsd/Storage.hpp|   23 +
 5 files changed, 90 insertions(+), 49 deletions(-)

New commits:
commit 84153e56d6d41d86f0b3960620c3d0bd870e338d
Author: Jan Holesovsky 
Date:   Fri May 12 17:42:03 2017 +0200

wsd: When connecting new sessions, always use the original URI...

...but in combination with the appropriate session's access_token to always
authenticate against the same instance of the WOPI host.

Change-Id: Ic94dfa8fcb226a2d134272b22edc1f8f76c24e34
Reviewed-on: https://gerrit.libreoffice.org/37548
Reviewed-by: Ashod Nakashian 
Tested-by: Ashod Nakashian 

diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 4c965d7b..c1693c60 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -724,6 +724,19 @@ bool ClientSession::forwardToClient(const 
std::shared_ptr& payload)
 return true;
 }
 
+std::string ClientSession::getAccessToken() const
+{
+std::string accessToken;
+Poco::URI::QueryParameters queryParams = _uriPublic.getQueryParameters();
+for (auto& param: queryParams)
+{
+if (param.first == "access_token")
+return param.second;
+}
+
+return std::string();
+}
+
 void ClientSession::onDisconnect()
 {
 LOG_INF(getName() << " Disconnected, current number of connections: " << 
LOOLWSD::NumConnections);
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index a8e85127..96f090d7 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -89,8 +89,15 @@ public:
 
 /// Exact URI (including query params - access tokens etc.) with which
 /// client made the request to us
+///
+/// Note: This URI is unsafe - when connecting to existing sessions, we 
must
+/// ignore everything but the access_token, and use the access_token with
+/// the URI of the initial request.
 const Poco::URI& getPublicUri() const { return _uriPublic; }
 
+/// The access token of this session.
+std::string getAccessToken() const;
+
 /// Set WOPI fileinfo object
 void setWopiFileInfo(std::unique_ptr& 
wopiFileInfo) { _wopiFileInfo = std::move(wopiFileInfo); }
 
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index b9a805b9..5c09854a 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -385,9 +385,6 @@ bool DocumentBroker::load(const 
std::shared_ptr& session, const s
 return false;
 }
 
-const Poco::URI& uriPublic = session->getPublicUri();
-LOG_DBG("Loading from URI: " << uriPublic.toString());
-
 _jailId = jailId;
 
 // The URL is the publicly visible one, not visible in the chroot jail.
@@ -404,7 +401,9 @@ bool DocumentBroker::load(const 
std::shared_ptr& session, const s
 {
 // Pass the public URI to storage as it needs to load using the token
 // and other storage-specific data provided in the URI.
-LOG_DBG("Creating new storage instance for URI [" << 
uriPublic.toString() << "].");
+const Poco::URI& uriPublic = session->getPublicUri();
+LOG_DBG("Loading, and creating new storage instance for URI [" << 
uriPublic.toString() << "].");
+
 _storage = StorageBase::create(uriPublic, jailRoot, 
jailPath.toString());
 if (_storage == nullptr)
 {
@@ -423,8 +422,7 @@ bool DocumentBroker::load(const 
std::shared_ptr& session, const s
 WopiStorage* wopiStorage = dynamic_cast(_storage.get());
 if (wopiStorage != nullptr)
 {
-std::unique_ptr wopifileinfo =
- wopiStorage->getWOPIFileInfo(uriPublic);
+std::unique_ptr wopifileinfo = 
wopiStorage->getWOPIFileInfo(session->getAccessToken());
 userid = wopifileinfo->_userid;
 username = wopifileinfo->_username;
 
@@ -475,8 +473,7 @@ bool DocumentBroker::load(const 
std::shared_ptr& session, const s
 LocalStorage* localStorage = 
dynamic_cast(_storage.get());
 if (localStorage != nullptr)
 {
-std::unique_ptr localfileinfo =
-  
localStorage->getLocalFileInfo(uriPublic);
+std::unique_ptr localfileinfo = 
localStorage->getLocalFileInfo();
 userid = localfileinfo->_userid;
 username = localfileinfo->_username;
 }
@@ -490,7 +487,7 @@ bool DocumentBroker::load(const 
std::shared_ptr& session, const s
 const auto fileInfo = _storage->getFileInfo();
 if (!fileInfo.isValid())
 {
-LOG_ERR("Invalid fileinfo for URI [" << uriPublic.toString() << "].");
+LOG_ERR("Invalid fileinfo for URI [" << 
session->getPublicUri().toString() << "].");
 return false;
 }
 
@@ -511,7 +508,7 @@ bool DocumentBroker::load(const 
std::shared_ptr& session, const s
 fileInf

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

2017-05-16 Thread Caolán McNamara
 include/vcl/commandevent.hxx   |6 +++---
 include/vcl/window.hxx |6 +++---
 vcl/inc/salwtype.hxx   |2 +-
 vcl/source/window/commandevent.cxx |4 ++--
 vcl/source/window/window2.cxx  |   14 +++---
 vcl/unx/gtk3/gtk3gtkframe.cxx  |   10 ++
 6 files changed, 18 insertions(+), 24 deletions(-)

New commits:
commit b53c84af0a34aa9193b0e35363ca2ebe00c3e32c
Author: Caolán McNamara 
Date:   Tue May 16 10:12:09 2017 +0100

Resolves: rhbz#1367846 improve gtk3 trackpad scrolling

convert number of "lines" scrolled to double and allow
fractional parts of lines/columns

Change-Id: Ib99c815cfc8823e22fc1d76e201903c34ed0f61b
Reviewed-on: https://gerrit.libreoffice.org/37669
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/vcl/commandevent.hxx b/include/vcl/commandevent.hxx
index 7b143e402ce4..68ea0c5184d7 100644
--- a/include/vcl/commandevent.hxx
+++ b/include/vcl/commandevent.hxx
@@ -141,7 +141,7 @@ class VCL_DLLPUBLIC CommandWheelData
 private:
 long  mnDelta;
 long  mnNotchDelta;
-sal_uLong mnLines;
+doublemnLines;
 CommandWheelMode  mnWheelMode;
 sal_uInt16mnCode;
 bool  mbHorz;
@@ -150,13 +150,13 @@ private:
 public:
 CommandWheelData();
 CommandWheelData( long nWheelDelta, long nWheelNotchDelta,
-  sal_uLong nScrollLines,
+  double nScrollLines,
   CommandWheelMode nWheelMode, sal_uInt16 
nKeyModifier,
   bool bHorz, bool bDeltaIsPixel = false );
 
 longGetDelta() const { return mnDelta; }
 longGetNotchDelta() const { return mnNotchDelta; }
-sal_uLong   GetScrollLines() const { return mnLines; }
+double  GetScrollLines() const { return mnLines; }
 boolIsHorz() const { return mbHorz; }
 boolIsDeltaPixel() const { return mbDeltaIsPixel; }
 
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index d59ac3e99302..7e67182d5095 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -714,9 +714,9 @@ private:
 SAL_DLLPRIVATE void 
ImplCallActivateListeners(vcl::Window*);
 SAL_DLLPRIVATE void 
ImplCallDeactivateListeners(vcl::Window*);
 
-SAL_DLLPRIVATE static void  ImplHandleScroll( ScrollBar* pHScrl, 
long nX, ScrollBar* pVScrl, long nY );
+SAL_DLLPRIVATE static void  ImplHandleScroll(ScrollBar* pHScrl, 
double nX, ScrollBar* pVScrl, double nY);
 
-SAL_DLLPRIVATE tools::Rectangle
ImplOutputToUnmirroredAbsoluteScreenPixel( const tools::Rectangle& rRect ) 
const;
+SAL_DLLPRIVATE tools::Rectangle 
ImplOutputToUnmirroredAbsoluteScreenPixel( const tools::Rectangle& rRect ) 
const;
 SAL_DLLPRIVATE long ImplGetUnmirroredOutOffX();
 
 // retrieves the list of owner draw decorated windows for this window 
hiearchy
@@ -724,7 +724,7 @@ private:
 
 SAL_DLLPRIVATE vcl::Window* ImplGetTopmostFrameWindow();
 
-SAL_DLLPRIVATE tools::RectangleImplGetWindowExtentsRelative( 
vcl::Window *pRelativeWindow, bool bClientOnly ) const;
+SAL_DLLPRIVATE tools::Rectangle ImplGetWindowExtentsRelative( 
vcl::Window *pRelativeWindow, bool bClientOnly ) const;
 
 SAL_DLLPRIVATE bool ImplStopDnd();
 SAL_DLLPRIVATE void ImplStartDnd();
diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx
index 168185913880..605e26c94774 100644
--- a/vcl/inc/salwtype.hxx
+++ b/vcl/inc/salwtype.hxx
@@ -151,7 +151,7 @@ struct SalWheelMouseEvent
 longmnY;// Y-Position (Pixel, TopLeft-Output)
 longmnDelta;// Number of rotations
 longmnNotchDelta;   // Number of fixed rotations
-sal_uLong   mnScrollLines;  // Actual number of lines to scroll
+double  mnScrollLines;  // Actual number of lines to scroll
 sal_uInt16  mnCode; // SV-Modifiercode 
(KEY_SHIFT|KEY_MOD1|KEY_MOD2|MOUSE_LEFT|MOUSE_MIDDLE|MOUSE_RIGHT)
 boolmbHorz; // Horizontal
 boolmbDeltaIsPixel; // delta value is a pixel value (on touch 
devices)
diff --git a/vcl/source/window/commandevent.cxx 
b/vcl/source/window/commandevent.cxx
index b9525ac3a3fb..b298022abc56 100644
--- a/vcl/source/window/commandevent.cxx
+++ b/vcl/source/window/commandevent.cxx
@@ -64,7 +64,7 @@ CommandWheelData::CommandWheelData()
 {
 mnDelta = 0;
 mnNotchDelta= 0;
-mnLines = 0;
+mnLines = 0.0;
 mnWheelMode = CommandWheelMode::NONE;
 mnCode  = 0;
 mbHorz  = false;
@@ -72,7 +72,7 @@ CommandWheelData::CommandWheelData()

[Libreoffice-commits] core.git: basic/source canvas/source cui/source desktop/source include/desktop lingucomponent/source scripting/source sd/source uui/source

2017-05-16 Thread Noel Grandin
 basic/source/runtime/dllmgr-none.cxx  |4 +-
 canvas/source/opengl/ogl_spritedevicehelper.cxx   |2 -
 cui/source/dialogs/hangulhanjadlg.cxx |6 +--
 cui/source/inc/hangulhanjadlg.hxx |2 -
 cui/source/inc/numpages.hxx   |2 -
 cui/source/options/connpooloptions.cxx|6 +--
 cui/source/options/connpooloptions.hxx|2 -
 cui/source/tabpages/numpages.cxx  |4 +-
 desktop/source/app/officeipcthread.cxx|2 -
 desktop/source/deployment/gui/dp_gui_dialog2.cxx  |4 +-
 desktop/source/deployment/gui/dp_gui_service.cxx  |2 -
 desktop/source/deployment/gui/dp_gui_theextmgr.cxx|2 -
 desktop/source/deployment/gui/dp_gui_theextmgr.hxx|2 -
 desktop/source/lib/init.cxx   |   18 +-
 include/desktop/crashreport.hxx   |2 -
 lingucomponent/source/hyphenator/hyphen/hreg.cxx  |5 +--
 lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx |2 -
 lingucomponent/source/hyphenator/hyphen/hyphenimp.hxx |3 -
 lingucomponent/source/spellcheck/spell/sreg.cxx   |5 +--
 lingucomponent/source/spellcheck/spell/sspellimp.cxx  |2 -
 lingucomponent/source/spellcheck/spell/sspellimp.hxx  |3 -
 lingucomponent/source/thesaurus/libnth/nthesimp.cxx   |2 -
 lingucomponent/source/thesaurus/libnth/nthesimp.hxx   |3 -
 lingucomponent/source/thesaurus/libnth/ntreg.cxx  |5 +--
 scripting/source/vbaevents/eventhelper.cxx|4 +-
 sd/source/ui/app/sdxfer.cxx   |4 +-
 sd/source/ui/dlg/SpellDialogChildWindow.cxx   |2 -
 sd/source/ui/inc/sdxfer.hxx   |2 -
 uui/source/iahndl.cxx |   30 +++---
 uui/source/secmacrowarnings.cxx   |2 -
 uui/source/secmacrowarnings.hxx   |2 -
 31 files changed, 63 insertions(+), 73 deletions(-)

New commits:
commit 6df22f0ec513415cf6c920c1f8063dabe7303c06
Author: Noel Grandin 
Date:   Tue May 16 12:36:22 2017 +0200

loplugin:checkunusedparams various

Change-Id: I5d1cc807134230d86e0226a12fada204004312d3
Reviewed-on: https://gerrit.libreoffice.org/37675
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/basic/source/runtime/dllmgr-none.cxx 
b/basic/source/runtime/dllmgr-none.cxx
index 8c0736463370..c423a95c15e6 100644
--- a/basic/source/runtime/dllmgr-none.cxx
+++ b/basic/source/runtime/dllmgr-none.cxx
@@ -99,7 +99,7 @@ SbError builtin_kernel32(const OUString &aFuncName, SbxArray 
*pArgs,
 SbError SbiDllMgr::Call(
 const OUString &aFuncName, const OUString &aDllName,
 SbxArray *pArgs, SbxVariable &rRetVal,
-bool /* bCDecl */)
+SAL_UNUSED_PARAMETER bool /* bCDecl */)
 {
 if (aDllName == "kernel32")
 return builtin_kernel32(aFuncName, pArgs, rRetVal);
@@ -107,7 +107,7 @@ SbError SbiDllMgr::Call(
 return ERRCODE_BASIC_NOT_IMPLEMENTED;
 }
 
-void SbiDllMgr::FreeDll(OUString const &) {}
+void SbiDllMgr::FreeDll(SAL_UNUSED_PARAMETER OUString const &) {}
 
 SbiDllMgr::SbiDllMgr(): impl_(new Impl) {}
 
diff --git a/canvas/source/opengl/ogl_spritedevicehelper.cxx 
b/canvas/source/opengl/ogl_spritedevicehelper.cxx
index 6ac6b64250b2..49c7cfd2f285 100644
--- a/canvas/source/opengl/ogl_spritedevicehelper.cxx
+++ b/canvas/source/opengl/ogl_spritedevicehelper.cxx
@@ -271,7 +271,7 @@ namespace oglcanvas
 };
 }
 
-bool SpriteDeviceHelper::showBuffer( bool bIsVisible, bool /*bUpdateAll*/ )
+bool SpriteDeviceHelper::showBuffer( bool bIsVisible, SAL_UNUSED_PARAMETER 
bool /*bUpdateAll*/ )
 {
 // hidden or disposed?
 if( !bIsVisible || !mxContext->isInitialized() || !mpSpriteCanvas )
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx 
b/cui/source/dialogs/hangulhanjadlg.cxx
index fb766aba1653..7cbc09cb18d6 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -1533,7 +1533,7 @@ namespace svx
 if( xDict.is() && m_pSuggestions )
 {
 //delete old entry
-bool bRemovedSomething = DeleteEntryFromDictionary( m_aOriginal, 
xDict );
+bool bRemovedSomething = DeleteEntryFromDictionary( xDict );
 
 OUStringaLeft( m_aOriginal );
 const OUString*   pRight = m_pSuggestions->First();
@@ -1565,7 +1565,7 @@ namespace svx
 }
 }
 
-bool HangulHanjaEditDictDialog::DeleteEntryFromDictionary( const 
OUString&, const Reference< XConversionDictionary >& xDict  )
+bool HangulHanjaEditDictDialog::DeleteEntryFromDictionary( const 
Reference< XConversionDictionary >& xDict  )
 {
 bool bRemovedSomething = false;
 if( xDict.is() )
@@ -1596,7 +1596,7 @@ namespace svx
 
 IMPL_LINK_NOARG( HangulHanjaEditDictDialog, Dele

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - configure.ac

2017-05-16 Thread Jan Holesovsky
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 60cf3deece0595660bc9f4d402a06aae0d862014
Author: Jan Holesovsky 
Date:   Tue May 16 14:14:27 2017 +0200

Bump version to 5.3-12.

Change-Id: I922085fdfaeaccf914550e2eeb5129a43af2062a

diff --git a/configure.ac b/configure.ac
index 5a26ba861e0f..0a0fb569b4ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for 
the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no 
idea.
 
-AC_INIT([Collabora Office],[5.3.10.11],[],[],[https://collaboraoffice.com/])
+AC_INIT([Collabora Office],[5.3.10.12],[],[],[https://collaboraoffice.com/])
 
 AC_PREREQ([2.59])
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/o3tl

2017-05-16 Thread Stephan Bergmann
 include/o3tl/strong_int.hxx |   50 +---
 1 file changed, 47 insertions(+), 3 deletions(-)

New commits:
commit a6f29aae36e5b07d877d7ea833b6d06b49b5574a
Author: Stephan Bergmann 
Date:   Tue May 16 10:11:20 2017 +0200

Blind fix for MSVC 2017 warning C4018: '>=': signed/unsigned mismatch

...and get rid of the arbitrary, bogus 'long' strong_int ctor parameter
type

Change-Id: If71f4d3993e984b4089b74ff96dce75c68a6cf77
Reviewed-on: https://gerrit.libreoffice.org/37665
Reviewed-by: Stephan Bergmann 
Tested-by: Stephan Bergmann 

diff --git a/include/o3tl/strong_int.hxx b/include/o3tl/strong_int.hxx
index ce5466e45167..8a9d91dbfb8c 100644
--- a/include/o3tl/strong_int.hxx
+++ b/include/o3tl/strong_int.hxx
@@ -23,10 +23,52 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace o3tl
 {
 
+#if HAVE_CXX14_CONSTEXPR
+
+namespace detail {
+
+template constexpr
+typename std::enable_if<
+std::is_signed::value && std::is_signed::value, bool>::type
+isInRange(T2 value) {
+return value >= std::numeric_limits::min()
+&& value <= std::numeric_limits::max();
+}
+
+template constexpr
+typename std::enable_if<
+std::is_signed::value && std::is_unsigned::value, bool>::type
+isInRange(T2 value) {
+return value
+<= static_cast::type>(
+std::numeric_limits::max());
+}
+
+template constexpr
+typename std::enable_if<
+std::is_unsigned::value && std::is_signed::value, bool>::type
+isInRange(T2 value) {
+return value >= 0
+&& (static_cast::type>(value)
+<= std::numeric_limits::max());
+}
+
+template constexpr
+typename std::enable_if<
+std::is_unsigned::value && std::is_unsigned::value, bool>::type
+isInRange(T2 value) {
+return value <= std::numeric_limits::max();
+}
+
+}
+
+#endif
+
 ///
 /// Wrap up an integer type so that we prevent accidental conversion to other 
integer types.
 ///
@@ -42,12 +84,14 @@ template 
 struct strong_int
 {
 public:
-explicit constexpr strong_int(long value) : m_value(value)
+template explicit constexpr strong_int(
+T value,
+typename std::enable_if::value, int>::type = 0):
+m_value(value)
 {
 #if HAVE_CXX14_CONSTEXPR
 // catch attempts to pass in out-of-range values early
-assert(value >= std::numeric_limits::min()
-   && value <= std::numeric_limits::max()
+assert(detail::isInRange(value)
&& "out of range");
 #endif
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-05-16 Thread Marco Cecchetti
 sc/source/ui/view/tabview.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 942a5b532eca311914335e8fc104cc1d0a93c8ea
Author: Marco Cecchetti 
Date:   Mon May 8 21:10:00 2017 +0200

lok: sc: selection overlay was not updated on document size changed

Change-Id: I193f37d50ac3ff0ccbf7e39caab4bf25ed3c9a9c
Reviewed-on: https://gerrit.libreoffice.org/37403
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index de98051ff3c5..96f10d6729de 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -2652,6 +2652,7 @@ OUString ScTabView::getRowColumnHeaders(const Rectangle& 
rRectangle)
 // Only invalidate if spreadsheet extended to the bottom
 if (aNewRowArea.getHeight())
 {
+UpdateSelectionOverlay();
 SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), 
aNewRowArea.toString());
 }
 }
@@ -2759,6 +2760,7 @@ OUString ScTabView::getRowColumnHeaders(const Rectangle& 
rRectangle)
 // Only invalidate if spreadsheet extended to the bottom
 if (aNewColArea.getWidth())
 {
+UpdateSelectionOverlay();
 SfxLokHelper::notifyInvalidation(aViewData.GetViewShell(), 
aNewColArea.toString());
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-05-16 Thread Marco Cecchetti
 sc/source/ui/undo/undoblk.cxx  |   44 -
 sc/source/ui/undo/undoblk2.cxx |3 ++
 2 files changed, 46 insertions(+), 1 deletion(-)

New commits:
commit c01df160eb45e1f5a386f9ad7cb3da72fc7f278f
Author: Marco Cecchetti 
Date:   Wed May 3 22:57:09 2017 +0200

lok: sc: invalidate cached position on undo row/col operations

Change-Id: I822ecdeda0e7c26c65096e5a249a35f7c2f3a9fe
Reviewed-on: https://gerrit.libreoffice.org/37259
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index d79fd8335c0c..6af80db9eb15 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -159,6 +159,7 @@ void ScUndoInsertCells::DoChange( const bool bUndo )
 
 // refresh of merged cells has to be after inserting/deleting
 
+ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
 switch (eCmd)
 {
 case INS_INSROWS_BEFORE:
@@ -166,12 +167,19 @@ void ScUndoInsertCells::DoChange( const bool bUndo )
 case INS_CELLSDOWN:
 for( i=0; i(aEffRange.aEnd.Row()-aEffRange.aStart.Row()+1));
 else
 rDoc.InsertRow( aEffRange.aStart.Col(), pTabs[i], 
aEffRange.aEnd.Col(), pTabs[i]+pScenarios[i],
 aEffRange.aStart.Row(), 
static_cast(aEffRange.aEnd.Row()-aEffRange.aStart.Row()+1));
+
+if (pViewShell)
+{
+const long nSign = bUndo ? -1 : 1;
+pViewShell->OnLOKInsertDeleteRow(aEffRange.aStart.Row(), 
nSign * (aEffRange.aEnd.Row()-aEffRange.aStart.Row()+1));
+}
 }
 break;
 case INS_INSCOLS_BEFORE:
@@ -185,6 +193,12 @@ void ScUndoInsertCells::DoChange( const bool bUndo )
 else
 rDoc.InsertCol( aEffRange.aStart.Row(), pTabs[i], 
aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i],
 aEffRange.aStart.Col(), 
static_cast(aEffRange.aEnd.Col()-aEffRange.aStart.Col()+1));
+
+if (pViewShell)
+{
+const long nSign = bUndo ? -1 : 1;
+
pViewShell->OnLOKInsertDeleteColumn(aEffRange.aStart.Col(), nSign * 
(aEffRange.aEnd.Col()-aEffRange.aStart.Col()+1));
+}
 }
 break;
 default:
@@ -210,7 +224,7 @@ void ScUndoInsertCells::DoChange( const bool bUndo )
 // Undo for displaced attributes?
 
 PaintPartFlags nPaint = PaintPartFlags::Grid;
-ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+
 switch (eCmd)
 {
 case INS_INSROWS_BEFORE:
@@ -385,6 +399,8 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
 else
 SetChangeTrack();
 
+ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+
 switch (eCmd)
 {
 case DEL_DELROWS:
@@ -397,6 +413,12 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
 else
 rDoc.DeleteRow( aEffRange.aStart.Col(), pTabs[i], 
aEffRange.aEnd.Col(), pTabs[i]+pScenarios[i],
 aEffRange.aStart.Row(), 
static_cast(aEffRange.aEnd.Row()-aEffRange.aStart.Row()+1));
+
+if (pViewShell)
+{
+const long nSign = bUndo ? 1 : -1;
+pViewShell->OnLOKInsertDeleteRow(aEffRange.aStart.Row(), 
nSign * (aEffRange.aEnd.Row()-aEffRange.aStart.Row()+1));
+}
 }
 break;
 case DEL_DELCOLS:
@@ -409,6 +431,12 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
 else
 rDoc.DeleteCol( aEffRange.aStart.Row(), pTabs[i], 
aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i],
 aEffRange.aStart.Col(), 
static_cast(aEffRange.aEnd.Col()-aEffRange.aStart.Col()+1));
+
+if (pViewShell)
+{
+const long nSign = bUndo ? 1 : -1;
+
pViewShell->OnLOKInsertDeleteColumn(aEffRange.aStart.Col(), nSign * 
(aEffRange.aEnd.Col()-aEffRange.aStart.Col()+1));
+}
 }
 break;
 default:
@@ -507,6 +535,20 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
 
 pDocShell->PostDataChanged();
 //  CellContentChanged comes with the selection
+
+if (pViewShell)
+{
+if (comphelper::LibreOfficeKit::isActive())
+{
+if (eCmd == DEL_DELCOLS || eCmd == DEL_CELLSLEFT)
+ScTabViewShell::notifyAllViewsHeaderInvalidation("column",  
pViewShell->GetViewData().GetTabNo());
+
+if (eCmd == DEL_DELROWS || eCmd == DEL_CELLSUP)
+ScTabViewShell::notifyAllViewsHeaderInvalidation("row",  
pViewShell->GetViewData().GetTabNo());
+}
+
+}
+
 }
 
 void ScUndoDeleteCells::Undo()
diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx
ind

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

2017-05-16 Thread Marco Cecchetti
 sc/source/ui/inc/viewdata.hxx  |7 +
 sc/source/ui/inc/viewfunc.hxx  |5 
 sc/source/ui/view/viewdata.cxx |   50 +++
 sc/source/ui/view/viewfunc.cxx |  274 -
 4 files changed, 199 insertions(+), 137 deletions(-)

New commits:
commit 380737e363ea7608f1472305977ec5a16622a779
Author: Marco Cecchetti 
Date:   Wed May 3 22:37:02 2017 +0200

lok: sc: insert a row affects another view's selection on another tab

Problem:
- Open a spreadsheet with two views.
- With view A select a cell on 2nd sheet (H10 for example).
- With view B delete a row above H10.

=> View A's selection moves up. Similarly with insertion and with
   columns.

The new solution takes care of the current tab each view is
displaying.

Change-Id: I47272ec7ef68471b530868dab57fa92091277324
Reviewed-on: https://gerrit.libreoffice.org/37258
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 2271321f400d..6fc2d748a670 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -333,6 +333,8 @@ public:
 SCROW   GetPosY( ScVSplitPos eWhich ) const { return 
pThisTab->nPosY[eWhich]; }
 SCCOL   GetCurX() const { return 
pThisTab->nCurX; }
 SCROW   GetCurY() const { return 
pThisTab->nCurY; }
+SCCOL   GetCurXForTab( SCTAB nTabIndex ) const;
+SCROW   GetCurYForTab( SCTAB nTabIndex ) const;
 SCCOL   GetOldCurX() const;
 SCROW   GetOldCurY() const;
 SCCOL   GetLOKOldCurX() const   { return 
pThisTab->nLOKOldCurX; }
@@ -343,6 +345,9 @@ public:
 ScPositionHelper& GetLOKWidthHelper()   { return 
pThisTab->aWidthHelper; }
 ScPositionHelper& GetLOKHeightHelper()  { return 
pThisTab->aHeightHelper; }
 
+ScPositionHelper* GetLOKWidthHelper(SCTAB nTabIndex);
+ScPositionHelper* GetLOKHeightHelper(SCTAB nTabIndex);
+
 ScSplitMode GetHSplitMode() const   { return 
pThisTab->eHSplitMode; }
 ScSplitMode GetVSplitMode() const   { return 
pThisTab->eVSplitMode; }
 longGetHSplitPos() const{ return 
pThisTab->nHSplitPos; }
@@ -360,6 +365,8 @@ public:
 voidSetPosY( ScVSplitPos eWhich, SCROW nNewPosY );
 voidSetCurX( SCCOL nNewCurX )   { 
pThisTab->nCurX = nNewCurX; }
 voidSetCurY( SCROW nNewCurY )   { 
pThisTab->nCurY = nNewCurY; }
+voidSetCurXForTab( SCCOL nNewCurX, SCTAB nTabIndex );
+voidSetCurYForTab( SCCOL nNewCurY, SCTAB nTabIndex );
 voidSetOldCursor( SCCOL nNewX, SCROW nNewY );
 voidResetOldCursor();
 voidSetLOKOldCurX( SCCOL nCurX ){ 
pThisTab->nLOKOldCurX = nCurX; }
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 30f402625405..489c606d9bc5 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -320,6 +320,11 @@ public:
  std::vector >& aEdits,
  sal_uInt16 aColLength );
 voidUpdateSelectionArea( const ScMarkData& rSel, 
ScPatternAttr* pAttr = nullptr );
+
+voidOnLOKInsertDeleteColumn(SCCOL nStartCol, long nOffset);
+voidOnLOKInsertDeleteRow(SCROW nStartRow, long nOffset);
+voidOnLOKSetWidthOrHeight(SCCOLROW nStart, bool bWidth);
+
 // Internal helper functions
 protected:
 static void UpdateLineAttrs( ::editeng::SvxBorderLine&rLine,
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 309528e3619d..d90886368522 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1122,6 +1122,38 @@ void ScViewData::ResetOldCursor()
 pThisTab->mbOldCursorValid = false;
 }
 
+SCCOL ScViewData::GetCurXForTab( SCTAB nTabIndex ) const
+{
+if (!ValidTab(nTabIndex) || !(nTabIndex < 
static_cast(maTabData.size(
+return -1;
+
+return maTabData[nTabIndex]->nCurX;
+}
+
+SCROW ScViewData::GetCurYForTab( SCTAB nTabIndex ) const
+{
+if (!ValidTab(nTabIndex) || !(nTabIndex < 
static_cast(maTabData.size(
+return -1;
+
+return maTabData[nTabIndex]->nCurY;
+}
+
+void ScViewData::SetCurXForTab( SCCOL nNewCurX, SCTAB nTabIndex )
+{
+if (!ValidTab(nTabIndex) || !(nTabIndex < 
static_cast(maTabData.size(
+return;
+
+maTabData[nTabIndex]->nCurX = nNewCurX;
+}
+
+void ScViewData::SetCurYForTab( SCCOL nNewCurY, SCTAB nTabIndex )
+{
+if (!ValidTab(nTabIndex) || !(nTabIndex < 
static_cast(maTabData.size(
+   

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 2 commits - include/sfx2 sc/source sfx2/source

2017-05-16 Thread Marco Cecchetti
 include/sfx2/lokhelper.hxx |2 --
 sc/source/ui/inc/tabvwsh.hxx   |2 ++
 sc/source/ui/undo/undoblk.cxx  |   14 ++
 sc/source/ui/undo/undoblk2.cxx |   10 +-
 sc/source/ui/view/tabvwshc.cxx |   17 +
 sc/source/ui/view/viewfunc.cxx |   24 +++-
 sfx2/source/view/lokhelper.cxx |   11 ---
 7 files changed, 57 insertions(+), 23 deletions(-)

New commits:
commit e4168d69d7edfdf3d59a82de80f89d29aefae268
Author: Marco Cecchetti 
Date:   Wed May 3 17:22:27 2017 +0200

lok: sc: invalidate col/row header on undo row/col operations

Change-Id: Ifabce9941541a615840163168af6fedaf54575cd
Reviewed-on: https://gerrit.libreoffice.org/37256
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 6d0466dd1dd3..d79fd8335c0c 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -23,6 +23,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "undoblk.hxx"
 #include "undoutil.hxx"
@@ -257,7 +259,19 @@ void ScUndoInsertCells::DoChange( const bool bUndo )
 }
 pDocShell->PostDataChanged();
 if (pViewShell)
+{
 pViewShell->CellContentChanged();
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+if (eCmd == INS_INSCOLS_BEFORE || eCmd == INS_INSCOLS_AFTER || 
eCmd == INS_CELLSRIGHT)
+ScTabViewShell::notifyAllViewsHeaderInvalidation("column",  
pViewShell->GetViewData().GetTabNo());
+
+if (eCmd == INS_INSROWS_BEFORE || eCmd == INS_INSROWS_AFTER || 
eCmd == INS_CELLSDOWN)
+ScTabViewShell::notifyAllViewsHeaderInvalidation("row",  
pViewShell->GetViewData().GetTabNo());
+}
+
+}
 }
 
 void ScUndoInsertCells::Undo()
diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx
index 50404d5e09fc..cdf75b9f1882 100644
--- a/sc/source/ui/undo/undoblk2.cxx
+++ b/sc/source/ui/undo/undoblk2.cxx
@@ -30,6 +30,8 @@
 
 #include "undoolk.hxx"
 
+#include 
+#include 
 
 /** Change column widths or row heights */
 ScUndoWidthOrHeight::ScUndoWidthOrHeight( ScDocShell* pNewDocShell,
@@ -94,6 +96,7 @@ void ScUndoWidthOrHeight::Undo()
 if (pUndoTab)   // Outlines are 
included when saving ?
 rDoc.SetOutlineTable( nStartTab, pUndoTab );
 
+ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
 SCTAB nTabCount = rDoc.GetTableCount();
 ScMarkData::iterator itr = aMarkData.begin(), itrEnd = aMarkData.end();
 for (; itr != itrEnd && *itr < nTabCount; ++itr)
@@ -117,7 +120,6 @@ void ScUndoWidthOrHeight::Undo()
 
 DoSdrUndoAction( pDrawUndo, &rDoc );
 
-ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
 if (pViewShell)
 {
 pViewShell->UpdateScrollBars();
@@ -125,6 +127,12 @@ void ScUndoWidthOrHeight::Undo()
 SCTAB nCurrentTab = pViewShell->GetViewData().GetTabNo();
 if ( nCurrentTab < nStartTab || nCurrentTab > nEndTab )
 pViewShell->SetTabNo( nStartTab );
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+OString aPayload = bWidth ? "column" : "row";
+ScTabViewShell::notifyAllViewsHeaderInvalidation(aPayload, 
pViewShell->GetViewData().GetTabNo());
+}
 }
 
 EndUndo();
commit 8deb22a2cee0a931b98c359246535c9d52678f99
Author: Marco Cecchetti 
Date:   Tue May 2 10:20:11 2017 +0200

lok: sc: make row/col header updating, on row/col operations, tab-aware

Now, on inserting/removing or resizing a row/col, the row/col header
invalidation callback is notified to another view only if it is
displaying the same tab of the view where the row/col operation is
occurring.

Change-Id: Ic65fd82b2e3009420c7b481e7e8c1ff8bb11bcce

diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 4f7b45065fd5..f76977e6b25d 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -42,8 +42,6 @@ public:
 static void notifyOtherView(SfxViewShell* pThisView, SfxViewShell* 
pOtherView, int nType, const OString& rKey, const OString& rPayload);
 /// Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to 
setOptionalFeatures() if needed.
 static void notifyInvalidation(SfxViewShell* pThisView, const OString& 
rPayload);
-/// Emits a LOK_CALLBACK_INVALIDATE_HEADER for all views.
-static void notifyAllViewsHeaderInvalidation(const OString& rPayload);
 /// A special value to signify 'infinity'.
 /// This value is chosen such that sal_Int32 will not overflow when 
manipulated.
 static const long MaxTwips = 1e9;
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index eb759055817d..cf60eb656d46 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -396,6 +396,8 @@ public:
 void afterCallbackRegistered(

[Libreoffice-commits] core.git: translations

2017-05-16 Thread Christian Lohmaier
 translations |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8ce3c3b202d6393199f24e00ac1ece715a8bf150
Author: Christian Lohmaier 
Date:   Tue May 16 13:31:36 2017 +0200

Updated core
Project: translations  28d70b17f056afa54f3a68a0fe68f517f44f4d46

update translations for 5.4.0 beta1

and force-fix errors using pocheck and do some additional cleanup of
bogus strings

Change-Id: I03e13820a5d71ee70b4e8728475d8409cff9493a

diff --git a/translations b/translations
index 28e3b10171e1..28d70b17f056 16
--- a/translations
+++ b/translations
@@ -1 +1 @@
-Subproject commit 28e3b10171e11219fa6b94e31e93ead9a3a5634e
+Subproject commit 28d70b17f056afa54f3a68a0fe68f517f44f4d46
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: animations/source avmedia/source

2017-05-16 Thread Noel Grandin
 animations/source/animcore/animcore.cxx   |2 +-
 avmedia/source/framework/MediaControlBase.cxx |2 +-
 avmedia/source/framework/mediacontrol.cxx |6 +++---
 avmedia/source/framework/mediatoolbox.cxx |2 +-
 avmedia/source/framework/modeltools.cxx   |2 +-
 avmedia/source/gstreamer/gstplayer.cxx|2 +-
 avmedia/source/gstreamer/gstwindow.cxx|4 ++--
 7 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit a7e0a8901e5c16d1ee0637b23217cfd21dfbc89f
Author: Noel Grandin 
Date:   Tue May 16 10:30:29 2017 +0200

loplugin:comparisonwithconstant in avmedia

Change-Id: Iba0a1969648e95f6e0f6a947f067c5b8e4eb3406
Reviewed-on: https://gerrit.libreoffice.org/37667
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/animations/source/animcore/animcore.cxx 
b/animations/source/animcore/animcore.cxx
index ff30100ce0fe..2d75b522b2f3 100644
--- a/animations/source/animcore/animcore.cxx
+++ b/animations/source/animcore/animcore.cxx
@@ -1942,7 +1942,7 @@ void SAL_CALL AnimationNode::removeChangesListener( const 
Reference< XChangesLis
 // XUnoTunnel
 ::sal_Int64 SAL_CALL AnimationNode::getSomething( const Sequence< ::sal_Int8 
>& rId )
 {
-if( rId.getLength() == 16 && 0 == memcmp( 
getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) )
+if( rId.getLength() == 16 && memcmp( getUnoTunnelId().getConstArray(), 
rId.getConstArray(), 16 ) == 0 )
 {
 return sal::static_int_cast< sal_Int64 >(reinterpret_cast< sal_IntPtr 
>(this));
 
diff --git a/avmedia/source/framework/MediaControlBase.cxx 
b/avmedia/source/framework/MediaControlBase.cxx
index 6e879244cd07..b828efb990b6 100644
--- a/avmedia/source/framework/MediaControlBase.cxx
+++ b/avmedia/source/framework/MediaControlBase.cxx
@@ -153,7 +153,7 @@ void MediaControlBase::UpdateToolBoxes(MediaItem aMediaItem)
 {
 mpPlayToolBox->Enable();
 mpMuteToolBox->Enable();
-if( MediaState::Play == aMediaItem.getState() )
+if( aMediaItem.getState() == MediaState::Play )
 {
 mpPlayToolBox->CheckItem( AVMEDIA_TOOLBOXITEM_PLAY );
 mpPlayToolBox->CheckItem( AVMEDIA_TOOLBOXITEM_PAUSE, false );
diff --git a/avmedia/source/framework/mediacontrol.cxx 
b/avmedia/source/framework/mediacontrol.cxx
index 85d3f95dd97b..846bd1a52f68 100644
--- a/avmedia/source/framework/mediacontrol.cxx
+++ b/avmedia/source/framework/mediacontrol.cxx
@@ -106,7 +106,7 @@ MediaControl::MediaControl( vcl::Window* pParent, 
MediaControlStyle eControlStyl
 mpMediaPath->Show();
 maMinSize.Width() += mpMediaPath->GetSizePixel().Width();
 
-if( MEDIACONTROLSTYLE_MULTILINE == meControlStyle )
+if( meControlStyle == MEDIACONTROLSTYLE_MULTILINE )
 {
 maMinSize.Width() = 256;
 maMinSize.Height() = ( maMinSize.Height() << 1 ) + 
AVMEDIA_CONTROLOFFSET;
@@ -121,7 +121,7 @@ MediaControl::MediaControl( vcl::Window* pParent, 
MediaControlStyle eControlStyl
 
 void MediaControl::InitializeWidgets()
 {
-if( MEDIACONTROLSTYLE_SINGLELINE != meControlStyle )
+if( meControlStyle != MEDIACONTROLSTYLE_SINGLELINE )
 {
 mpPlayToolBox->InsertItem( AVMEDIA_TOOLBOXITEM_OPEN, 
GetImage(AVMEDIA_TOOLBOXITEM_OPEN), OUString( AVMEDIA_RESID( AVMEDIA_STR_OPEN ) 
) );
 mpPlayToolBox->SetHelpId( AVMEDIA_TOOLBOXITEM_OPEN, 
HID_AVMEDIA_TOOLBOXITEM_OPEN );
@@ -190,7 +190,7 @@ void MediaControl::Resize()
 const sal_Int32 nMediaPathWidth = mpMediaPath->GetSizePixel().Width();
 const sal_Int32 nTimeSliderHeight = mpTimeSlider->GetSizePixel().Height();
 
-if( MEDIACONTROLSTYLE_SINGLELINE == meControlStyle )
+if( meControlStyle == MEDIACONTROLSTYLE_SINGLELINE )
 {
 const sal_Int32 nTimeSliderWidth = GetSizePixel().Width() - ( 
AVMEDIA_CONTROLOFFSET * 4 ) -
nPlayToolBoxWidth - 
nMuteToolBoxWidth - nVolumeSliderWidth - nTimeEditWidth - nZoomToolBoxWidth - 
nMediaPathWidth;
diff --git a/avmedia/source/framework/mediatoolbox.cxx 
b/avmedia/source/framework/mediatoolbox.cxx
index 08d1f9fa7e43..b40c07fc3c89 100644
--- a/avmedia/source/framework/mediatoolbox.cxx
+++ b/avmedia/source/framework/mediatoolbox.cxx
@@ -103,7 +103,7 @@ void MediaToolBoxControl::StateChanged( sal_uInt16, 
SfxItemState eState, const S
 
 const MediaItem* pMediaItem = dynamic_cast( pState  
);
 
-if( pMediaItem && ( SfxItemState::DEFAULT == eState ) )
+if( pMediaItem && ( eState == SfxItemState::DEFAULT ) )
 pCtrl->setState( *pMediaItem );
 }
 }
diff --git a/avmedia/source/framework/modeltools.cxx 
b/avmedia/source/framework/modeltools.cxx
index ab78d0d0b544..03d4647849de 100644
--- a/avmedia/source/framework/modeltools.cxx
+++ b/avmedia/source/framework/modeltools.cxx
@@ -143,7 +143,7 @@ static void lcl_EmbedExternals(const OUString& rSourceURL, 
const uno::Reference<
 OUString sTempFileURL;
 const ::osl::FileBase::RC  aErr =
 

[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - include/o3tl vcl/headless vcl/source vcl/unx

2017-05-16 Thread Caolán McNamara
 include/o3tl/safeint.hxx   |   89 +
 vcl/headless/svpbmp.cxx|   18 +++-
 vcl/source/gdi/salmisc.cxx |   19 
 vcl/unx/generic/gdi/salbmp.cxx |   17 +++
 4 files changed, 139 insertions(+), 4 deletions(-)

New commits:
commit d881d77429371c3a04b758b151b091267c13d167
Author: Caolán McNamara 
Date:   Mon May 15 11:17:57 2017 +0100

ofz#1605 check multiply and shift

Change-Id: I6aad9ad23e7bf080b3b610223f92df7074530beb
Reviewed-on: https://gerrit.libreoffice.org/37642
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/include/o3tl/safeint.hxx b/include/o3tl/safeint.hxx
new file mode 100644
index ..ce144d22d9ea
--- /dev/null
+++ b/include/o3tl/safeint.hxx
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_O3TL_SAFEINT_HXX
+#define INCLUDED_O3TL_SAFEINT_HXX
+
+#include 
+#if defined(_MSC_VER)
+#include 
+#else
+#ifndef __has_builtin
+#   define __has_builtin(x) 0
+#endif
+#endif
+
+namespace o3tl
+{
+
+#if defined(_MSC_VER)
+
+template inline bool checked_multiply(T a, T b, T& result)
+{
+return !msl::utilities::SafeMultiply(a, b, result);
+}
+
+#elif (defined __GNUC__ && __GNUC__ >= 5) || 
(__has_builtin(__builtin_mul_overflow))
+
+template inline bool checked_multiply(T a, T b, T& result)
+{
+return __builtin_mul_overflow(a, b, &result);
+}
+
+#else
+
+//https://www.securecoding.cert.org/confluence/display/c/INT32-C.+Ensure+that+operations+on+signed+integers+do+not+result+in+overflow
+template inline typename std::enable_if::value, 
bool>::type checked_multiply(T a, T b, T& result)
+{
+  if (a > 0) {  /* a is positive */
+if (b > 0) {  /* a and b are positive */
+  if (a > (std::numeric_limits::max() / b)) {
+return true; /* Handle error */
+  }
+} else { /* a positive, b nonpositive */
+  if (b < (std::numeric_limits::min() / a)) {
+return true; /* Handle error */
+  }
+} /* a positive, b nonpositive */
+  } else { /* a is nonpositive */
+if (b > 0) { /* a is nonpositive, b is positive */
+  if (a < (std::numeric_limits::min() / b)) {
+return true; /* Handle error */
+  }
+} else { /* a and b are nonpositive */
+  if ( (a != 0) && (b < (std::numeric_limits::max() / a))) {
+return true; /* Handle error */
+  }
+} /* End if a and b are nonpositive */
+  } /* End if a is nonpositive */
+
+  result = a * b;
+
+  return false;
+}
+
+//https://www.securecoding.cert.org/confluence/display/c/INT30-C.+Ensure+that+unsigned+integer+operations+do+not+wrap
+template inline typename 
std::enable_if::value, bool>::type checked_multiply(T a, T 
b, T& result)
+{
+if (b && a > std::numeric_limits::max() / b) {
+return true;/* Handle error */
+}
+
+result = a * b;
+
+return false;
+}
+
+#endif
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx
index 202d63c0a84e..71c5e52586c6 100644
--- a/vcl/headless/svpbmp.cxx
+++ b/vcl/headless/svpbmp.cxx
@@ -27,7 +27,7 @@
 
 #include 
 #include 
-
+#include 
 #include 
 #include 
 
@@ -110,7 +110,21 @@ BitmapBuffer* ImplCreateDIB(
 pDIB->mnFormat |= ScanlineFormat::TopDown;
 pDIB->mnWidth = rSize.Width();
 pDIB->mnHeight = rSize.Height();
-pDIB->mnScanlineSize = AlignedWidth4Bytes( pDIB->mnWidth * 
nBitCount );
+long nScanlineBase;
+bool bFail = o3tl::checked_multiply(pDIB->mnWidth, 
nBitCount, nScanlineBase);
+if (bFail)
+{
+SAL_WARN("vcl.gdi", "checked multiply failed");
+delete pDIB;
+return nullptr;
+}
+pDIB->mnScanlineSize = AlignedWidth4Bytes(nScanlineBase);
+if (pDIB->mnScanlineSize < nScanlineBase/8)
+{
+SAL_WARN("vcl.gdi", "scanline calculation wraparound");
+delete pDIB;
+return nullptr;
+}
 pDIB->mnBitCount = nBitCount;
 
 if( nColors )
diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx
index 84c7becceea4..0218c320e92b 100644
--- a/vcl/source/gdi/salmisc.cxx
+++ b/vcl/source/gdi/salmisc.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -330,7 +331,23 @@ BitmapBuffer* StretchAndConvert(
 pDstBuffer->mnFormat = nDstBitmapFormat;
 pDstBuffer->mnWidth = rTwoRect.mnDestWidth;
 pDstBuffer->mnHeight = rTwoRect.mnDestHeight;
-pDstBuffer->mnScanlineSize = AlignedWidth4Bytes( pDstBuffer->mnBitCount *

[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - filter/source

2017-05-16 Thread Caolán McNamara
 filter/source/graphicfilter/ieps/ieps.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9304956306025194a671a90d4559746660a27010
Author: Caolán McNamara 
Date:   Mon May 15 11:29:11 2017 +0100

ofz#1542 check remaining size of dest

Change-Id: I37cff45afdb242b31919a8a02e737424e2ecfd52
Reviewed-on: https://gerrit.libreoffice.org/37634
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/filter/source/graphicfilter/ieps/ieps.cxx 
b/filter/source/graphicfilter/ieps/ieps.cxx
index 1ec3257eb5aa..fecad6b73d75 100644
--- a/filter/source/graphicfilter/ieps/ieps.cxx
+++ b/filter/source/graphicfilter/ieps/ieps.cxx
@@ -643,7 +643,7 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, 
FilterConfigItem* )
 long nHeight = ImplGetNumber(pDest, nSecurityCount);
 long nBitDepth = ImplGetNumber(pDest, nSecurityCount);
 long nScanLines = ImplGetNumber(pDest, nSecurityCount);
-pDest = ImplSearchEntry( pDest, reinterpret_cast("%"), 16, 1 );   // go to the first Scanline
+pDest = nSecurityCount ? ImplSearchEntry(pDest, 
reinterpret_cast("%"), 16, 1) : nullptr;   // go to the 
first Scanline
 if ( nSecurityCount && pDest && nWidth && nHeight && ( ( 
nBitDepth == 1 ) || ( nBitDepth == 8 ) ) && nScanLines )
 {
 rStream.Seek( nBufStartPos + ( pDest - pBuf.get() ) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 2 commits - desktop/qa desktop/source include/vcl sc/inc sc/qa sc/source

2017-05-16 Thread Marco Cecchetti
 desktop/qa/desktop_lib/test_desktop_lib.cxx  |4 -
 desktop/source/lib/init.cxx  |   16 +++
 include/vcl/ITiledRenderable.hxx |7 +++
 sc/inc/docuno.hxx|3 +
 sc/inc/postit.hxx|   15 ---
 sc/qa/unit/tiledrendering/tiledrendering.cxx |   20 +
 sc/source/core/data/postit.cxx   |   21 ++
 sc/source/ui/docshell/docfunc.cxx|4 +
 sc/source/ui/docshell/docsh4.cxx |6 +-
 sc/source/ui/unoobj/docuno.cxx   |   55 +--
 sc/source/ui/view/cellsh1.cxx|   45 ++
 sc/source/ui/view/tabview3.cxx   |2 
 12 files changed, 152 insertions(+), 46 deletions(-)

New commits:
commit 7e38c6279a4f89521d0bb5b5f7fe19780bfb9418
Author: Marco Cecchetti 
Date:   Tue May 2 18:10:41 2017 +0200

lok: sc: fix for row/col header updating on changing tab

When you switch tab the current row/col header needs to be
invalidated.

Change-Id: I26ef6f9990726f3c96ddfc9ac45472fafc8e8507

diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index d6c3546ded43..01c6774970c6 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -1998,6 +1998,8 @@ void ScTabView::OnLibreOfficeKitTabChanged()
 };
 
 SfxLokHelper::forEachOtherView(pThisViewShell, lTabSwitch);
+
+
pThisViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_HEADER, 
"all");
 }
 }
 
commit 4cad57c8e1f24eacd7e94dc60475b8a0b4e3a89d
Author: Marco Cecchetti 
Date:   Tue Apr 25 19:25:11 2017 +0200

lok: sc: misplaced comment mark on inserting/deleting/resizing row/col

A unique id has been introduced, in a similar way of what occurs in
Writer.

Change-Id: I7b2ef694867fb4184c4cfc616fe1c8f12da3b676

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 2dfb036e6be7..dae50d66314c 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -1979,14 +1979,14 @@ void DesktopLOKTest::testCommentsCalc()
 {
 case 0:
 {
-CPPUNIT_ASSERT_EQUAL(std::string("Sheet5.G15"), 
rComment.second.get("id"));
+CPPUNIT_ASSERT_EQUAL(std::string("4"), 
rComment.second.get("tab"));
 CPPUNIT_ASSERT_EQUAL(std::string("Comment1"), 
rComment.second.get("text"));
 CPPUNIT_ASSERT_EQUAL(std::string("7650, 3570, 1274, 254"), 
rComment.second.get("cellPos"));
 }
 break;
 case 1:
 {
-CPPUNIT_ASSERT_EQUAL(std::string("Sheet5.H18"), 
rComment.second.get("id"));
+CPPUNIT_ASSERT_EQUAL(std::string("4"), 
rComment.second.get("tab"));
 CPPUNIT_ASSERT_EQUAL(std::string("Comment2"), 
rComment.second.get("text"));
 CPPUNIT_ASSERT_EQUAL(std::string("8925, 4335, 1274, 254"), 
rComment.second.get("cellPos"));
 }
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 58d47e5c590e..35908f96dff3 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2053,6 +2053,18 @@ static char* getPostIts(LibreOfficeKitDocument* pThis)
 return strdup(aComments.toUtf8().getStr());
 }
 
+/// Returns the JSON representation of the positions of all the comments in 
the document
+static char* getPostItsPos(LibreOfficeKitDocument* pThis)
+{
+ITiledRenderable* pDoc = getTiledRenderable(pThis);
+if (!pDoc)
+{
+gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
+return nullptr;
+}
+OUString aComments = pDoc->getPostItsPos();
+return strdup(aComments.toUtf8().getStr());
+}
 
 static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int 
nCharCode, int nKeyCode)
 {
@@ -2657,6 +2669,10 @@ static char* 
doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
 {
 return getPostIts(pThis);
 }
+else if (aCommand == ".uno:ViewAnnotationsPosition")
+{
+return getPostItsPos(pThis);
+}
 else if (aCommand.startsWith(aViewRowColumnHeaders))
 {
 ITiledRenderable* pDoc = getTiledRenderable(pThis);
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index abe4979058c8..e330cd14f074 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -226,6 +226,13 @@ public:
 {
 return OUString();
 }
+
+/// Implementation for
+/// lok::Document::getCommandValues(".uno:ViewAnnotationsPosition");
+virtual OUString getPostItsPos()
+{
+return OUString();
+}
 };
 
 } // namespace vcl
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index 9dac6c43ae55..917b211a82a1 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/doc

[Libreoffice-commits] online.git: loleaflet/src

2017-05-16 Thread Marco Cecchetti
 loleaflet/src/control/Parts.js|3 ---
 loleaflet/src/layer/marker/DivOverlay.js  |2 +-
 loleaflet/src/layer/tile/CalcTileLayer.js |3 +++
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit ef5376197e2893c68cc381ecf997dd2b8d7dbf82
Author: Marco Cecchetti 
Date:   Tue May 2 10:51:16 2017 +0200

Loleaflet: Fix for row/col headers and annotation marks on tab switching

Change-Id: Id0f52603af7eaa49979f68d222c9c94e79cf65b1
Reviewed-on: https://gerrit.libreoffice.org/37251
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Parts.js b/loleaflet/src/control/Parts.js
index 84e92f31..1071db03 100644
--- a/loleaflet/src/control/Parts.js
+++ b/loleaflet/src/control/Parts.js
@@ -51,9 +51,6 @@ L.Map.include({
if (!this._searchRequested) {
this.focus();
}
-   if (docLayer._docType === 'spreadsheet') {
-   this.fire('updaterowcolumnheaders', {x: 
this._getTopLeftPoint().x, y: this._getTopLeftPoint(), offset: {x: undefined, 
y: undefined}});
-   }
},
 
getPreview: function (id, index, maxWidth, maxHeight, options) {
diff --git a/loleaflet/src/layer/marker/DivOverlay.js 
b/loleaflet/src/layer/marker/DivOverlay.js
index a562d728..9ab6d4f8 100644
--- a/loleaflet/src/layer/marker/DivOverlay.js
+++ b/loleaflet/src/layer/marker/DivOverlay.js
@@ -28,7 +28,7 @@ L.DivOverlay = L.Layer.extend({
},
 
update: function () {
-   if (this._container) {
+   if (this._container && this._map) {
var topLeft = 
this._map.latLngToLayerPoint(this._latLngBounds.getNorthWest());
var size = 
this._map.latLngToLayerPoint(this._latLngBounds.getSouthEast()).subtract(topLeft);
L.DomUtil.setPosition(this._container, topLeft);
diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index cb82396d..f0a39644 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -210,6 +210,9 @@ L.CalcTileLayer = L.TileLayer.extend({
} else if (textMsg.startsWith('invalidateheader: row')) {
this._map.fire('updaterowcolumnheaders', {x: 0, y: 
this._map._getTopLeftPoint().y, offset: {x: 0, y: undefined}});
this._map._socket.sendMessage('commandvalues 
command=.uno:ViewAnnotationsPosition');
+   } else if (textMsg.startsWith('invalidateheader: all')) {
+   this._map.fire('updaterowcolumnheaders', {x: 
this._map._getTopLeftPoint().x, y: this._map._getTopLeftPoint(), offset: {x: 
undefined, y: undefined}});
+   this._map._socket.sendMessage('commandvalues 
command=.uno:ViewAnnotationsPosition');
} else {
L.TileLayer.prototype._onMessage.call(this, textMsg, 
img);
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2017-05-16 Thread Marco Cecchetti
 loleaflet/src/layer/tile/CalcTileLayer.js |   36 ++
 1 file changed, 27 insertions(+), 9 deletions(-)

New commits:
commit 647556b442f037ca71b4cc4efd871c559b748a53
Author: Marco Cecchetti 
Date:   Tue Apr 25 18:57:30 2017 +0200

loleaflet: misplaced comment mark on inserting/deleting/resizing row/col

Change-Id: Ib95870905d1bfc613ba454c7126501b3533e4ba5
Reviewed-on: https://gerrit.libreoffice.org/36982
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js 
b/loleaflet/src/layer/tile/CalcTileLayer.js
index c154d7a4..cb82396d 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -13,7 +13,7 @@ L.CalcTileLayer = L.TileLayer.extend({
},
 
newAnnotation: function (comment) {
-   var annotations = 
this._annotations[this._partNames[this._selectedPart]];
+   var annotations = this._annotations[this._selectedPart];
var annotation;
for (var key in annotations) {
if 
(this._cellCursor.contains(annotations[key]._annotation._data.cellPos)) {
@@ -72,7 +72,7 @@ L.CalcTileLayer = L.TileLayer.extend({
value: id
}
};
-   var tab = id.substring(0, id.indexOf('.'));
+   var tab = this._selectedPart;
this._map.sendUnoCommand('.uno:DeleteNote', comment);
this._annotations[tab][id].closePopup();
this._map.focus();
@@ -92,14 +92,15 @@ L.CalcTileLayer = L.TileLayer.extend({
},
 
showAnnotations: function () {
-   var annotations = 
this._annotations[this._partNames[this._selectedPart]];
+   var annotations = this._annotations[this._selectedPart];
for (var key in annotations) {
this.showAnnotation(annotations[key]);
}
},
 
hideAnnotations: function (part) {
-   var annotations = this._annotations[this._partNames[part]];
+
+   var annotations = this._annotations[part];
for (var key in annotations) {
this.hideAnnotation(annotations[key]);
}
@@ -175,7 +176,7 @@ L.CalcTileLayer = L.TileLayer.extend({
_onMessage: function (textMsg, img) {
if (textMsg.startsWith('comment:')) {
var obj = 
JSON.parse(textMsg.substring('comment:'.length + 1));
-   obj.comment.tab = obj.comment.id.substring(0, 
obj.comment.id.indexOf('.'));
+   obj.comment.tab = parseInt(obj.comment.tab);
if (obj.comment.action === 'Add') {
obj.comment.cellPos = 
L.LOUtil.stringToBounds(obj.comment.cellPos);
obj.comment.cellPos = 
L.latLngBounds(this._twipsToLatLng(obj.comment.cellPos.getBottomLeft()),
@@ -184,7 +185,7 @@ L.CalcTileLayer = L.TileLayer.extend({
this._annotations[obj.comment.tab] = {};
}

this._annotations[obj.comment.tab][obj.comment.id] = 
this.createAnnotation(obj.comment);
-   if (obj.comment.tab === 
this._partNames[this._selectedPart]) {
+   if (obj.comment.tab === this._selectedPart) {

this.showAnnotation(this._annotations[obj.comment.tab][obj.comment.id]);
}
} else if (obj.comment.action === 'Remove') {
@@ -205,8 +206,10 @@ L.CalcTileLayer = L.TileLayer.extend({
}
} else if (textMsg.startsWith('invalidateheader: column')) {
this._map.fire('updaterowcolumnheaders', {x: 
this._map._getTopLeftPoint().x, y: 0, offset: {x: undefined, y: 0}});
+   this._map._socket.sendMessage('commandvalues 
command=.uno:ViewAnnotationsPosition');
} else if (textMsg.startsWith('invalidateheader: row')) {
this._map.fire('updaterowcolumnheaders', {x: 0, y: 
this._map._getTopLeftPoint().y, offset: {x: 0, y: undefined}});
+   this._map._socket.sendMessage('commandvalues 
command=.uno:ViewAnnotationsPosition');
} else {
L.TileLayer.prototype._onMessage.call(this, textMsg, 
img);
}
@@ -436,7 +439,7 @@ L.CalcTileLayer = L.TileLayer.extend({
this.clearAnnotations();
for (var index in values.comments) {
comment = values.comments[index];
-   comment.tab = comment.id.substring(0, 
comment.id.indexOf('.'));
+   comment.tab = parseInt(comment.tab);

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

2017-05-16 Thread Marco Cecchetti
 sc/source/ui/view/tabview3.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 1e48666b6c007fdf8f354a1a50e51f8f1e906b87
Author: Marco Cecchetti 
Date:   Tue May 2 18:10:41 2017 +0200

lok: sc: fix for row/col header updating on changing tab

When you switch tab the current row/col header needs to be
invalidated.

Change-Id: I26ef6f9990726f3c96ddfc9ac45472fafc8e8507
Reviewed-on: https://gerrit.libreoffice.org/37242
Tested-by: Jenkins 
Reviewed-by: Jan Holesovsky 

diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index f789a34021e5..75da8d86159e 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -2004,6 +2004,8 @@ void ScTabView::OnLibreOfficeKitTabChanged()
 };
 
 SfxLokHelper::forEachOtherView(pThisViewShell, lTabSwitch);
+
+
pThisViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_HEADER, 
"all");
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/qa desktop/source include/vcl sc/inc sc/qa sc/source

2017-05-16 Thread Marco Cecchetti
 desktop/qa/desktop_lib/test_desktop_lib.cxx  |4 -
 desktop/source/lib/init.cxx  |   16 +++
 include/vcl/ITiledRenderable.hxx |7 +++
 sc/inc/docuno.hxx|3 +
 sc/inc/postit.hxx|   15 ---
 sc/qa/unit/tiledrendering/tiledrendering.cxx |   20 +
 sc/source/core/data/postit.cxx   |   21 ++
 sc/source/ui/docshell/docfunc.cxx|4 +
 sc/source/ui/docshell/docsh4.cxx |6 +-
 sc/source/ui/unoobj/docuno.cxx   |   55 +--
 sc/source/ui/view/cellsh1.cxx|   45 ++
 11 files changed, 150 insertions(+), 46 deletions(-)

New commits:
commit cb33a0fb8b7d9fcdf7ef26ac690842574d359f4b
Author: Marco Cecchetti 
Date:   Tue Apr 25 19:25:11 2017 +0200

lok: sc: misplaced comment mark on inserting/deleting/resizing row/col

A unique id has been introduced, in a similar way of what occurs in
Writer.

Change-Id: I7b2ef694867fb4184c4cfc616fe1c8f12da3b676
Reviewed-on: https://gerrit.libreoffice.org/36962
Tested-by: Jenkins 
Reviewed-by: Jan Holesovsky 

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 8d85a078efc0..79ec0ba54e3b 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -1933,14 +1933,14 @@ void DesktopLOKTest::testCommentsCalc()
 {
 case 0:
 {
-CPPUNIT_ASSERT_EQUAL(std::string("Sheet5.G15"), 
rComment.second.get("id"));
+CPPUNIT_ASSERT_EQUAL(std::string("4"), 
rComment.second.get("tab"));
 CPPUNIT_ASSERT_EQUAL(std::string("Comment1"), 
rComment.second.get("text"));
 CPPUNIT_ASSERT_EQUAL(std::string("7650, 3570, 1274, 254"), 
rComment.second.get("cellPos"));
 }
 break;
 case 1:
 {
-CPPUNIT_ASSERT_EQUAL(std::string("Sheet5.H18"), 
rComment.second.get("id"));
+CPPUNIT_ASSERT_EQUAL(std::string("4"), 
rComment.second.get("tab"));
 CPPUNIT_ASSERT_EQUAL(std::string("Comment2"), 
rComment.second.get("text"));
 CPPUNIT_ASSERT_EQUAL(std::string("8925, 4335, 1274, 254"), 
rComment.second.get("cellPos"));
 }
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index b090ae4e377c..ebfe46a7efe3 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2049,6 +2049,18 @@ static char* getPostIts(LibreOfficeKitDocument* pThis)
 return strdup(aComments.toUtf8().getStr());
 }
 
+/// Returns the JSON representation of the positions of all the comments in 
the document
+static char* getPostItsPos(LibreOfficeKitDocument* pThis)
+{
+ITiledRenderable* pDoc = getTiledRenderable(pThis);
+if (!pDoc)
+{
+gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
+return nullptr;
+}
+OUString aComments = pDoc->getPostItsPos();
+return strdup(aComments.toUtf8().getStr());
+}
 
 static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int 
nCharCode, int nKeyCode)
 {
@@ -2653,6 +2665,10 @@ static char* 
doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
 {
 return getPostIts(pThis);
 }
+else if (aCommand == ".uno:ViewAnnotationsPosition")
+{
+return getPostItsPos(pThis);
+}
 else if (aCommand.startsWith(aViewRowColumnHeaders))
 {
 ITiledRenderable* pDoc = getTiledRenderable(pThis);
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index 9645d2392743..5c5d8339b8a1 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -226,6 +226,13 @@ public:
 {
 return OUString();
 }
+
+/// Implementation for
+/// lok::Document::getCommandValues(".uno:ViewAnnotationsPosition");
+virtual OUString getPostItsPos()
+{
+return OUString();
+}
 };
 
 } // namespace vcl
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index 55f6afb99858..00ff88999bd0 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -359,6 +359,9 @@ public:
 
 /// @see vcl::ITiledRenderable::getPostIts().
 OUString getPostIts() override;
+
+/// @see vcl::ITiledRenderable::getPostItsPos().
+OUString getPostItsPos() override;
 };
 
 class ScDrawPagesObj : public cppu::WeakImplHelper<
diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx
index d9584e1e7005..ba7d2705fb04 100644
--- a/sc/inc/postit.hxx
+++ b/sc/inc/postit.hxx
@@ -160,13 +160,14 @@ struct SC_DLLPUBLIC ScNoteData
 class SC_DLLPUBLIC ScPostIt
 {
 public:
+static sal_uInt32 mnLastPostItId;
 
 /** Creates an empty note and its caption object and places it according to
 the passed cell position. */
-explicitScPostIt( ScDocument& 

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

2017-05-16 Thread Michael Stahl
 sw/source/core/layout/tabfrm.cxx  |   16 
 sw/source/core/txtnode/thints.cxx |4 
 2 files changed, 20 insertions(+)

New commits:
commit 23c333b10c270397dd7ff4bb36c94d6076dec003
Author: Michael Stahl 
Date:   Fri May 12 18:34:17 2017 +0200

sw: table-in-footnote: delete SwFootnoteFrame if it becomes empty

Crashed in a11y code with a SwFootnoteFrame that survived a JoinNode and
subsequent deletion of its reference-containing SwTextFrame and thus had
a stale "pRef" member; presumably the SwTableFrame needs to delete an
empty footnote frame like the SwTextFrame does from SwContentFrame::Cut(),
called from DelFrames(), called from CutImpl().

Change-Id: I5a30357ecd3bf474bfc4a5451de89beb245fb0ae
(cherry picked from commit c9fb347642729017ad0c613fe26310befd021db8)
Reviewed-on: https://gerrit.libreoffice.org/37562
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index b2e56e8bbbc6..d08468aaa1e1 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -3463,6 +3463,22 @@ void SwTabFrame::Cut()
 pSct->InvalidateSize_();
 }
 }
+// table-in-footnote: delete empty footnote frames (like 
SwContentFrame::Cut)
+else if (!pUp->Lower() && pUp->IsFootnoteFrame() && 
!pUp->IsColLocked())
+{
+if (pUp->GetNext() && !pUp->GetPrev())
+{
+if (SwFrame *const pTmp = 
static_cast(pUp->GetNext())->ContainsAny())
+{
+pTmp->InvalidatePrt_();
+}
+}
+if (!pUp->IsDeleteForbidden())
+{
+pUp->Cut();
+SwFrame::DestroyFrame(pUp);
+}
+}
 else if( (Frame().*aRectFnSet->fnGetHeight)() )
 {
 // OD 26.08.2003 #i18103# - *no* 'ColUnlock' of section -
diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index 0e6f73fd5939..eb2180702b1e 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1400,6 +1400,10 @@ bool SwTextNode::InsertHint( SwTextAttr * const pAttr, 
const SetAttrMode nMode )
 SwContentNode* pCNd = rNodes[ nSttIdx 
]->GetContentNode();
 if( nullptr != pCNd )
 pCNd->DelFrames();
+else if (SwTableNode *const pTable = 
rNodes[nSttIdx]->GetTableNode())
+{
+pTable->DelFrames();
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-05-16 Thread Noel Grandin
 basctl/source/basicide/baside2.cxx  |2 +-
 basctl/source/basicide/baside3.cxx  |   12 ++--
 basctl/source/basicide/basides1.cxx |2 +-
 basctl/source/dlged/managelang.cxx  |2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 658eec1d5b96ea0a971fbdf531979480f72516a4
Author: Noel Grandin 
Date:   Tue May 16 10:42:03 2017 +0200

loplugin:comparisonwithconstant in basctl

Change-Id: I0ac895e279e4feb47345e73ecef0d5ee1909c031
Reviewed-on: https://gerrit.libreoffice.org/37668
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/basctl/source/basicide/baside2.cxx 
b/basctl/source/basicide/baside2.cxx
index 9692a5e9660d..7a03c14aa61a 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -1035,7 +1035,7 @@ void ModulWindow::ExecuteGlobal (SfxRequest& rReq)
 void ModulWindow::GetState( SfxItemSet &rSet )
 {
 SfxWhichIter aIter(rSet);
-for ( sal_uInt16 nWh = aIter.FirstWhich(); 0 != nWh; nWh = 
aIter.NextWhich() )
+for ( sal_uInt16 nWh = aIter.FirstWhich(); nWh != 0; nWh = 
aIter.NextWhich() )
 {
 switch ( nWh )
 {
diff --git a/basctl/source/basicide/baside3.cxx 
b/basctl/source/basicide/baside3.cxx
index 550bcd3637e9..fa499ae2dcc9 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -253,7 +253,7 @@ void DialogWindow::GetState( SfxItemSet& rSet )
 }
 }
 
-for ( sal_uInt16 nWh = aIter.FirstWhich(); 0 != nWh; nWh = 
aIter.NextWhich() )
+for ( sal_uInt16 nWh = aIter.FirstWhich(); nWh != 0; nWh = 
aIter.NextWhich() )
 {
 switch ( nWh )
 {
@@ -913,19 +913,19 @@ bool implImportDialog( vcl::Window* pWin, const OUString& 
rCurPath, const Script
 
 ScopedVclPtrInstance< NameClashQueryBox > aQueryBox( pWin, 
aQueryBoxTitle, aQueryBoxText );
 sal_uInt16 nRet = aQueryBox->Execute();
-if( RET_YES == nRet )
+if( nRet == RET_YES )
 {
 // RET_YES == Rename, see 
NameClashQueryBox::NameClashQueryBox
 eNameClashMode = CLASH_RENAME_DIALOG;
 
 aNewDlgName = rDocument.createObjectName( E_DIALOGS, 
aLibName );
 }
-else if( RET_NO == nRet )
+else if( nRet == RET_NO )
 {
 // RET_NO == Replace, see 
NameClashQueryBox::NameClashQueryBox
 eNameClashMode = CLASH_OVERWRITE_DIALOG;
 }
-else if( RET_CANCEL == nRet )
+else if( nRet == RET_CANCEL )
 {
 return bDone;
 }
@@ -975,7 +975,7 @@ bool implImportDialog( vcl::Window* pWin, const OUString& 
rCurPath, const Script
 OUString 
aQueryBoxText(IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_TEXT));
 ScopedVclPtrInstance< LanguageMismatchQueryBox > aQueryBox( 
pWin, aQueryBoxTitle, aQueryBoxText );
 sal_uInt16 nRet = aQueryBox->Execute();
-if( RET_YES == nRet )
+if( nRet == RET_YES )
 {
 // RET_YES == Add, see 
LanguageMismatchQueryBox::LanguageMismatchQueryBox
 bAddDialogLanguagesToLib = true;
@@ -985,7 +985,7 @@ bool implImportDialog( vcl::Window* pWin, const OUString& 
rCurPath, const Script
 //else if( RET_NO == nRet )
 //{
 //}
-else if( RET_CANCEL == nRet )
+else if( nRet == RET_CANCEL )
 {
 return bDone;
 }
diff --git a/basctl/source/basicide/basides1.cxx 
b/basctl/source/basicide/basides1.cxx
index e6811d28d86e..a6f59641b13e 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -695,7 +695,7 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
 void Shell::GetState(SfxItemSet &rSet)
 {
 SfxWhichIter aIter(rSet);
-for ( sal_uInt16 nWh = aIter.FirstWhich(); 0 != nWh; nWh = 
aIter.NextWhich() )
+for ( sal_uInt16 nWh = aIter.FirstWhich(); nWh != 0; nWh = 
aIter.NextWhich() )
 {
 switch ( nWh )
 {
diff --git a/basctl/source/dlged/managelang.cxx 
b/basctl/source/dlged/managelang.cxx
index 4b979921dbf5..a396f0fe0842 100644
--- a/basctl/source/dlged/managelang.cxx
+++ b/basctl/source/dlged/managelang.cxx
@@ -147,7 +147,7 @@ void ManageLanguageDialog::ClearLanguageBox()
 IMPL_LINK_NOARG(ManageLanguageDialog, AddHdl, Button*, void)
 {
 ScopedVclPtrInstance< SetDefaultLanguageDialog > aDlg( this, 
m_xLocalizationMgr );
-if ( RET_OK == aDlg->Execute() )
+if ( aDlg->Execute() == RET_OK )
 {
 // add new locales
 Sequence< Locale > aLocaleSeq = aDlg->GetLocales();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.fr

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

2017-05-16 Thread Michael Stahl
 sw/source/core/layout/findfrm.cxx |2 +-
 sw/source/core/layout/flowfrm.cxx |2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit c4b55ea03da881590e5fac1ffc97177e4ce16b0b
Author: Michael Stahl 
Date:   Fri May 12 17:08:01 2017 +0200

tdf#107568 sw: prevent moving/splitting of tables in footnotes

The problem here is that for a table in a footnote on page 42,
SwTabFrm::MakeAll() calls Split(), which first creates a
follow-table-frame and then reformats the last row of the table;
somehow the SwTextFrame id="4636" in that row doesn't fit and wants
to split and then move to the following page with that page's footnote
container as its parent.

So this doesn't work currently.

commit 971adcd9e19e0bcab5855aae9be58d2203b46169 tried to prevent just
the moving forward of the table itself, but the table can still be split;
if IsMoveable() returns false then that also prevents splitting the table.

Change-Id: I1977c65f97cb0f66dbe5b89d7ef7e2cd05125331
(cherry picked from commit f6785b99a3f7e7531c8ef7ed16402cc4e02c9750)
Reviewed-on: https://gerrit.libreoffice.org/37561
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/core/layout/findfrm.cxx 
b/sw/source/core/layout/findfrm.cxx
index 89cf31663e2c..9caa4894e1f9 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -1330,7 +1330,7 @@ bool SwFrame::IsMoveable( const SwLayoutFrame* 
_pLayoutFrame ) const
 }
 }
 }
-else
+else if (!(_pLayoutFrame->IsInFootnote() && (IsTabFrame() || 
IsInTab(
 {
 bRetVal = true;
 }
diff --git a/sw/source/core/layout/flowfrm.cxx 
b/sw/source/core/layout/flowfrm.cxx
index 7ab8e85c7119..c2ccaddaf66c 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -1805,6 +1805,8 @@ bool SwFlowFrame::MoveFwd( bool bMakePage, bool 
bPageBreak, bool bMoveAlways )
 return false;
 if (m_rThis.IsInFootnote())
 {
+assert(!m_rThis.IsTabFrame()); // prevented by IsMoveable()
+assert(!m_rThis.IsInTab());
 if (!m_rThis.IsContentFrame() || !pOldBoss)
 {
 SAL_WARN("sw.core", "Tables in footnotes are not truly supported");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-05-16 Thread Caolán McNamara
 sw/source/filter/ww8/ww8par.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b462870a3a5053b1efd507960c2d0d2a13a838c7
Author: Caolán McNamara 
Date:   Fri May 12 13:59:36 2017 +0100

Resolves: tdf#107786 crash on null pointer access

Change-Id: I371d509e7ab6e7e0ef757e302d54ab75aa6c4c9b
(cherry picked from commit 858d1e065530997a695dc303b9224fd136137c8d)
Reviewed-on: https://gerrit.libreoffice.org/37537
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index cf06fc768513..cd6213e5f26d 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4317,7 +4317,7 @@ void wwSectionManager::SetSegmentToPageDesc(const 
wwSection &rSection,
 Rectangle aRect(0, 0, 100, 100); // A dummy, we don't care about the 
size
 SvxMSDffImportData aData(aRect);
 SdrObject* pObject = nullptr;
-if (mrReader.m_pMSDffManager->GetShape(0x401, pObject, aData))
+if (mrReader.m_pMSDffManager->GetShape(0x401, pObject, aData) && 
!aData.empty())
 {
 // Only handle shape if it is a background shape
 if (((*aData.begin())->nFlags & 0x400) != 0)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: accessibility/source compilerplugins/clang

2017-05-16 Thread Noel Grandin
 accessibility/source/extended/AccessibleBrowseBoxBase.cxx   |4 ++--
 accessibility/source/extended/AccessibleGridControlBase.cxx |4 ++--
 accessibility/source/extended/accessibleiconchoicectrl.cxx  |2 +-
 accessibility/source/extended/accessiblelistboxentry.cxx|2 +-
 accessibility/source/extended/accessibletablistboxtable.cxx |2 +-
 accessibility/source/helper/acc_factory.cxx |2 +-
 accessibility/source/standard/vclxaccessibletoolbox.cxx |4 ++--
 compilerplugins/clang/comparisonwithconstant.cxx|   10 --
 8 files changed, 10 insertions(+), 20 deletions(-)

New commits:
commit 482ef1bfe95a32a6796ce5a3150f272845db7931
Author: Noel Grandin 
Date:   Tue May 16 10:26:15 2017 +0200

loplugin:comparisonwithconstant in accessibility

Change-Id: I934c78ec8daec656ca656d5c784f80895abfd2e4
Reviewed-on: https://gerrit.libreoffice.org/37666
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx 
b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx
index f4b18d9e1208..5c21f9371849 100644
--- a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx
+++ b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx
@@ -389,7 +389,7 @@ tools::Rectangle AccessibleBrowseBoxBase::getBoundingBox()
 ensureIsAlive();
 
 tools::Rectangle aRect = implGetBoundingBox();
-if ( 0 == aRect.Left() && 0 == aRect.Top() && 0 == aRect.Right() && 0 == 
aRect.Bottom() )
+if ( aRect.Left() == 0 && aRect.Top() == 0 && aRect.Right() == 0 && 
aRect.Bottom() == 0 )
 {
 SAL_WARN( "accessibility", "rectangle doesn't exist" );
 }
@@ -402,7 +402,7 @@ tools::Rectangle 
AccessibleBrowseBoxBase::getBoundingBoxOnScreen()
 ensureIsAlive();
 
 tools::Rectangle aRect = implGetBoundingBoxOnScreen();
-if ( 0 == aRect.Left() && 0 == aRect.Top() && 0 == aRect.Right() && 0 == 
aRect.Bottom() )
+if ( aRect.Left() == 0 && aRect.Top() == 0 && aRect.Right() == 0 && 
aRect.Bottom() == 0 )
 {
 SAL_WARN( "accessibility", "rectangle doesn't exist" );
 }
diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx 
b/accessibility/source/extended/AccessibleGridControlBase.cxx
index dd22d4c76af7..49b5a46f32a2 100644
--- a/accessibility/source/extended/AccessibleGridControlBase.cxx
+++ b/accessibility/source/extended/AccessibleGridControlBase.cxx
@@ -313,7 +313,7 @@ tools::Rectangle AccessibleGridControlBase::getBoundingBox()
 SolarMutexGuard aSolarGuard;
 ensureIsAlive();
 tools::Rectangle aRect = implGetBoundingBox();
-if ( 0 == aRect.Left() && 0 == aRect.Top() && 0 == aRect.Right() && 0 == 
aRect.Bottom() )
+if ( aRect.Left() == 0 && aRect.Top() == 0 && aRect.Right() == 0 && 
aRect.Bottom() == 0 )
 {
 SAL_WARN( "accessibility", "rectangle doesn't exist" );
 }
@@ -325,7 +325,7 @@ tools::Rectangle 
AccessibleGridControlBase::getBoundingBoxOnScreen()
 SolarMutexGuard aSolarGuard;
 ensureIsAlive();
 tools::Rectangle aRect = implGetBoundingBoxOnScreen();
-if ( 0 == aRect.Left() && 0 == aRect.Top() && 0 == aRect.Right() && 0 == 
aRect.Bottom() )
+if ( aRect.Left() == 0 && aRect.Top() == 0 && aRect.Right() == 0 && 
aRect.Bottom() == 0 )
 {
 SAL_WARN( "accessibility", "rectangle doesn't exist" );
 }
diff --git a/accessibility/source/extended/accessibleiconchoicectrl.cxx 
b/accessibility/source/extended/accessibleiconchoicectrl.cxx
index 18a4a344495d..3ec6e6e29c04 100644
--- a/accessibility/source/extended/accessibleiconchoicectrl.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrl.cxx
@@ -337,7 +337,7 @@ namespace accessibility
 }
 
 // if only one entry is selected and its index is chosen to deselect 
-> no selection anymore
-if ( 1 == nSelCount && bFound )
+if ( nSelCount == 1 && bFound )
 pCtrl->SetNoSelection();
 }
 
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx 
b/accessibility/source/extended/accessiblelistboxentry.cxx
index dc1c80299e51..4f635be0cbac 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -316,7 +316,7 @@ namespace accessibility
 if ( !xParent.is() )
 {
 OSL_ENSURE( m_aEntryPath.size(), 
"AccessibleListBoxEntry::getAccessibleParent: invalid path!" );
-if ( 1 == m_aEntryPath.size() )
+if ( m_aEntryPath.size() == 1 )
 {   // we're a top level entry
 // -> our parent is the tree listbox itself
 if ( getListBox() )
diff --git a/accessibility/source/extended/accessibletablistboxtable.cxx 
b/accessibility/source/extended/accessibletablistboxtable.cxx
index 857de8c81c8f..2490cf12c5cd 100644
--- a/accessibility/source/extended/accessibletablistboxtable.cxx
+++ b/accessibility/source/extended/accessi

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

2017-05-16 Thread Michael Stahl
 sw/inc/swtypes.hxx |6 +
 sw/qa/extras/uiwriter/uiwriter.cxx |  134 +
 sw/source/core/txtnode/thints.cxx  |8 +-
 sw/source/core/undo/undobj1.cxx|2 
 4 files changed, 144 insertions(+), 6 deletions(-)

New commits:
commit 4820c9b981e060a55b3511272824dca7c2eb67d5
Author: Michael Stahl 
Date:   Wed May 10 17:45:14 2017 +0200

tdf#107512 sw: fix rollback of text attributes in SwUndoDelete

The problem is that in SwUndoDelete::UndoImpl(), first the formatting
attributes are restored via TmpRollback(), and then all footnote/fly
attributes are restored via Rollback(). This means that the SwHistory
doesn't actually store the original positions of the formatting hints;
ideally there wouldn't be 2 separate steps here, but that appears
difficult to change now given the plethora of calls to
DelContentIndex() ...

So work around the problem by adding a new SetAttrMode::NOHINTEXPAND
to prevent expanding the existing hints when the CH_TXTATR_BREAKWORD
are inserted from SwUndoDelLayFormat.

This fixes 2 problematic cases: at the start of the paragraph,
and if the hint ends at the position before the CH_TXTATR_BREAKWORD.

Let's hope this won't break anything anybody cares about.

(cherry picked from commit 771d85baf18e5b503eb6248e1f41928b00265d8d)

sw: CPPUNIT_ASSERT_EQUAL vs. integer FAIL
(cherry picked from commit 7f44ca113170a641a1aecc8a48e2b99860e1e2f7)

Change-Id: I557c4c9136f4225ca502019730fb9f0a9c03d23b
Reviewed-on: https://gerrit.libreoffice.org/37485
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index 2c88e9fe99c9..d5114cd033c6 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -193,11 +193,13 @@ enum class SetAttrMode
 /// Force hint expand (only matters for hints with CH_TXTATR).
 FORCEHINTEXPAND = 0x0040,
 /// The inserted item is a copy -- intended for use in ndtxt.cxx.
-IS_COPY = 0x0080
+IS_COPY = 0x0080,
+/// for Undo, translated to SwInsertFlags::NOHINTEXPAND
+NOHINTEXPAND= 0x0100,
 };
 namespace o3tl
 {
-template<> struct typed_flags : is_typed_flags {};
+template<> struct typed_flags : is_typed_flags {};
 }
 
 #define SW_ISPRINTABLE( c ) ( c >= ' ' && 127 != c )
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index 0ba241259e31..d955e769e019 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -176,6 +176,7 @@ public:
 void testTableBackgroundColor();
 void testTdf88899();
 void testTdf90362();
+void testUndoDelAsCharTdf107512();
 void testUndoCharAttribute();
 void testTdf86639();
 void testTdf90883TableBoxGetCoordinates();
@@ -290,6 +291,7 @@ public:
 CPPUNIT_TEST(testTableBackgroundColor);
 CPPUNIT_TEST(testTdf88899);
 CPPUNIT_TEST(testTdf90362);
+CPPUNIT_TEST(testUndoDelAsCharTdf107512);
 CPPUNIT_TEST(testUndoCharAttribute);
 CPPUNIT_TEST(testTdf86639);
 CPPUNIT_TEST(testTdf90883TableBoxGetCoordinates);
@@ -3031,6 +3033,138 @@ void SwUiWriterTest::testTdf90362()
 CPPUNIT_ASSERT_EQUAL(false, pWrtShell->HasReadonlySel());
 }
 
+void SwUiWriterTest::testUndoDelAsCharTdf107512()
+{
+SwDoc * pDoc(createDoc());
+sw::UndoManager & rUndoManager(pDoc->GetUndoManager());
+IDocumentContentOperations & rIDCO(pDoc->getIDocumentContentOperations());
+SwCursorShell * pShell(pDoc->GetEditShell());
+SfxItemSet frameSet(pDoc->GetAttrPool(), RES_FRMATR_BEGIN, 
RES_FRMATR_END-1);
+SfxItemSet grfSet(pDoc->GetAttrPool(), RES_GRFATR_BEGIN, RES_GRFATR_END-1);
+rIDCO.InsertString(*pShell->GetCursor(), "foo");
+pShell->ClearMark();
+SwFormatAnchor anchor(RndStdIds::FLY_AS_CHAR);
+frameSet.Put(anchor);
+GraphicObject grf;
+pShell->SttEndDoc(true);
+CPPUNIT_ASSERT(rIDCO.Insert(*pShell->GetCursor(), grf, &frameSet, &grfSet, 
nullptr));
+pShell->SttEndDoc(false);
+CPPUNIT_ASSERT(rIDCO.Insert(*pShell->GetCursor(), grf, &frameSet, &grfSet, 
nullptr));
+CPPUNIT_ASSERT_EQUAL(size_t(2), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
+SvxCharHiddenItem hidden(true, RES_CHRATR_HIDDEN);
+pShell->SelectText(1, 4);
+rIDCO.InsertPoolItem(*pShell->GetCursor(), hidden);
+// now we have "\1foo\1" with the "foo" hidden
+
CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(0,
 RES_TXTATR_FLYCNT));
+
CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(4,
 RES_TXTATR_FLYCNT));
+CPPUNIT_ASSERT_EQUAL(OUString(OUStringLiteral1(CH_TXTATR_BREAKWORD) + 
"foo" + OUStringLiteral1(CH_TXTATR_BREAKWORD)), 
pShell->GetCursor()->GetNode().GetTextNode()->GetText());
+SfxPoolItem const* pItem;
+SfxItemSet query(pDoc->GetAttrPool(), RES_CHRATR_HIDDEN, 
RES_CHRATR_HIDDEN);
+pShell->GetC

[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - filter/source

2017-05-16 Thread Michael Stahl
 filter/source/xsltfilter/OleHandler.cxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 5d474fc14581eaceb1defa7eabf5bcd335143b2d
Author: Michael Stahl 
Date:   Wed May 10 21:19:58 2017 +0200

tdf#107709 filter: MSO2003XML import: fix invalid OLE lengths

The oleLength was -28160 for the bugdoc, so i guess the shifting of
signed chars there is perhaps not ideal, better upcast and
shift as unsigned.

Change-Id: I068013a10e18043c1534c7c61be8ff8a5556d460
(cherry picked from commit 088b898856a82d7ac4851a6e7dfe4d189d881f8e)
Reviewed-on: https://gerrit.libreoffice.org/37486
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/filter/source/xsltfilter/OleHandler.cxx 
b/filter/source/xsltfilter/OleHandler.cxx
index 6564d2ea88a9..2f2bd04f9eef 100644
--- a/filter/source/xsltfilter/OleHandler.cxx
+++ b/filter/source/xsltfilter/OleHandler.cxx
@@ -117,8 +117,14 @@ namespace XSLT
 {
 return "Can not read the length.";
 }
-int oleLength = (aLength[0] << 0) + (aLength[1] << 8)
-+ (aLength[2] << 16) + (aLength[3] << 24);
+sal_Int32 const oleLength = (static_cast(aLength[0]) <<  0U)
+  | (static_cast(aLength[1]) <<  8U)
+  | (static_cast(aLength[2]) << 16U)
+  | (static_cast(aLength[3]) << 
24U);
+if (oleLength < 0)
+{
+return "invalid oleLength";
+}
 Sequence content(oleLength);
 //Read all bytes. The compressed length should less then the 
uncompressed length
 readbytes = subStream->readBytes(content, oleLength);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - desktop/source

2017-05-16 Thread Aron Budea
 desktop/source/app/app.cxx |   24 +++-
 1 file changed, 15 insertions(+), 9 deletions(-)

New commits:
commit aafb6a75c7461362aceddeadfbf0db0848af866c
Author: Aron Budea 
Date:   Sun May 7 01:49:08 2017 +0200

tdf#104312, tdf#105428: use static vars in ReplaceStringHookProc

And use call_once to initialize them once.

Reviewed-on: https://gerrit.libreoffice.org/37318
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 
(cherry picked from commit f9f511317fa5f1c655d189a8507f8a5492a3b08d)

Change-Id: Ic2f97a51ccc6ee400eb1af56da2c8fd88e226a9d
Reviewed-on: https://gerrit.libreoffice.org/37410
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 879369714580..1f9307d0c26f 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -23,6 +23,7 @@
 #include 
 
 #include 
+#include 
 #if defined UNX
 #include 
 #endif
@@ -473,16 +474,17 @@ namespace
 
 OUString ReplaceStringHookProc( const OUString& rStr )
 {
-OUString sRet(rStr);
+const static OUString 
sBuildId(utl::Bootstrap::getBuildIdData("development"));
+static OUString sBrandName, sVersion, sAboutBoxVersion, 
sAboutBoxVersionSuffix, sExtension;
 
-if (sRet.indexOf("%PRODUCT") != -1 || sRet.indexOf("%ABOUTBOX") != -1)
+static std::once_flag aInitOnce;
+std::call_once(aInitOnce, []
 {
-OUString sBrandName = BrandName::get();
-OUString sVersion = Version::get();
-OUString sBuildId = utl::Bootstrap::getBuildIdData("development");
-OUString sAboutBoxVersion = AboutBoxVersion::get();
-OUString sAboutBoxVersionSuffix = AboutBoxVersionSuffix::get();
-OUString sExtension = Extension::get();
+sBrandName = BrandName::get();
+sVersion = Version::get();
+sAboutBoxVersion = AboutBoxVersion::get();
+sAboutBoxVersionSuffix = AboutBoxVersionSuffix::get();
+sExtension = Extension::get();
 
 if ( sBrandName.isEmpty() )
 {
@@ -490,12 +492,16 @@ OUString ReplaceStringHookProc( const OUString& rStr )
 sVersion = utl::ConfigManager::getProductVersion();
 sAboutBoxVersion = utl::ConfigManager::getAboutBoxProductVersion();
 sAboutBoxVersionSuffix = 
utl::ConfigManager::getAboutBoxProductVersionSuffix();
-if ( sExtension.isEmpty() )
+if (sExtension.isEmpty())
 {
 sExtension = utl::ConfigManager::getProductExtension();
 }
 }
+} );
 
+OUString sRet(rStr);
+if (sRet.indexOf("%PRODUCT") != -1 || sRet.indexOf("%ABOUTBOX") != -1)
+{
 sRet = sRet.replaceAll( "%PRODUCTNAME", sBrandName );
 sRet = sRet.replaceAll( "%PRODUCTVERSION", sVersion );
 sRet = sRet.replaceAll( "%BUILDID", sBuildId );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: compilerplugins/Makefile-clang.mk jurt/Library_jpipe.mk setup_native/Library_getuid.mk

2017-05-16 Thread Stephan Bergmann
 compilerplugins/Makefile-clang.mk |2 +-
 jurt/Library_jpipe.mk |4 ++--
 setup_native/Library_getuid.mk|2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 1772daba6afa394e1081028825e4f96e6387d9a3
Author: Stephan Bergmann 
Date:   Tue May 16 11:37:02 2017 +0200

Also filter out flags like -fsanitize-address-globals-dead-stripping

...to avoid -Werror,-Wunused-command-line-argument in case some ASan build
setting passes in such flags

Change-Id: Ia613a10e3564a23715019ee0c7c755cdcbf7a47c

diff --git a/compilerplugins/Makefile-clang.mk 
b/compilerplugins/Makefile-clang.mk
index dc9255725b9e..4839fdef2feb 100644
--- a/compilerplugins/Makefile-clang.mk
+++ b/compilerplugins/Makefile-clang.mk
@@ -11,7 +11,7 @@
 CLANG_COMMA :=,
 
 ifeq ($(COMPILER_PLUGINS_CXX),)
-CLANGCXX=$(filter-out -m32 -m64 -fsanitize=%,$(CXX))
+CLANGCXX=$(filter-out -m32 -m64 -fsanitize%,$(CXX))
 else
 CLANGCXX=$(COMPILER_PLUGINS_CXX)
 endif
diff --git a/jurt/Library_jpipe.mk b/jurt/Library_jpipe.mk
index 2e26df17e13d..5759baed5175 100644
--- a/jurt/Library_jpipe.mk
+++ b/jurt/Library_jpipe.mk
@@ -79,9 +79,9 @@ $(eval $(call gb_Library_add_libs,jpipe, \
 ))
 
 $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,jpipe)): \
-gb_CC := $(filter-out -fsanitize=%,$(gb_CC))
+gb_CC := $(filter-out -fsanitize%,$(gb_CC))
 $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,jpipe)): \
-gb_CXX := $(filter-out -fsanitize=%,$(gb_CXX))
+gb_CXX := $(filter-out -fsanitize%,$(gb_CXX))
 
 endif
 endif
diff --git a/setup_native/Library_getuid.mk b/setup_native/Library_getuid.mk
index 650cfaf1897b..4212e5f4b4d5 100644
--- a/setup_native/Library_getuid.mk
+++ b/setup_native/Library_getuid.mk
@@ -15,7 +15,7 @@ $(eval $(call gb_Library_add_defs,getuid,\
 ))
 endif
 
-$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,getuid)) : 
gb_CC := $(filter-out -fsanitize=%,$(gb_CC))
+$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,getuid)) : 
gb_CC := $(filter-out -fsanitize%,$(gb_CC))
 
 # the library is used by LD_PRELOAD; make sure that we see the symbols ;-)
 ifeq ($(COM),GCC)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-05-16 Thread Aron Budea
 desktop/source/app/app.cxx |   24 +++-
 1 file changed, 15 insertions(+), 9 deletions(-)

New commits:
commit d2f69fc9011c0f4360710629783e800b60cedd65
Author: Aron Budea 
Date:   Sun May 7 01:49:08 2017 +0200

tdf#104312, tdf#105428: use static vars in ReplaceStringHookProc

And use call_once to initialize them once.

Reviewed-on: https://gerrit.libreoffice.org/37318
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 
(cherry picked from commit f9f511317fa5f1c655d189a8507f8a5492a3b08d)

Change-Id: Ic2f97a51ccc6ee400eb1af56da2c8fd88e226a9d
Reviewed-on: https://gerrit.libreoffice.org/37528
Reviewed-by: Jan Holesovsky 
Tested-by: Jan Holesovsky 

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 879369714580..1f9307d0c26f 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -23,6 +23,7 @@
 #include 
 
 #include 
+#include 
 #if defined UNX
 #include 
 #endif
@@ -473,16 +474,17 @@ namespace
 
 OUString ReplaceStringHookProc( const OUString& rStr )
 {
-OUString sRet(rStr);
+const static OUString 
sBuildId(utl::Bootstrap::getBuildIdData("development"));
+static OUString sBrandName, sVersion, sAboutBoxVersion, 
sAboutBoxVersionSuffix, sExtension;
 
-if (sRet.indexOf("%PRODUCT") != -1 || sRet.indexOf("%ABOUTBOX") != -1)
+static std::once_flag aInitOnce;
+std::call_once(aInitOnce, []
 {
-OUString sBrandName = BrandName::get();
-OUString sVersion = Version::get();
-OUString sBuildId = utl::Bootstrap::getBuildIdData("development");
-OUString sAboutBoxVersion = AboutBoxVersion::get();
-OUString sAboutBoxVersionSuffix = AboutBoxVersionSuffix::get();
-OUString sExtension = Extension::get();
+sBrandName = BrandName::get();
+sVersion = Version::get();
+sAboutBoxVersion = AboutBoxVersion::get();
+sAboutBoxVersionSuffix = AboutBoxVersionSuffix::get();
+sExtension = Extension::get();
 
 if ( sBrandName.isEmpty() )
 {
@@ -490,12 +492,16 @@ OUString ReplaceStringHookProc( const OUString& rStr )
 sVersion = utl::ConfigManager::getProductVersion();
 sAboutBoxVersion = utl::ConfigManager::getAboutBoxProductVersion();
 sAboutBoxVersionSuffix = 
utl::ConfigManager::getAboutBoxProductVersionSuffix();
-if ( sExtension.isEmpty() )
+if (sExtension.isEmpty())
 {
 sExtension = utl::ConfigManager::getProductExtension();
 }
 }
+} );
 
+OUString sRet(rStr);
+if (sRet.indexOf("%PRODUCT") != -1 || sRet.indexOf("%ABOUTBOX") != -1)
+{
 sRet = sRet.replaceAll( "%PRODUCTNAME", sBrandName );
 sRet = sRet.replaceAll( "%PRODUCTVERSION", sVersion );
 sRet = sRet.replaceAll( "%BUILDID", sBuildId );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-05-16 Thread Marco Cecchetti
 include/sfx2/viewsh.hxx|2 ++
 sc/source/ui/inc/tabvwsh.hxx   |2 ++
 sc/source/ui/view/tabvwshc.cxx |5 +
 sfx2/source/view/viewsh.cxx|6 ++
 4 files changed, 15 insertions(+)

New commits:
commit dd881805bf5cc5ec99314d02534ffeaf31de1cae
Author: Marco Cecchetti 
Date:   Mon May 8 00:28:37 2017 +0200

lok: sc: address and formula text field empty on creating a new view

When the client starts the address and formula text field were empty
because the updating callbacks occurred before the view callback
handler had been registered.
So a new method `afterCallbackRegistered` has been added in order to
perform any needed updating/initialization soon after the view
callback handler has been registered.

Change-Id: Ia47234e32796f7e4bc1a8408736102054b4666e2

diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 3e276546aa94..a6dd243da4d7 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -338,6 +338,8 @@ public:
 void NotifyOtherView(OutlinerViewShell* pOtherShell, int nType, const 
OString& rKey, const OString& rPayload) override;
 /// Ask this view to send its cursor position to pViewShell.
 virtual void NotifyCursor(SfxViewShell* /*pViewShell*/) const;
+/// Where a new view can perform some update/initialization soon after the 
callback has been registered.
+virtual void afterCallbackRegistered();
 };
 
 
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 08aeaaf85929..c08e4ee2a08f 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -390,6 +390,8 @@ public:
 void SetForceFocusOnCurCell(bool bFlag) { bForceFocusOnCurCell=bFlag; }
 /// See SfxViewShell::getPart().
 int getPart() const override;
+/// See SfxViewShell::afterCallbackRegistered().
+void afterCallbackRegistered() override;
 /// See SfxViewShell::NotifyCursor().
 void NotifyCursor(SfxViewShell* pViewShell) const override;
 };
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 5ac562612ed3..20d02dd9a1ea 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -511,6 +511,11 @@ int ScTabViewShell::getPart() const
 return GetViewData().GetTabNo();
 }
 
+void ScTabViewShell::afterCallbackRegistered()
+{
+UpdateInputHandler(true, false);
+}
+
 void ScTabViewShell::NotifyCursor(SfxViewShell* pOtherShell) const
 {
 ScDrawView* pDrView = const_cast(this)->GetScDrawView();
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index d8486f336dc9..8fc744e5c033 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1436,6 +1436,8 @@ void 
SfxViewShell::registerLibreOfficeKitViewCallback(LibreOfficeKitCallback pCa
 pImpl->m_pLibreOfficeKitViewCallback = pCallback;
 pImpl->m_pLibreOfficeKitViewData = pData;
 
+afterCallbackRegistered();
+
 // Ask other views to tell us about their cursors.
 SfxViewShell* pViewShell = SfxViewShell::GetFirst();
 while (pViewShell)
@@ -1468,6 +1470,10 @@ void SfxViewShell::libreOfficeKitViewCallback(int nType, 
const char* pPayload) c
 pImpl->m_pLibreOfficeKitViewCallback(nType, pPayload, 
pImpl->m_pLibreOfficeKitViewData);
 }
 
+void SfxViewShell::afterCallbackRegistered()
+{
+}
+
 void SfxViewShell::NotifyCursor(SfxViewShell* /*pViewShell*/) const
 {
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - shell/source

2017-05-16 Thread Thomas Beck
 shell/source/win32/SysShExec.cxx |   22 ++
 1 file changed, 22 insertions(+)

New commits:
commit 45b2e11a6756ed322cda932142c31366fc2b6da6
Author: Thomas Beck 
Date:   Wed May 3 12:57:11 2017 +0200

tdf#107587 Opening Hyperlink opens Browser in Background.

Added neccessary WinAPI calls to bring called window into the
Foreground.

Change-Id: I080968f655e2230d1a514b3ef91bf916d904d844
Reviewed-on: https://gerrit.libreoffice.org/37196
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 
(cherry picked from commit ad711bc6e2cc35c2ed114fff15008d5bbcfcf21c)
Reviewed-on: https://gerrit.libreoffice.org/37266
Reviewed-by: Miklos Vajna 

diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index c69d3f2a0c59..6cb31942ba02 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -323,6 +323,28 @@ void SAL_CALL CSysShExec::execute( const OUString& 
aCommand, const OUString& aPa
 static_cast< XSystemShellExecute* >(this),
 psxErr);
 }
+else
+{
+// Get Permission make changes to the Window of the created Process
+HWND procHandle = 0;
+DWORD procId = GetProcessId(sei.hProcess);
+AllowSetForegroundWindow(procId);
+
+// Get the handle of the created Window
+DWORD check = 0;
+GetWindowThreadProcessId(procHandle, &check);
+SAL_WARN_IF(check != procId, "shell", "Could not get handle of process 
called by shell.");
+
+// Move created Window into the foreground
+if(procHandle != 0)
+{
+SetForegroundWindow(procHandle);
+SetActiveWindow(procHandle);
+}
+}
+
+// Close the handle for the created childprocess when we are done
+CloseHandle(sei.hProcess);
 }
 
 // XServiceInfo
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 2 commits - desktop/source include/LibreOfficeKit include/sfx2 libreofficekit/qa libreofficekit/source sc/source sfx2/source

2017-05-16 Thread Marco Cecchetti
 desktop/source/lib/init.cxx |3 +
 include/LibreOfficeKit/LibreOfficeKitEnums.h|7 ++
 include/sfx2/viewsh.hxx |2 
 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |   52 
 libreofficekit/source/gtk/lokdocview.cxx|   28 ++
 sc/source/ui/app/inputhdl.cxx   |   21 +---
 sc/source/ui/inc/tabvwsh.hxx|2 
 sc/source/ui/view/tabvwshc.cxx  |5 +
 sfx2/source/view/viewsh.cxx |6 ++
 9 files changed, 118 insertions(+), 8 deletions(-)

New commits:
commit 708600e84cb3b20cbbc1f6eea5f7f039cba034a1
Author: Marco Cecchetti 
Date:   Mon May 8 00:28:37 2017 +0200

lok: sc: address and formula text field empty on creating a new view

When the client starts the address and formula text field were empty
because the updating callbacks occurred before the view callback
handler had been registered.
So a new method `afterCallbackRegistered` has been added in order to
perform any needed updating/initialization soon after the view
callback handler has been registered.

Change-Id: Ia47234e32796f7e4bc1a8408736102054b4666e2

diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 14466922f461..2c93dd17bcd1 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -339,6 +339,8 @@ public:
 void NotifyOtherView(OutlinerViewShell* pOtherShell, int nType, const 
OString& rKey, const OString& rPayload) override;
 /// Ask this view to send its cursor position to pViewShell.
 virtual void NotifyCursor(SfxViewShell* /*pViewShell*/) const;
+/// Where a new view can perform some update/initialization soon after the 
callback has been registered.
+virtual void afterCallbackRegistered();
 };
 
 
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 0722b4980af7..eb759055817d 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -392,6 +392,8 @@ public:
 void SetForceFocusOnCurCell(bool bFlag) { bForceFocusOnCurCell=bFlag; }
 /// See SfxViewShell::getPart().
 int getPart() const override;
+/// See SfxViewShell::afterCallbackRegistered().
+void afterCallbackRegistered() override;
 /// See SfxViewShell::NotifyCursor().
 void NotifyCursor(SfxViewShell* pViewShell) const override;
 };
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index cdc2ee864676..a9e35896ca6e 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -516,6 +516,11 @@ int ScTabViewShell::getPart() const
 return GetViewData().GetTabNo();
 }
 
+void ScTabViewShell::afterCallbackRegistered()
+{
+UpdateInputHandler(true, false);
+}
+
 void ScTabViewShell::NotifyCursor(SfxViewShell* pOtherShell) const
 {
 ScDrawView* pDrView = const_cast(this)->GetScDrawView();
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 4d55babc23ee..dbc6bc3a8c4c 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1460,6 +1460,8 @@ void 
SfxViewShell::registerLibreOfficeKitViewCallback(LibreOfficeKitCallback pCa
 pImpl->m_pLibreOfficeKitViewCallback = pCallback;
 pImpl->m_pLibreOfficeKitViewData = pData;
 
+afterCallbackRegistered();
+
 // Ask other views to tell us about their cursors.
 SfxViewShell* pViewShell = SfxViewShell::GetFirst();
 while (pViewShell)
@@ -1492,6 +1494,10 @@ void SfxViewShell::libreOfficeKitViewCallback(int nType, 
const char* pPayload) c
 pImpl->m_pLibreOfficeKitViewCallback(nType, pPayload, 
pImpl->m_pLibreOfficeKitViewData);
 }
 
+void SfxViewShell::afterCallbackRegistered()
+{
+}
+
 void SfxViewShell::NotifyCursor(SfxViewShell* /*pViewShell*/) const
 {
 }
commit 838725b62320c6f9aebdeb45558620952abb5bec
Author: Marco Cecchetti 
Date:   Mon May 8 00:26:08 2017 +0200

lok: sc: notify cell cursor position to address control in client

A new callback has been introduced for notifying the client:
LOK_CALLBACK_CELL_ADDRESS

Change-Id: I40b38a3cb8fb658c3f00332d56cfcbaf98e13771
Reviewed-on: https://gerrit.libreoffice.org/37357
Reviewed-by: pranavk 
Tested-by: pranavk 
(cherry picked from commit 9cc9300bc20e9367728aa4b7ec3a789fdd274aff)

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 971d43548611..58d47e5c590e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -681,6 +681,7 @@ 
CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitDocument* pDocument, Li
 m_states.emplace(LOK_CALLBACK_MOUSE_POINTER, "NIL");
 m_states.emplace(LOK_CALLBACK_CELL_CURSOR, "NIL");
 m_states.emplace(LOK_CALLBACK_CELL_FORMULA, "NIL");
+m_states.emplace(LOK_CALLBACK_CELL_ADDRESS, "NIL");
 m_states.emplace(LOK_CALLBACK_CURSOR_VISIBLE, "NIL");
 m_states.emplace(LOK_CALLBACK_SE

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

2017-05-16 Thread Noel Grandin
 cui/source/dialogs/hldocntp.cxx |8 
 cui/source/dialogs/hldoctp.cxx  |8 
 cui/source/dialogs/hlinettp.cxx |8 
 cui/source/dialogs/hlmailtp.cxx |8 
 cui/source/dialogs/hltpbase.cxx |4 ++--
 cui/source/dialogs/iconcdlg.cxx |   25 +++--
 cui/source/inc/hldocntp.hxx |4 ++--
 cui/source/inc/hldoctp.hxx  |4 ++--
 cui/source/inc/hlinettp.hxx |4 ++--
 cui/source/inc/hlmailtp.hxx |4 ++--
 cui/source/inc/hltpbase.hxx |2 +-
 cui/source/inc/iconcdlg.hxx |5 ++---
 12 files changed, 32 insertions(+), 52 deletions(-)

New commits:
commit 32be55414da2af0ea796a57c7f15d18a3fd756cb
Author: Noel Grandin 
Date:   Tue May 16 10:11:26 2017 +0200

cleanup code in IconChoiceDialog::ActivatePageImpl

which has been this way ever since
   commit d32b3a714fe55892bdead03502c5a9b0e77fa61d
   Author: Mathias Bauer 
   Date:   Sat Oct 31 00:36:06 2009 +0100
   #i106421#: move svx/source/cui to cui

And pass the SfxItemSet as a pointer up the constructor hierarchy,
instead of a reference, since the base class wants a pointer anyway

Change-Id: Iac4081fb5f3fc9cb9b0223f903d74ba84cdd5f6c
Reviewed-on: https://gerrit.libreoffice.org/37664
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 34ca087432b1..2b4c4e533a6f 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -99,8 +99,8 @@ bool SvxHyperlinkNewDocTp::ImplGetURLObject( const OUString& 
rPath, const OUStri
 |*
 |/
 
-SvxHyperlinkNewDocTp::SvxHyperlinkNewDocTp ( vcl::Window *pParent, 
IconChoiceDialog* pDlg, const SfxItemSet& rItemSet)
-:   SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkNewDocPage", 
"cui/ui/hyperlinknewdocpage.ui", rItemSet )
+SvxHyperlinkNewDocTp::SvxHyperlinkNewDocTp ( vcl::Window *pParent, 
IconChoiceDialog* pDlg, const SfxItemSet* pItemSet)
+:   SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkNewDocPage", 
"cui/ui/hyperlinknewdocpage.ui", pItemSet )
 {
 get(m_pRbtEditNow, "editnow");
 get(m_pRbtEditLater, "editlater");
@@ -247,9 +247,9 @@ void SvxHyperlinkNewDocTp::GetCurentItemData ( OUString& 
rStrURL, OUString& aStr
 |*
 |/
 
-VclPtr SvxHyperlinkNewDocTp::Create( vcl::Window* pWindow, 
IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
+VclPtr SvxHyperlinkNewDocTp::Create( vcl::Window* pWindow, 
IconChoiceDialog* pDlg, const SfxItemSet* pItemSet )
 {
-return VclPtr::Create( pWindow, pDlg, rItemSet );
+return VclPtr::Create( pWindow, pDlg, pItemSet );
 }
 
 /*
diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx
index 1c002d1035fb..92c4e64a3602 100644
--- a/cui/source/dialogs/hldoctp.cxx
+++ b/cui/source/dialogs/hldoctp.cxx
@@ -35,8 +35,8 @@ sal_Char const sFileScheme[]= INET_FILE_SCHEME;
 |*
 |/
 
-SvxHyperlinkDocTp::SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* 
pDlg, const SfxItemSet& rItemSet)
-: SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkDocPage", 
"cui/ui/hyperlinkdocpage.ui", rItemSet ),
+SvxHyperlinkDocTp::SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* 
pDlg, const SfxItemSet* pItemSet)
+: SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkDocPage", 
"cui/ui/hyperlinkdocpage.ui", pItemSet ),
 mbMarkWndOpen   ( false )
 {
 get(m_pCbbPath, "path");
@@ -172,9 +172,9 @@ void SvxHyperlinkDocTp::GetCurentItemData ( OUString& 
rStrURL, OUString& aStrNam
 |*
 |/
 
-VclPtr SvxHyperlinkDocTp::Create( vcl::Window* pWindow, 
IconChoiceDialog* pDlg, const SfxItemSet& rItemSet )
+VclPtr SvxHyperlinkDocTp::Create( vcl::Window* pWindow, 
IconChoiceDialog* pDlg, const SfxItemSet* pItemSet )
 {
-return VclPtr::Create( pWindow, pDlg, rItemSet );
+return VclPtr::Create( pWindow, pDlg, pItemSet );
 }
 
 /*
diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx
index 9b6ff256b5f1..eb86a6629873 100644
--- a/cui/source/dialogs/hlinettp.cxx
+++ b/cui/source/dialogs/hlinettp.cxx
@@ -35,9 +35,9 @@ sal_Char const sFTPScheme[]= INET_FTP_SCHEME;
 
 SvxHyperlinkInternetTp::SvxHyperlinkInternetTp ( vcl::Window *pParent,
  IconChoiceDialog* pDlg,
- const SfxItemSet& rItemSet)
+ const SfxItemSet* pItemSet)
 :   SvxHyperlinkTabPageBase ( pParent, pDlg, "HyperlinkInternetPage", 
"cui/ui/hyperlinkinte

  1   2   >