diff options
author | Release Engineers <releng@openoffice.org> | 2009-03-20 15:07:51 +0000 |
---|---|---|
committer | Release Engineers <releng@openoffice.org> | 2009-03-20 15:07:51 +0000 |
commit | ad6387ed0a69b85fb6b49beb5c572c1bbf6ced74 (patch) | |
tree | eac44246e90d034f3c5e10ff9b966bf4956f5bef /store/source | |
parent | b0bc9610a01cbfc79fe38ebff8b4ca59235d441d (diff) |
#i10000# additional files for mhu17
Diffstat (limited to 'store/source')
-rw-r--r-- | store/source/lockbyte.cxx | 12 | ||||
-rw-r--r-- | store/source/storbase.hxx | 2 | ||||
-rw-r--r-- | store/source/stordata.hxx | 4 | ||||
-rw-r--r-- | store/source/storlckb.cxx | 6 | ||||
-rw-r--r-- | store/source/stortree.cxx | 4 |
5 files changed, 19 insertions, 9 deletions
diff --git a/store/source/lockbyte.cxx b/store/source/lockbyte.cxx index ef97f129538d..a38aa768908d 100644 --- a/store/source/lockbyte.cxx +++ b/store/source/lockbyte.cxx @@ -41,6 +41,7 @@ #include "sal/types.h" #include "osl/diagnose.h" #include "osl/file.h" +#include "osl/process.h" #include "rtl/alloc.h" #include "rtl/ustring.hxx" @@ -278,9 +279,18 @@ struct FileHandle rtl::OUString aFileUrl; if (osl_getFileURLFromSystemPath (pFilename, &(aFileUrl.pData)) != osl_File_E_None) { - // Not system path. Maybe a file url, already. + // Not system path. Assume file url. rtl_uString_assign (&(aFileUrl.pData), pFilename); } + if (aFileUrl.compareToAscii("file://", 7) != 0) + { + // Not file url. Assume relative path. + rtl::OUString aCwdUrl; + (void) osl_getProcessWorkingDir (&(aCwdUrl.pData)); + + // Absolute file url. + (void) osl_getAbsoluteFileURL (aCwdUrl.pData, aFileUrl.pData, &(aFileUrl.pData)); + } // Acquire handle. oslFileError result = osl_openFile (aFileUrl.pData, &m_handle, nFlags); diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx index 167302d7bedd..04be2860f691 100644 --- a/store/source/storbase.hxx +++ b/store/source/storbase.hxx @@ -910,7 +910,7 @@ protected: public: template< class U > - PageHolderObject<U> get() const + PageHolderObject<U> makeHolder() const { return PageHolderObject<U>(m_xPage); } diff --git a/store/source/stordata.hxx b/store/source/stordata.hxx index 4610db5ac908..1b6c74c371fd 100644 --- a/store/source/stordata.hxx +++ b/store/source/stordata.hxx @@ -836,13 +836,13 @@ private: */ page & PAGE() { - page * pImpl = reinterpret_cast<page*>(m_xPage.get()); + page * pImpl = static_cast<page*>(m_xPage.get()); OSL_PRECOND(pImpl != 0, "OStoreDirectoryPageObject::PAGE(): Null pointer"); return (*pImpl); } page const & PAGE() const { - page const * pImpl = reinterpret_cast<page const *>(m_xPage.get()); + page const * pImpl = static_cast<page const *>(m_xPage.get()); OSL_PRECOND(pImpl != 0, "OStoreDirectoryPageObject::PAGE(): Null pointer"); return (*pImpl); } diff --git a/store/source/storlckb.cxx b/store/source/storlckb.cxx index 837945d1646c..fc028f1da688 100644 --- a/store/source/storlckb.cxx +++ b/store/source/storlckb.cxx @@ -221,7 +221,7 @@ storeError OStoreLockBytes::readAt ( } else { - PageHolderObject< data > xData (aData.get<data>()); + PageHolderObject< data > xData (aData.makeHolder<data>()); memcpy ( &pData[rnDone], &xData->m_pData[aDescr.m_nOffset], @@ -322,13 +322,13 @@ storeError OStoreLockBytes::writeAt ( } } - PageHolderObject< data > xData (aData.get<data>()); + PageHolderObject< data > xData (aData.makeHolder<data>()); if (!xData.is()) { eErrCode = aData.construct<data>(m_xManager->allocator()); if (eErrCode != store_E_None) return eErrCode; - xData = aData.get<data>(); + xData = aData.makeHolder<data>(); } // Modify data page. diff --git a/store/source/stortree.cxx b/store/source/stortree.cxx index 1967c744c66b..84d27806c131 100644 --- a/store/source/stortree.cxx +++ b/store/source/stortree.cxx @@ -538,7 +538,7 @@ storeError OStoreBTreeRootObject::find_lookup ( // Check current page. PageHolderObject< page > xPage (rNode.get()); - for (; xPage->depth() > 0; xPage = rNode.get< page >()) + for (; xPage->depth() > 0; xPage = rNode.makeHolder< page >()) { // Find next page. page const & rPage = (*xPage); @@ -621,7 +621,7 @@ storeError OStoreBTreeRootObject::find_insert ( // Check current Page. PageHolderObject< page > xPage (rNode.get()); - for (; xPage->depth() > 0; xPage = rNode.get< page >()) + for (; xPage->depth() > 0; xPage = rNode.makeHolder< page >()) { // Find next page. page const & rPage = (*xPage); |