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
f511fee1
Kaydet (Commit)
f511fee1
authored
Agu 11, 2011
tarafından
Luboš Luňák
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
adjust for timezone when reading datetime
üst
593ae387
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
8 deletions
+45
-8
DomainMapper_Impl.cxx
writerfilter/source/dmapper/DomainMapper_Impl.cxx
+45
-8
No files found.
writerfilter/source/dmapper/DomainMapper_Impl.cxx
Dosyayı görüntüle @
f511fee1
...
...
@@ -74,6 +74,7 @@
#include <rtl/string.h>
#include "FieldTypes.hxx"
#include <tools/datetime.hxx>
#include <tools/string.hxx>
#ifdef DEBUG_DOMAINMAPPER
#include <resourcemodel/QNameToString.hxx>
...
...
@@ -966,24 +967,60 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
util
::
DateTime
lcl_DateStringToDateTime
(
const
::
rtl
::
OUString
&
rDateTime
)
{
util
::
DateTime
aDateTime
;
DateTime
aDateTime
;
//xsd::DateTime in the format [-]CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm] example: 2008-01-21T10:42:00Z
//OUString getToken( sal_Int32 token, sal_Unicode cTok, sal_Int32& index ) const SAL_THROW(())
sal_Int32
nIndex
=
0
;
::
rtl
::
OUString
sDate
=
rDateTime
.
getToken
(
0
,
'T'
,
nIndex
);
::
rtl
::
OUString
sTime
=
rDateTime
.
getToken
(
0
,
'Z'
,
nIndex
);
int
timezonepos
=
nIndex
;
nIndex
=
0
;
aDateTime
.
Year
=
sal_uInt16
(
sDate
.
getToken
(
0
,
'-'
,
nIndex
).
toInt32
()
);
aDateTime
.
Month
=
sal_uInt16
(
sDate
.
getToken
(
0
,
'-'
,
nIndex
).
toInt32
()
);
aDateTime
.
Day
=
sal_uInt16
(
sDate
.
copy
(
nIndex
).
toInt32
()
);
aDateTime
.
SetYear
(
sDate
.
getToken
(
0
,
'-'
,
nIndex
).
toInt32
()
);
aDateTime
.
SetMonth
(
sDate
.
getToken
(
0
,
'-'
,
nIndex
).
toInt32
()
);
aDateTime
.
SetDay
(
sDate
.
copy
(
nIndex
).
toInt32
()
);
nIndex
=
0
;
aDateTime
.
Hours
=
sal_uInt16
(
sTime
.
getToken
(
0
,
':'
,
nIndex
).
toInt32
()
);
aDateTime
.
Minutes
=
sal_uInt16
(
sTime
.
getToken
(
0
,
':'
,
nIndex
).
toInt32
()
);
aDateTime
.
Se
conds
=
sal_uInt16
(
sTime
.
copy
(
nIndex
).
toInt32
()
);
aDateTime
.
SetHour
(
sTime
.
getToken
(
0
,
':'
,
nIndex
).
toInt32
()
);
aDateTime
.
SetMin
(
sTime
.
getToken
(
0
,
':'
,
nIndex
).
toInt32
()
);
aDateTime
.
Se
tSec
(
sTime
.
copy
(
nIndex
).
toInt32
()
);
return
aDateTime
;
if
(
timezonepos
>=
0
)
// otherwise consider it local time
{
bool
negative
=
false
;
nIndex
=
timezonepos
;
if
(
nIndex
<
rDateTime
.
getLength
()
&&
rDateTime
[
nIndex
]
==
'-'
)
{
negative
=
true
;
++
nIndex
;
}
else
if
(
nIndex
<
rDateTime
.
getLength
()
&&
rDateTime
[
nIndex
]
==
'+'
)
{
++
nIndex
;
}
Time
diff
(
0
,
0
,
0
);
if
(
nIndex
<
rDateTime
.
getLength
())
{
diff
.
SetHour
(
rDateTime
.
getToken
(
0
,
':'
,
nIndex
).
toInt32
());
diff
.
SetMin
(
rDateTime
.
getToken
(
0
,
':'
,
nIndex
).
toInt32
());
}
// convert to utc, then to local
if
(
negative
)
aDateTime
-=
diff
;
else
aDateTime
+=
diff
;
aDateTime
.
ConvertToLocalTime
();
}
util
::
DateTime
ret
;
ret
.
Year
=
aDateTime
.
GetYear
();
ret
.
Month
=
aDateTime
.
GetMonth
();
ret
.
Day
=
aDateTime
.
GetDay
();
ret
.
Hours
=
aDateTime
.
GetHour
();
ret
.
Minutes
=
aDateTime
.
GetMin
();
ret
.
Seconds
=
aDateTime
.
GetSec
();
ret
.
HundredthSeconds
=
0
;
return
ret
;
}
void
DomainMapper_Impl
::
appendTextPortion
(
const
::
rtl
::
OUString
&
rString
,
PropertyMapPtr
pPropertyMap
)
{
uno
::
Reference
<
text
::
XTextAppend
>
xTextAppend
=
m_aTextAppendStack
.
top
().
xTextAppend
;
...
...
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