diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-11-10 15:06:12 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-11-10 15:06:12 +0000 |
commit | 7e6737cc865d9f0ba44a88b4be0c8460325d7b84 (patch) | |
tree | 1a77c19de7eb263e582261883c19c36a2032e9ec /ucb | |
parent | 72339a084c6879c8437aee34a1f9daac50d2366e (diff) |
CWS-TOOLING: integrate CWS cmcfixes50
2008-11-10 13:31:50 +0100 cmc r263517 : gio doesn't do anything useful for remote stuff wrt info
2008-11-06 00:11:47 +0100 cmc r263359 : #i93436# pile of other 64bit new gcc warnings
2008-11-05 00:39:03 +0100 cmc r263340 : i95856 let a ppc64 vanilla build succeed
2008-11-04 14:00:25 +0100 cmc r263320 : #i93436# useless const
2008-11-04 11:53:10 +0100 cmc r263314 : #i93436# ambiguous
2008-11-04 11:48:05 +0100 cmc r263313 : #i93436# add some braces
2008-11-04 11:29:24 +0100 cmc r263312 : #i93436# ambiguous
2008-11-04 10:53:46 +0100 cmc r263311 :
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/gio/gio_seekable.cxx | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/ucb/source/ucp/gio/gio_seekable.cxx b/ucb/source/ucp/gio/gio_seekable.cxx index ae5c6dd9121d..af1f707dd233 100644 --- a/ucb/source/ucp/gio/gio_seekable.cxx +++ b/ucb/source/ucp/gio/gio_seekable.cxx @@ -94,22 +94,33 @@ sal_Int64 SAL_CALL Seekable::getLength() throw( io::IOException, uno::RuntimeExc if (!mpStream) throw io::NotConnectedException(); + bool bOk = false; + sal_uInt64 nSize = 0; + GFileInfo* pInfo = G_IS_FILE_INPUT_STREAM(mpStream) ? g_file_input_stream_query_info(G_FILE_INPUT_STREAM(mpStream), const_cast<char*>(G_FILE_ATTRIBUTE_STANDARD_SIZE), NULL, NULL) : g_file_output_stream_query_info(G_FILE_OUTPUT_STREAM(mpStream), const_cast<char*>(G_FILE_ATTRIBUTE_STANDARD_SIZE), NULL, NULL); - if (!pInfo) - throw io::IOException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Getting attributes unsupported")), - static_cast< cppu::OWeakObject * >(this)); - - bool bOk = true; - sal_uInt64 nSize = 0; - if (g_file_info_has_attribute(pInfo, G_FILE_ATTRIBUTE_STANDARD_SIZE)) - nSize = g_file_info_get_size(pInfo); - else - bOk = false; + if (pInfo) + { + if (g_file_info_has_attribute(pInfo, G_FILE_ATTRIBUTE_STANDARD_SIZE)) + { + nSize = g_file_info_get_size(pInfo); + bOk = true; + } + g_object_unref(pInfo); + } - g_object_unref(pInfo); + if (!bOk) + { + GError *pError=NULL; + sal_Int64 nCurr = getPosition(); + if (!g_seekable_seek(mpStream, 0, G_SEEK_END, NULL, &pError)) + convertToException(pError, static_cast< cppu::OWeakObject * >(this)); + nSize = getPosition(); + seek(nCurr); + bOk = true; + } if (!bOk) throw io::IOException(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Getting size unsupported")), |