summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2017-03-01 14:59:22 +0200
committerTor Lillqvist <tml@collabora.com>2017-03-01 15:00:09 +0200
commit7dae589b0cbb40bd3ee7831f0c140e05398faa47 (patch)
tree31559ef13df1974e6fad44d084453ee9982c303e /sfx2
parent79d93c7d1195cca3afcb0c5241efa458fddf5134 (diff)
Correct indentation of try block
Change-Id: I32ca961ebb4393e483bab12a6c69ab4c2016cc3f
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objstor.cxx129
1 files changed, 65 insertions, 64 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index b80e55125732..0e8f04e6a8fc 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2200,84 +2200,85 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
if ( xLoader.is() )
{
// it happens that xLoader does not support xImporter!
- try{
- uno::Reference< lang::XComponent > xComp( GetModel(), uno::UNO_QUERY_THROW );
- uno::Reference< document::XImporter > xImporter( xLoader, uno::UNO_QUERY_THROW );
- xImporter->setTargetDocument( xComp );
+ try
+ {
+ uno::Reference< lang::XComponent > xComp( GetModel(), uno::UNO_QUERY_THROW );
+ uno::Reference< document::XImporter > xImporter( xLoader, uno::UNO_QUERY_THROW );
+ xImporter->setTargetDocument( xComp );
- uno::Sequence < beans::PropertyValue > lDescriptor;
- rMedium.GetItemSet()->Put( SfxStringItem( SID_FILE_NAME, rMedium.GetName() ) );
- TransformItems( SID_OPENDOC, *rMedium.GetItemSet(), lDescriptor );
+ uno::Sequence < beans::PropertyValue > lDescriptor;
+ rMedium.GetItemSet()->Put( SfxStringItem( SID_FILE_NAME, rMedium.GetName() ) );
+ TransformItems( SID_OPENDOC, *rMedium.GetItemSet(), lDescriptor );
- css::uno::Sequence < css::beans::PropertyValue > aArgs ( lDescriptor.getLength() );
- css::beans::PropertyValue * pNewValue = aArgs.getArray();
- const css::beans::PropertyValue * pOldValue = lDescriptor.getConstArray();
- const OUString sInputStream ( "InputStream" );
+ css::uno::Sequence < css::beans::PropertyValue > aArgs ( lDescriptor.getLength() );
+ css::beans::PropertyValue * pNewValue = aArgs.getArray();
+ const css::beans::PropertyValue * pOldValue = lDescriptor.getConstArray();
+ const OUString sInputStream ( "InputStream" );
- bool bHasInputStream = false;
- bool bHasBaseURL = false;
- sal_Int32 i;
- sal_Int32 nEnd = lDescriptor.getLength();
+ bool bHasInputStream = false;
+ bool bHasBaseURL = false;
+ sal_Int32 i;
+ sal_Int32 nEnd = lDescriptor.getLength();
- for ( i = 0; i < nEnd; i++ )
- {
- pNewValue[i] = pOldValue[i];
- if ( pOldValue [i].Name == sInputStream )
- bHasInputStream = true;
- else if ( pOldValue[i].Name == "DocumentBaseURL" )
- bHasBaseURL = true;
- }
+ for ( i = 0; i < nEnd; i++ )
+ {
+ pNewValue[i] = pOldValue[i];
+ if ( pOldValue [i].Name == sInputStream )
+ bHasInputStream = true;
+ else if ( pOldValue[i].Name == "DocumentBaseURL" )
+ bHasBaseURL = true;
+ }
- if ( !bHasInputStream )
- {
- aArgs.realloc ( ++nEnd );
- aArgs[nEnd-1].Name = sInputStream;
- aArgs[nEnd-1].Value <<= css::uno::Reference < css::io::XInputStream > ( new utl::OSeekableInputStreamWrapper ( *rMedium.GetInStream() ) );
- }
+ if ( !bHasInputStream )
+ {
+ aArgs.realloc ( ++nEnd );
+ aArgs[nEnd-1].Name = sInputStream;
+ aArgs[nEnd-1].Value <<= css::uno::Reference < css::io::XInputStream > ( new utl::OSeekableInputStreamWrapper ( *rMedium.GetInStream() ) );
+ }
- if ( !bHasBaseURL )
- {
- aArgs.realloc ( ++nEnd );
- aArgs[nEnd-1].Name = "DocumentBaseURL";
- aArgs[nEnd-1].Value <<= rMedium.GetBaseURL();
- }
+ if ( !bHasBaseURL )
+ {
+ aArgs.realloc ( ++nEnd );
+ aArgs[nEnd-1].Name = "DocumentBaseURL";
+ aArgs[nEnd-1].Value <<= rMedium.GetBaseURL();
+ }
- if (xInsertPosition.is()) {
- aArgs.realloc( ++nEnd );
- aArgs[nEnd-1].Name = "InsertMode";
- aArgs[nEnd-1].Value <<= true;
- aArgs.realloc( ++nEnd );
- aArgs[nEnd-1].Name = "TextInsertModeRange";
- aArgs[nEnd-1].Value <<= xInsertPosition;
- }
+ if (xInsertPosition.is()) {
+ aArgs.realloc( ++nEnd );
+ aArgs[nEnd-1].Name = "InsertMode";
+ aArgs[nEnd-1].Value <<= true;
+ aArgs.realloc( ++nEnd );
+ aArgs[nEnd-1].Name = "TextInsertModeRange";
+ aArgs[nEnd-1].Value <<= xInsertPosition;
+ }
- // #i119492# During loading, some OLE objects like chart will be set
- // modified flag, so needs to reset the flag to false after loading
- bool bRtn = xLoader->filter( aArgs );
- uno::Sequence < OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames();
- 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() )
+ // #i119492# During loading, some OLE objects like chart will be set
+ // modified flag, so needs to reset the flag to false after loading
+ bool bRtn = xLoader->filter( aArgs );
+ uno::Sequence < OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames();
+ for ( sal_Int32 n = 0; n < aNames.getLength(); ++n )
{
- sal_Int32 nState = xObj->getCurrentState();
- if ( nState == embed::EmbedStates::LOADED || nState == embed::EmbedStates::RUNNING ) // means that the object is not active
+ 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() )
{
- uno::Reference< util::XModifiable > xModifiable( xObj->getComponent(), uno::UNO_QUERY );
- if (xModifiable.is() && xModifiable->isModified())
+ sal_Int32 nState = xObj->getCurrentState();
+ 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);
- assert(xPers.is() && "Modified object without persistence!");
- // store it before resetting modified!
- xPers->storeOwn();
- xModifiable->setModified(false);
+ uno::Reference< util::XModifiable > xModifiable( xObj->getComponent(), uno::UNO_QUERY );
+ if (xModifiable.is() && xModifiable->isModified())
+ {
+ uno::Reference<embed::XEmbedPersist> const xPers(xObj, uno::UNO_QUERY);
+ 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&)
{