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

2022-10-18 Thread Stephan Bergmann (via logerrit)
 include/sal/log-areas.dox|1 +
 ucb/source/ucp/tdoc/tdoc_content.cxx |   26 ++
 ucb/source/ucp/tdoc/tdoc_contentcaps.cxx |9 +
 ucb/source/ucp/tdoc/tdoc_docmgr.cxx  |   26 ++
 ucb/source/ucp/tdoc/tdoc_docmgr.hxx  |7 +++
 ucb/source/ucp/tdoc/tdoc_provider.cxx|5 +
 ucb/source/ucp/tdoc/tdoc_provider.hxx|6 ++
 ucb/source/ucp/tdoc/tdoc_stgelems.cxx|5 +
 ucb/source/ucp/tdoc/tdoc_stgelems.hxx|5 +
 ucb/source/ucp/tdoc/tdoc_storage.cxx |2 +-
 10 files changed, 91 insertions(+), 1 deletion(-)

New commits:
commit d4512d391bc7f96af9b66a8ee44f3f2be38dc5ec
Author: Stephan Bergmann 
AuthorDate: Tue Oct 18 11:15:46 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Oct 18 12:26:19 2022 +0200

tdf#105609: Support DateModified for updated tdoc stream contents

...so that the Python script provider, based on those DateModified values, 
will
reload a script embedded in a document after that script has 
(programmatically)
been modified.

As long as a stream content in a tdoc document has not been modified, it 
will
report a default-initialized (all zero) DateModified.  Only when the stream 
has
been modified will that be changed to the current date.  While that might 
not be
the most beautiful implementation, it at least gets the job done of fixing
tdf#105609 "Python script provider does not reload modified embedded 
scripts".

(The DateModified values cannot be stored directly in the tdoc_ucp::Content
instances, as those are thrown away and recreated on demand.  So they 
needed to
be stored more persistently at the tdoc_ucp::OfficeDocumentsManager.)

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

diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index e1c89b1f7df2..bf3a269f2f66 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -433,6 +433,7 @@ certain functionality.
 @li @c ucb.ucp.file
 @li @c ucb.ucp.ftp
 @li @c ucb.ucp.gio
+@li @c ucb.ucp.tdoc
 @li @c ucb.ucp.webdav
 @li @c ucb.ucp.webdav.curl
 
diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx 
b/ucb/source/ucp/tdoc/tdoc_content.cxx
index 89335ce58493..03c80a2ad756 100644
--- a/ucb/source/ucp/tdoc/tdoc_content.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_content.cxx
@@ -895,6 +895,20 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
 xRow->appendObject(
 rProp, uno::Any( rData.getCreatableContentsInfo() ) );
 }
+else if ( rProp.Name == "DateModified" )
+{
+// DateModified is only supported by streams.
+ContentType eType = rData.getType();
+if ( eType == STREAM )
+{
+xRow->appendObject(
+rProp,
+uno::Any(
+pProvider->queryStreamDateModified( rContentId ) ) 
);
+}
+else
+xRow->appendVoid( rProp );
+}
 else if ( rProp.Name == "Storage" )
 {
 // Storage is only supported by folders.
@@ -995,6 +1009,18 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
 | beans::PropertyAttribute::READONLY ),
 uno::Any( rData.getCreatableContentsInfo() ) );
 
