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
23ad78fe
Kaydet (Commit)
23ad78fe
authored
Haz 10, 2012
tarafından
Ariel Constenla-Haile
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
i119411 - Read/write RDF support on ODS file format
Patch by: Tsutomu Uchino Review by: arielch
üst
655eace2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
1 deletion
+68
-1
scerrors.hxx
sc/inc/scerrors.hxx
+1
-0
xmlwrap.cxx
sc/source/filter/xml/xmlwrap.cxx
+63
-1
scerrors.src
sc/source/ui/src/scerrors.src
+4
-0
No files found.
sc/inc/scerrors.hxx
Dosyayı görüntüle @
23ad78fe
...
...
@@ -58,6 +58,7 @@
#define SCWARN_IMPORT_ROW_OVERFLOW ( 2 | ERRCODE_CLASS_IMPORT | ERRCODE_WARNING_MASK | ERRCODE_AREA_SC )
#define SCWARN_IMPORT_COLUMN_OVERFLOW ( 3 | ERRCODE_CLASS_IMPORT | ERRCODE_WARNING_MASK | ERRCODE_AREA_SC )
#define SCWARN_IMPORT_SHEET_OVERFLOW ( 4 | ERRCODE_CLASS_IMPORT | ERRCODE_WARNING_MASK | ERRCODE_AREA_SC )
#define SCWARN_IMPORT_FEATURES_LOST ( 5 | ERRCODE_CLASS_IMPORT | ERRCODE_WARNING_MASK | ERRCODE_AREA_SC )
// ERRCODE_CLASS_EXPORT - does not display "Write-Error" in MsgBox
#define SCWARN_EXPORT_NONCONVERTIBLE_CHARS ( 1 | ERRCODE_CLASS_EXPORT | ERRCODE_WARNING_MASK | ERRCODE_AREA_SC )
...
...
sc/source/filter/xml/xmlwrap.cxx
Dosyayı görüntüle @
23ad78fe
...
...
@@ -62,7 +62,12 @@
#include <com/sun/star/packages/zip/ZipIOException.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/script/vba/XVBACompatibility.hpp>
#include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
#include <sfx2/DocumentMetadataAccess.hxx>
#include <comphelper/componentcontext.hxx>
#include <comphelper/documentconstants.hxx>
#include <svx/xmleohlp.hxx>
#include <rtl/logfile.hxx>
#include <unotools/saveopt.hxx>
...
...
@@ -466,9 +471,9 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
xInfoSet
->
setPropertyValue
(
sPropName
,
uno
::
makeAny
(
aBaseURL
)
);
// TODO/LATER: do not do it for embedded links
OUString
aName
;
if
(
SFX_CREATE_MODE_EMBEDDED
==
pObjSh
->
GetCreateMode
()
)
{
OUString
aName
;
if
(
pMedium
&&
pMedium
->
GetItemSet
()
)
{
const
SfxStringItem
*
pDocHierarchItem
=
static_cast
<
const
SfxStringItem
*>
(
...
...
@@ -495,6 +500,38 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError)
sal_Bool
bOasis
=
(
SotStorage
::
GetVersion
(
xStorage
)
>
SOFFICE_FILEFORMAT_60
);
if
(
!
bStylesOnly
&&
bOasis
)
{
// RDF metadata: ODF >= 1.2
try
{
::
comphelper
::
ComponentContext
aContext
(
xServiceFactory
);
const
uno
::
Reference
<
rdf
::
XDocumentMetadataAccess
>
xDMA
(
xModel
,
uno
::
UNO_QUERY_THROW
);
const
uno
::
Reference
<
rdf
::
XURI
>
xBaseURI
(
::
sfx2
::
createBaseURI
(
aContext
.
getUNOContext
(),
xStorage
,
aBaseURL
,
aName
)
);
const
uno
::
Reference
<
task
::
XInteractionHandler
>
xHandler
(
pObjSh
->
GetMedium
()
->
GetInteractionHandler
()
);
xDMA
->
loadMetadataFromStorage
(
xStorage
,
xBaseURI
,
xHandler
);
}
catch
(
lang
::
WrappedTargetException
&
e
)
{
ucb
::
InteractiveAugmentedIOException
iaioe
;
if
(
e
.
TargetException
>>=
iaioe
)
{
nError
=
SCERR_IMPORT_UNKNOWN
;
}
else
{
nError
=
SCWARN_IMPORT_FEATURES_LOST
;
}
}
catch
(
uno
::
Exception
&
)
{
nError
=
SCWARN_IMPORT_FEATURES_LOST
;
}
}
// #i103539#: always read meta.xml for generator
sal_uInt32
nMetaRetval
(
0
);
uno
::
Sequence
<
uno
::
Any
>
aMetaArgs
(
1
);
...
...
@@ -917,6 +954,31 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly)
sal_Bool
bOasis
=
(
SotStorage
::
GetVersion
(
xStorage
)
>
SOFFICE_FILEFORMAT_60
);
// RDF metadata: ODF >= 1.2
if
(
!
bStylesOnly
&&
bOasis
)
{
const
uno
::
Reference
<
beans
::
XPropertySet
>
xPropSet
(
xStorage
,
uno
::
UNO_QUERY_THROW
);
try
{
::
rtl
::
OUString
aVersion
;
if
((
xPropSet
->
getPropertyValue
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"Version"
)))
>>=
aVersion
)
&&
!
aVersion
.
equals
(
ODFVER_010_TEXT
)
&&
!
aVersion
.
equals
(
ODFVER_011_TEXT
)
)
{
const
uno
::
Reference
<
rdf
::
XDocumentMetadataAccess
>
xDMA
(
xModel
,
uno
::
UNO_QUERY_THROW
);
xDMA
->
storeMetadataToStorage
(
xStorage
);
}
}
catch
(
beans
::
UnknownPropertyException
&
)
{
}
catch
(
uno
::
Exception
&
)
{
}
}
// meta export
if
(
!
bStylesOnly
&&
!
bMetaRet
)
{
...
...
sc/source/ui/src/scerrors.src
Dosyayı görüntüle @
23ad78fe
...
...
@@ -162,5 +162,9 @@ Resource RID_ERRHDLSC
{
Text [ en-US ] = "Format error discovered in the file in sub-document $(ARG1) at $(ARG2)(row,col).";
};
String SCWARN_IMPORT_FEATURES_LOST & ERRCODE_RES_MASK
{
Text [ en-US] = "Not all attributes could be read." ;
};
};
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