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
7dae589b
Kaydet (Commit)
7dae589b
authored
Mar 01, 2017
tarafından
Tor Lillqvist
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Correct indentation of try block
Change-Id: I32ca961ebb4393e483bab12a6c69ab4c2016cc3f
üst
79d93c7d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
64 deletions
+65
-64
objstor.cxx
sfx2/source/doc/objstor.cxx
+65
-64
No files found.
sfx2/source/doc/objstor.cxx
Dosyayı görüntüle @
7dae589b
...
@@ -2200,84 +2200,85 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
...
@@ -2200,84 +2200,85 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
if
(
xLoader
.
is
()
)
if
(
xLoader
.
is
()
)
{
{
// it happens that xLoader does not support xImporter!
// it happens that xLoader does not support xImporter!
try
{
try
uno
::
Reference
<
lang
::
XComponent
>
xComp
(
GetModel
(),
uno
::
UNO_QUERY_THROW
);
{
uno
::
Reference
<
document
::
XImporter
>
xImporter
(
xLoader
,
uno
::
UNO_QUERY_THROW
);
uno
::
Reference
<
lang
::
XComponent
>
xComp
(
GetModel
(),
uno
::
UNO_QUERY_THROW
);
xImporter
->
setTargetDocument
(
xComp
);
uno
::
Reference
<
document
::
XImporter
>
xImporter
(
xLoader
,
uno
::
UNO_QUERY_THROW
);
xImporter
->
setTargetDocument
(
xComp
);
uno
::
Sequence
<
beans
::
PropertyValue
>
lDescriptor
;
uno
::
Sequence
<
beans
::
PropertyValue
>
lDescriptor
;
rMedium
.
GetItemSet
()
->
Put
(
SfxStringItem
(
SID_FILE_NAME
,
rMedium
.
GetName
()
)
);
rMedium
.
GetItemSet
()
->
Put
(
SfxStringItem
(
SID_FILE_NAME
,
rMedium
.
GetName
()
)
);
TransformItems
(
SID_OPENDOC
,
*
rMedium
.
GetItemSet
(),
lDescriptor
);
TransformItems
(
SID_OPENDOC
,
*
rMedium
.
GetItemSet
(),
lDescriptor
);
css
::
uno
::
Sequence
<
css
::
beans
::
PropertyValue
>
aArgs
(
lDescriptor
.
getLength
()
);
css
::
uno
::
Sequence
<
css
::
beans
::
PropertyValue
>
aArgs
(
lDescriptor
.
getLength
()
);
css
::
beans
::
PropertyValue
*
pNewValue
=
aArgs
.
getArray
();
css
::
beans
::
PropertyValue
*
pNewValue
=
aArgs
.
getArray
();
const
css
::
beans
::
PropertyValue
*
pOldValue
=
lDescriptor
.
getConstArray
();
const
css
::
beans
::
PropertyValue
*
pOldValue
=
lDescriptor
.
getConstArray
();
const
OUString
sInputStream
(
"InputStream"
);
const
OUString
sInputStream
(
"InputStream"
);
bool
bHasInputStream
=
false
;
bool
bHasInputStream
=
false
;
bool
bHasBaseURL
=
false
;
bool
bHasBaseURL
=
false
;
sal_Int32
i
;
sal_Int32
i
;
sal_Int32
nEnd
=
lDescriptor
.
getLength
();
sal_Int32
nEnd
=
lDescriptor
.
getLength
();
for
(
i
=
0
;
i
<
nEnd
;
i
++
)
for
(
i
=
0
;
i
<
nEnd
;
i
++
)
{
{
pNewValue
[
i
]
=
pOldValue
[
i
];
pNewValue
[
i
]
=
pOldValue
[
i
];
if
(
pOldValue
[
i
].
Name
==
sInputStream
)
if
(
pOldValue
[
i
].
Name
==
sInputStream
)
bHasInputStream
=
true
;
bHasInputStream
=
true
;
else
if
(
pOldValue
[
i
].
Name
==
"DocumentBaseURL"
)
else
if
(
pOldValue
[
i
].
Name
==
"DocumentBaseURL"
)
bHasBaseURL
=
true
;
bHasBaseURL
=
true
;
}
}
if
(
!
bHasInputStream
)
if
(
!
bHasInputStream
)
{
{
aArgs
.
realloc
(
++
nEnd
);
aArgs
.
realloc
(
++
nEnd
);
aArgs
[
nEnd
-
1
].
Name
=
sInputStream
;
aArgs
[
nEnd
-
1
].
Name
=
sInputStream
;
aArgs
[
nEnd
-
1
].
Value
<<=
css
::
uno
::
Reference
<
css
::
io
::
XInputStream
>
(
new
utl
::
OSeekableInputStreamWrapper
(
*
rMedium
.
GetInStream
()
)
);
aArgs
[
nEnd
-
1
].
Value
<<=
css
::
uno
::
Reference
<
css
::
io
::
XInputStream
>
(
new
utl
::
OSeekableInputStreamWrapper
(
*
rMedium
.
GetInStream
()
)
);
}
}
if
(
!
bHasBaseURL
)
if
(
!
bHasBaseURL
)
{
{
aArgs
.
realloc
(
++
nEnd
);
aArgs
.
realloc
(
++
nEnd
);
aArgs
[
nEnd
-
1
].
Name
=
"DocumentBaseURL"
;
aArgs
[
nEnd
-
1
].
Name
=
"DocumentBaseURL"
;
aArgs
[
nEnd
-
1
].
Value
<<=
rMedium
.
GetBaseURL
();
aArgs
[
nEnd
-
1
].
Value
<<=
rMedium
.
GetBaseURL
();
}
}
if
(
xInsertPosition
.
is
())
{
if
(
xInsertPosition
.
is
())
{
aArgs
.
realloc
(
++
nEnd
);
aArgs
.
realloc
(
++
nEnd
);
aArgs
[
nEnd
-
1
].
Name
=
"InsertMode"
;
aArgs
[
nEnd
-
1
].
Name
=
"InsertMode"
;
aArgs
[
nEnd
-
1
].
Value
<<=
true
;
aArgs
[
nEnd
-
1
].
Value
<<=
true
;
aArgs
.
realloc
(
++
nEnd
);
aArgs
.
realloc
(
++
nEnd
);
aArgs
[
nEnd
-
1
].
Name
=
"TextInsertModeRange"
;
aArgs
[
nEnd
-
1
].
Name
=
"TextInsertModeRange"
;
aArgs
[
nEnd
-
1
].
Value
<<=
xInsertPosition
;
aArgs
[
nEnd
-
1
].
Value
<<=
xInsertPosition
;
}
}
// #i119492# During loading, some OLE objects like chart will be set
// #i119492# During loading, some OLE objects like chart will be set
// modified flag, so needs to reset the flag to false after loading
// modified flag, so needs to reset the flag to false after loading
bool
bRtn
=
xLoader
->
filter
(
aArgs
);
bool
bRtn
=
xLoader
->
filter
(
aArgs
);
uno
::
Sequence
<
OUString
>
aNames
=
GetEmbeddedObjectContainer
().
GetObjectNames
();
uno
::
Sequence
<
OUString
>
aNames
=
GetEmbeddedObjectContainer
().
GetObjectNames
();
for
(
sal_Int32
n
=
0
;
n
<
aNames
.
getLength
();
++
n
)
for
(
sal_Int32
n
=
0
;
n
<
aNames
.
getLength
();
++
n
)
{
OUString
aName
=
aNames
[
n
];
uno
::
Reference
<
embed
::
XEmbeddedObject
>
xObj
=
GetEmbeddedObjectContainer
().
GetEmbeddedObject
(
aName
);
OSL_ENSURE
(
xObj
.
is
(),
"An empty entry in the embedded objects list!
\n
"
);
if
(
xObj
.
is
()
)
{
{
sal_Int32
nState
=
xObj
->
getCurrentState
();
OUString
aName
=
aNames
[
n
];
if
(
nState
==
embed
::
EmbedStates
::
LOADED
||
nState
==
embed
::
EmbedStates
::
RUNNING
)
// means that the object is not active
uno
::
Reference
<
embed
::
XEmbeddedObject
>
xObj
=
GetEmbeddedObjectContainer
().
GetEmbeddedObject
(
aName
);
OSL_ENSURE
(
xObj
.
is
(),
"An empty entry in the embedded objects list!
\n
"
);
if
(
xObj
.
is
()
)
{
{
uno
::
Reference
<
util
::
XModifiable
>
xModifiable
(
xObj
->
getComponent
(),
uno
::
UNO_QUERY
);
sal_Int32
nState
=
xObj
->
getCurrentState
(
);
if
(
xModifiable
.
is
()
&&
xModifiable
->
isModified
())
if
(
nState
==
embed
::
EmbedStates
::
LOADED
||
nState
==
embed
::
EmbedStates
::
RUNNING
)
// means that the object is not active
{
{
uno
::
Reference
<
embed
::
XEmbedPersist
>
const
xPers
(
xObj
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
util
::
XModifiable
>
xModifiable
(
xObj
->
getComponent
(),
uno
::
UNO_QUERY
);
assert
(
xPers
.
is
()
&&
"Modified object without persistence!"
);
if
(
xModifiable
.
is
()
&&
xModifiable
->
isModified
())
// store it before resetting modified!
{
xPers
->
storeOwn
();
uno
::
Reference
<
embed
::
XEmbedPersist
>
const
xPers
(
xObj
,
uno
::
UNO_QUERY
);
xModifiable
->
setModified
(
false
);
assert
(
xPers
.
is
()
&&
"Modified object without persistence!"
);
// store it before resetting modified!
xPers
->
storeOwn
();
xModifiable
->
setModified
(
false
);
}
}
}
}
}
}
}
}
return
bRtn
;
return
bRtn
;
}
}
catch
(
const
packages
::
zip
::
ZipIOException
&
)
catch
(
const
packages
::
zip
::
ZipIOException
&
)
{
{
...
...
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