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 | |
parent | CWS-TOOLING: integrate CWS cmcfixes55 (diff) | |
download | core-ad6387ed0a69b85fb6b49beb5c572c1bbf6ced74.tar.gz core-ad6387ed0a69b85fb6b49beb5c572c1bbf6ced74.zip |
#i10000# additional files for mhu17
Diffstat (limited to 'store')
-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 | ||||
-rw-r--r-- | store/workben/t_file.cxx | 25 | ||||
-rw-r--r-- | store/workben/t_page.cxx | 4 |
7 files changed, 46 insertions, 11 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); diff --git a/store/workben/t_file.cxx b/store/workben/t_file.cxx index ea7b6bcd37d2..d4feb25651eb 100644 --- a/store/workben/t_file.cxx +++ b/store/workben/t_file.cxx @@ -42,6 +42,9 @@ #define INCLUDED_STDIO_H #endif +#include "osl/file.h" +#include "osl/process.h" + using namespace store; #define TEST_PAGESIZE 16384 @@ -62,6 +65,28 @@ int SAL_CALL main (int argc, char **argv) argv[1], rtl_str_getLength(argv[1]), osl_getThreadTextEncoding()); +#if 0 /* EXP */ + oslFileError result; + rtl::OUString aPath; + + result = osl_getFileURLFromSystemPath(aFilename.pData, &(aPath.pData)); + if (result != osl_File_E_None) + { + // not SystemPath, assume FileUrl. + aPath = aFilename; + } + if (rtl_ustr_ascii_shortenedCompare_WithLength(aPath.pData->buffer, aPath.pData->length, "file://", 7) != 0) + { + // not FileUrl, assume relative path. + rtl::OUString aBase; + (void) osl_getProcessWorkingDir (&(aBase.pData)); + + // absolute FileUrl. + (void) osl_getAbsoluteFileURL(aBase.pData, aPath.pData, &(aPath.pData)); + } + aFilename = aPath; +#endif /* EXP */ + eErrCode = FileLockBytes_createInstance ( xLockBytes, aFilename.pData, store_AccessReadWrite); if (eErrCode != store_E_None) diff --git a/store/workben/t_page.cxx b/store/workben/t_page.cxx index b488e1ac997b..a0645f00bc58 100644 --- a/store/workben/t_page.cxx +++ b/store/workben/t_page.cxx @@ -17,7 +17,7 @@ * *======================================================================*/ -template< class T > inline void swap (T & lhs, T & rhs) +template< class T > void swap (T & lhs, T & rhs) { T tmp = rhs; rhs = lhs; lhs = tmp; } @@ -694,7 +694,7 @@ public: { TestObject aObj; - rBIOS.loadPageAt(aObj.get(), &aObj.verify); + rBIOS.loadPageAt(aObj.get(), aObj.verify); rBIOS.loadPageAt(aObj.get(), TestObject::verify); rBIOS.loadPageAt(aObj.get(), PageHolderObject<TestData>::verify); |