[Libreoffice-commits] core.git: 2 commits - comphelper/source include/comphelper sfx2/source ucb/source

Cédric Bosdonnat cedric.bosdonnat at free.fr
Tue Oct 15 05:57:27 PDT 2013


 comphelper/source/misc/mediadescriptor.cxx |   35 +++++++++++++++++++++++++++++
 include/comphelper/mediadescriptor.hxx     |   12 +++++++++
 sfx2/source/doc/objserv.cxx                |    1 
 ucb/source/ucp/cmis/cmis_content.cxx       |    1 
 4 files changed, 48 insertions(+), 1 deletion(-)

New commits:
commit 3de7c7b5854335a82948560b3cc5b302171e340f
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Tue Oct 15 14:48:09 2013 +0200

    CMIS: show commit comment in versions dialog
    
    Change-Id: I0d3b3d8dfe160b00c70acb98bdf4e37d088dc4c6

diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 0022a8a..8159018 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -1090,6 +1090,7 @@ namespace cmis
                 aVersions[i].Id = STD_TO_OUSTR( pVersion->getId( ) );
                 aVersions[i].Author = STD_TO_OUSTR( pVersion->getCreatedBy( ) );
                 aVersions[i].TimeStamp = lcl_boostToUnoTime( pVersion->getCreationDate( ) );
+                aVersions[i].Comment = STD_TO_OUSTR( pVersion->getStringProperty("cmis:checkinComment") );
             }
             return aVersions;
         }
commit 319b160320a045b1a5b302dafbc2220ee1d4d3c3
Author: Cao Cuong Ngo <cao.cuong.ngo at gmail.com>
Date:   Sat Sep 21 23:36:06 2013 +0200

    CMIS file picker: it really does not like ID Mark
    
    The file picker can't go back folder if we use
    ID mark in the URL.
    
    Conflicts:
    	ucb/source/ucp/cmis/cmis_content.cxx
    
    Change-Id: I6985feec71dc23848ee022e0bab9e8515a21ffd2

diff --git a/comphelper/source/misc/mediadescriptor.cxx b/comphelper/source/misc/mediadescriptor.cxx
index 21361f5..b5cd5b6 100644
--- a/comphelper/source/misc/mediadescriptor.cxx
+++ b/comphelper/source/misc/mediadescriptor.cxx
@@ -484,6 +484,7 @@ sal_Bool MediaDescriptor::impl_addInputStream( sal_Bool bLockFile )
                     css::uno::Reference< css::uno::XInterface >());
 
         // Parse URL! Only the main part has to be used further. E.g. a jumpmark can make trouble
+        OUString sNormalizedURL = impl_normalizeURL( sURL );
         return impl_openStreamWithURL( removeFragment(sURL), bLockFile );
     }
     catch(const css::uno::Exception& ex)
@@ -723,6 +724,40 @@ sal_Bool MediaDescriptor::impl_openStreamWithURL( const OUString& sURL, sal_Bool
     return xInputStream.is();
 }
 
+OUString MediaDescriptor::impl_normalizeURL(const OUString& sURL)
+{
+    /* Remove Jumpmarks (fragments) of an URL only here.
+       They are not part of any URL and as a result may be
+       no ucb content can be created then.
+       On the other side arguments must exists ... because
+       they are part of an URL.
+
+       Do not use the URLTransformer service here. Because
+       it parses the URL in another way. It's main part isnt enough
+       and it's complete part contains the jumpmark (fragment) parameter ...
+    */
+
+    try
+    {
+        css::uno::Reference< css::uno::XComponentContext >    xContext    = ::comphelper::getProcessComponentContext();
+        css::uno::Reference< css::uri::XUriReferenceFactory > xUriFactory = css::uri::UriReferenceFactory::create(xContext);;
+        css::uno::Reference< css::uri::XUriReference >        xUriRef     = xUriFactory->parse(sURL);
+        if (xUriRef.is())
+        {
+            xUriRef->clearFragment();
+            return xUriRef->getUriReference();
+        }
+    }
+    catch(const css::uno::RuntimeException&)
+        { throw; }
+    catch(const css::uno::Exception&)
+        {}
+
+    // If an error ocurred ... return the original URL.
+    // It's a try .-)
+    return sURL;
+}
+
 } // namespace comphelper
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/mediadescriptor.hxx b/include/comphelper/mediadescriptor.hxx
index 5f353e5..5409f14 100644
--- a/include/comphelper/mediadescriptor.hxx
+++ b/include/comphelper/mediadescriptor.hxx
@@ -289,6 +289,18 @@ class COMPHELPER_DLLPUBLIC MediaDescriptor : public SequenceAsHashMap
                     be created as new item. FALSE otherwise.
          */
         COMPHELPER_DLLPRIVATE sal_Bool impl_addInputStream( sal_Bool bLockFile );
+
+        /** @short  some URL parts can make trouble for opening streams (e.g. jumpmarks.)
+                    An URL should be "normalized" before its used.
+
+            @param  sURL
+                    the original URL (e.g. including a jumpmark)
+
+            @return [string]
+                    the "normalized" URL (e.g. without jumpmark)
+         */
+        COMPHELPER_DLLPRIVATE OUString impl_normalizeURL(const OUString& sURL);
+
 };
 
 } // namespace comphelper
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 2fe263e..dbac961 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -994,7 +994,6 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
                                 uno::Sequence< sal_Bool > bTmp;
                                 aCmisProperties[i].Value >>= bTmp;
                                 bCheckedOut = bTmp[0];
-
                             }
                         }
                         bShow = bCheckedOut;


More information about the Libreoffice-commits mailing list