+// DateModified is only supported by streams.
+if ( eType == STREAM )
+{
+xRow->appendObject(
+beans::Property( "DateModified",
+  -1,
+  cppu::UnoType::get(),
+  beans::PropertyAttribute::BOUND
+| beans::PropertyAttribute::READONLY ),
+uno::Any( pProvider->queryStreamDateModified( rContentId ) ) );
+}
+
 // Storage is only supported by folders.
 if ( eType == FOLDER )
 xRow->appendObject(
diff --git a/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx 
b/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx
index 8b19f9ec94b8..384bac2f941f 100644
--- a/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx
@@ -34,6 +34,7 @@
 IsFolderr   r   r   r   r   r
 Title   r   r   w   w   w   w
 CreatableContentsInfo r r   r   r   r   r
+DateModified-   -   -   -   r   r
 Storage -   -   r   r   -   -
 DocumentModel   -   r   -   -   -   -
 
@@ -58,6 +59,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "tdoc_content.hxx"
@@ -138,6 +140,13 @@ uno::Sequence

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

2019-10-21 Thread Stephan Bergmann (via logerrit)
 include/sal/config.h |7 +++
 ucb/source/ucp/cmis/cmis_url.cxx |2 ++
 2 files changed, 9 insertions(+)

New commits:
commit e399c5a602a690126463d1cec62c511f1e053686
Author: Stephan Bergmann 
AuthorDate: Mon Oct 21 19:31:46 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Oct 21 22:54:34 2019 +0200

Silence new Clang 10 trunk -std=c++2a -Wambiguous-reversed-operator for now

It is unclear whether this will really be errors in a final C++20 standard, 
see
 "[c++20] Add rewriting from 
comparison
operators to <=> / ==" for details.

Change-Id: I3a7c2574a65952c8d255107823a1d1e18b2cbe4c
Reviewed-on: https://gerrit.libreoffice.org/81268
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/include/sal/config.h b/include/sal/config.h
index c7e304a8c5d7..335c4174e3ae 100644
--- a/include/sal/config.h
+++ b/include/sal/config.h
@@ -94,6 +94,13 @@
 #if __has_warning("-Wpotentially-evaluated-expression")
 #pragma GCC diagnostic ignored "-Wpotentially-evaluated-expression"
 #endif
+// Before fixing occurrences of this warning, lets see whether C++20 will 
still change to obsolete
+// the warning (see
+// 

 "[c++20]
+// Add rewriting from comparison operators to <=> / =="):
+#if __has_warning("-Wambiguous-reversed-operator")
+#pragma GCC diagnostic ignored "-Wambiguous-reversed-operator"
+#endif
 #endif
 
 #endif // INCLUDED_SAL_CONFIG_H
diff --git a/ucb/source/ucp/cmis/cmis_url.cxx b/ucb/source/ucp/cmis/cmis_url.cxx
index 7bca52492a73..b83d6bee316b 100644
--- a/ucb/source/ucp/cmis/cmis_url.cxx
+++ b/ucb/source/ucp/cmis/cmis_url.cxx
@@ -7,6 +7,8 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include 
+
 #if defined __GNUC__ && !defined __clang__
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2015-02-23 Thread Stephan Bergmann
 include/sal/log-areas.dox |1 +
 ucb/source/ucp/file/shell.cxx |9 -
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 94c9206399954d018aae8a1bd4e4b33354b9cdaf
Author: Stephan Bergmann 
Date:   Mon Feb 23 10:31:21 2015 +0100

file UCP: Ensure myLocalTime is initialized

When a file's time is epoch (1970-01-01 00:00:00, i.e., TimeValue temp is 
all
zero) and the TZ is UTC or westward, osl_getLocalTimeFromSystemTime returns
false and leaves myLocalTime uninitialized.  That e.g. confuses 
getModuleByUrl
(scripting/source/pyprov/pythonscript.py), potentially re-loading a Python
script with epoch time (as happens e.g. for the share/Scripts/python/ files 
in
an xdg-app installation of LO) every time it is accessed, falsely assuming 
it
has changed on disk since last load.

Change-Id: I8d4228feb28e2697a7021e3488ae2c09e8439ed8

diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 2c7b898..657374b 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -351,6 +351,7 @@ certain functionality.
 @li @c ucb.ucp
 @li @c ucb.ucp.cmis
 @li @c ucb.ucp.ext
+@li @c ucb.ucp.file
 @li @c ucb.ucp.ftp
 @li @c ucb.ucp.gio
 @li @c ucb.ucp.gvfs
diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx
index c07e97d..36eb82d 100644
--- a/ucb/source/ucp/file/shell.cxx
+++ b/ucb/source/ucp/file/shell.cxx
@@ -2440,7 +2440,14 @@ shell::commit( const shell::ContentMap::iterator& it,
 
 // Convert system time to local time (for EA)
 TimeValue myLocalTime;
-osl_getLocalTimeFromSystemTime( &temp, &myLocalTime );
+if (!osl_getLocalTimeFromSystemTime( &temp, &myLocalTime ))
+{
+SAL_WARN(
+"ucb.ucp.file",
+"cannot convert (" << temp.Seconds << ", " << temp.Nanosec
+<< ") to local time");
+myLocalTime = temp;
+}
 
 oslDateTime myDateTime;
 osl_getDateTimeFromTimeValue( &myLocalTime, &myDateTime );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits