Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
baa6a3b9
Kaydet (Commit)
baa6a3b9
authored
Nis 03, 2013
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
prevent some unnecessary casting
Change-Id: I56b324cc8431347c25472f7ef3ac5871b226f5b1
üst
56f0144b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
25 deletions
+15
-25
helper.cxx
sfx2/source/bastyp/helper.cxx
+3
-5
dinfdlg.cxx
sfx2/source/dialog/dinfdlg.cxx
+9
-17
helper.hxx
sfx2/source/inc/helper.hxx
+3
-3
No files found.
sfx2/source/bastyp/helper.cxx
Dosyayı görüntüle @
baa6a3b9
...
...
@@ -283,16 +283,15 @@ sal_Bool SfxContentHelper::IsHelpErrorDocument( const OUString& rURL )
// -----------------------------------------------------------------------
sal_
uIntPtr
SfxContentHelper
::
GetSize
(
const
String
&
rContent
)
sal_
Int64
SfxContentHelper
::
GetSize
(
const
String
&
rContent
)
{
sal_uIntPtr
nSize
=
0
;
sal_Int64
nTemp
=
0
;
sal_Int64
nSize
=
0
;
INetURLObject
aObj
(
rContent
);
DBG_ASSERT
(
aObj
.
GetProtocol
()
!=
INET_PROT_NOT_VALID
,
"Invalid URL!"
);
try
{
::
ucbhelper
::
Content
aCnt
(
aObj
.
GetMainURL
(
INetURLObject
::
NO_DECODE
),
uno
::
Reference
<
ucb
::
XCommandEnvironment
>
(),
comphelper
::
getProcessComponentContext
()
);
aCnt
.
getPropertyValue
(
"Size"
)
>>=
n
Temp
;
aCnt
.
getPropertyValue
(
"Size"
)
>>=
n
Size
;
}
catch
(
const
ucb
::
CommandAbortedException
&
)
{
...
...
@@ -302,7 +301,6 @@ sal_uIntPtr SfxContentHelper::GetSize( const String& rContent )
{
SAL_WARN
(
"sfx2.bastyp"
,
"Any other exception"
);
}
nSize
=
(
sal_uInt32
)
nTemp
;
return
nSize
;
}
...
...
sfx2/source/dialog/dinfdlg.cxx
Dosyayı görüntüle @
baa6a3b9
...
...
@@ -113,18 +113,18 @@ const sal_uInt16 HI_ACTION = 4;
static
const
char
DOCUMENT_SIGNATURE_MENU_CMD
[]
=
"Signature"
;
//------------------------------------------------------------------------
String
CreateSizeText
(
sal_uIntPtr
nSize
,
sal_Bool
bExtraBytes
=
sal_True
,
sal_Bool
bSmartExtraBytes
=
sal_False
);
String
CreateSizeText
(
sal_uIntPtr
nSize
,
sal_Bool
bExtraBytes
,
sal_Bool
bSmartExtraBytes
)
namespace
{
String
CreateSizeText
(
sal_Int64
nSize
)
{
String
aUnitStr
=
rtl
::
OUString
(
' '
);
aUnitStr
+=
SfxResId
(
STR_BYTES
).
toString
();
sal_
uIntPtr
nSize1
=
nSize
;
sal_
uIntPtr
nSize2
=
nSize1
;
sal_
uIntPtr
nMega
=
1024
*
1024
;
sal_
uIntPtr
nGiga
=
nMega
*
1024
;
sal_
Int64
nSize1
=
nSize
;
sal_
Int64
nSize2
=
nSize1
;
sal_
Int64
nMega
=
1024
*
1024
;
sal_
Int64
nGiga
=
nMega
*
1024
;
double
fSize
=
nSize
;
int
nDec
=
0
;
sal_Bool
bGB
=
sal_False
;
if
(
nSize1
>=
10000
&&
nSize1
<
nMega
)
{
...
...
@@ -147,7 +147,6 @@ String CreateSizeText( sal_uIntPtr nSize, sal_Bool bExtraBytes, sal_Bool bSmartE
nSize1
/=
nGiga
;
aUnitStr
=
' '
;
aUnitStr
+=
SfxResId
(
STR_GB
).
toString
();
bGB
=
sal_True
;
fSize
/=
nGiga
;
nDec
=
3
;
}
...
...
@@ -155,7 +154,7 @@ String CreateSizeText( sal_uIntPtr nSize, sal_Bool bExtraBytes, sal_Bool bSmartE
const
LocaleDataWrapper
&
rLocaleWrapper
=
aSysLocale
.
GetLocaleData
();
String
aSizeStr
(
rLocaleWrapper
.
getNum
(
nSize1
,
0
)
);
aSizeStr
+=
aUnitStr
;
if
(
bExtraBytes
&&
(
nSize1
<
nSize2
)
)
if
(
nSize1
<
nSize2
)
{
aSizeStr
=
::
rtl
::
math
::
doubleToUString
(
fSize
,
rtl_math_StringFormat_F
,
nDec
,
...
...
@@ -168,14 +167,6 @@ String CreateSizeText( sal_uIntPtr nSize, sal_Bool bExtraBytes, sal_Bool bSmartE
aSizeStr
+=
SfxResId
(
STR_BYTES
).
toString
();
aSizeStr
+=
')'
;
}
else
if
(
bGB
&&
bSmartExtraBytes
)
{
nSize1
=
nSize
/
nMega
;
aSizeStr
=
" ("
;
aSizeStr
+=
rLocaleWrapper
.
getNum
(
nSize1
,
0
);
aSizeStr
+=
aUnitStr
;
aSizeStr
+=
')'
;
}
return
aSizeStr
;
}
...
...
@@ -197,6 +188,7 @@ String ConvertDateTime_Impl( const String& rName,
return
aStr
;
}
}
//------------------------------------------------------------------------
SfxDocumentInfoItem
::
SfxDocumentInfoItem
()
...
...
sfx2/source/inc/helper.hxx
Dosyayı görüntüle @
baa6a3b9
...
...
@@ -34,10 +34,10 @@ public:
GetResultSet
(
const
String
&
rURL
);
static
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
rtl
::
OUString
>
GetHelpTreeViewContents
(
const
String
&
rURL
);
static
OUString
GetActiveHelpString
(
const
OUString
&
rURL
);
static
sal_Bool
IsHelpErrorDocument
(
const
OUString
&
rURL
);
static
OUString
GetActiveHelpString
(
const
OUString
&
rURL
);
static
sal_Bool
IsHelpErrorDocument
(
const
OUString
&
rURL
);
static
sal_
uIntPtr
GetSize
(
const
String
&
rContent
);
static
sal_
Int64
GetSize
(
const
String
&
rContent
);
};
#endif // #ifndef _SFX_HELPER_HXX
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment