summaryrefslogtreecommitdiff
path: root/sfx2/source/bastyp
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-02-06 10:09:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-02-07 08:19:14 +0100
commit536a6d6ca67d01c8470c242c6f1fd0750496eed4 (patch)
treecc2aed75621456aaeb31d26e910cc61baf3bfdd7 /sfx2/source/bastyp
parent53a318196859140deb4b3c317db583a90cfd604c (diff)
loplugin:flatten in sfx2
Change-Id: If4e07d497ead58a2ff58b5fdedd282b8784be421 Reviewed-on: https://gerrit.libreoffice.org/67435 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/bastyp')
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx316
-rw-r--r--sfx2/source/bastyp/frmhtmlw.cxx158
-rw-r--r--sfx2/source/bastyp/progress.cxx88
-rw-r--r--sfx2/source/bastyp/sfxhtml.cxx62
4 files changed, 312 insertions, 312 deletions
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 062c969f0bc9..a17f43929ab5 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -902,189 +902,189 @@ void SfxFilterContainer::ReadSingleFilter_Impl(
aResult = uno::Any();
}
- if( aResult >>= lFilterProperties )
+ if( !(aResult >>= lFilterProperties) )
+ return;
+
+ // collect information to add filter to container
+ // (attention: some information aren't available on filter directly ... you must search for corresponding type too!)
+ SfxFilterFlags nFlags = SfxFilterFlags::NONE;
+ SotClipboardFormatId nClipboardId = SotClipboardFormatId::NONE;
+ sal_Int32 nDocumentIconId = 0 ;
+ sal_Int32 nFormatVersion = 0 ;
+ OUString sMimeType ;
+ OUString sType ;
+ OUString sUIName ;
+ OUString sHumanName ;
+ OUString sDefaultTemplate ;
+ OUString sUserData ;
+ OUString sExtension ;
+ OUString sPattern ;
+ OUString sServiceName ;
+ bool bEnabled = true ;
+
+ // first get directly available properties
+ sal_Int32 nFilterPropertyCount = lFilterProperties.getLength();
+ sal_Int32 nFilterProperty = 0 ;
+ for( nFilterProperty=0; nFilterProperty<nFilterPropertyCount; ++nFilterProperty )
{
- // collect information to add filter to container
- // (attention: some information aren't available on filter directly ... you must search for corresponding type too!)
- SfxFilterFlags nFlags = SfxFilterFlags::NONE;
- SotClipboardFormatId nClipboardId = SotClipboardFormatId::NONE;
- sal_Int32 nDocumentIconId = 0 ;
- sal_Int32 nFormatVersion = 0 ;
- OUString sMimeType ;
- OUString sType ;
- OUString sUIName ;
- OUString sHumanName ;
- OUString sDefaultTemplate ;
- OUString sUserData ;
- OUString sExtension ;
- OUString sPattern ;
- OUString sServiceName ;
- bool bEnabled = true ;
-
- // first get directly available properties
- sal_Int32 nFilterPropertyCount = lFilterProperties.getLength();
- sal_Int32 nFilterProperty = 0 ;
- for( nFilterProperty=0; nFilterProperty<nFilterPropertyCount; ++nFilterProperty )
+ if ( lFilterProperties[nFilterProperty].Name == "FileFormatVersion" )
{
- if ( lFilterProperties[nFilterProperty].Name == "FileFormatVersion" )
- {
- lFilterProperties[nFilterProperty].Value >>= nFormatVersion;
- }
- else if ( lFilterProperties[nFilterProperty].Name == "TemplateName" )
- {
- lFilterProperties[nFilterProperty].Value >>= sDefaultTemplate;
- }
- else if ( lFilterProperties[nFilterProperty].Name == "Flags" )
- {
- sal_Int32 nTmp(0);
- lFilterProperties[nFilterProperty].Value >>= nTmp;
- assert((nTmp & ~o3tl::typed_flags<SfxFilterFlags>::mask) == 0);
- nFlags = static_cast<SfxFilterFlags>(nTmp);
- }
- else if ( lFilterProperties[nFilterProperty].Name == "UIName" )
- {
- lFilterProperties[nFilterProperty].Value >>= sUIName;
- }
- else if ( lFilterProperties[nFilterProperty].Name == "UserData" )
- {
- uno::Sequence< OUString > lUserData;
- lFilterProperties[nFilterProperty].Value >>= lUserData;
- sUserData = implc_convertStringlistToString( lUserData, ',', OUString() );
- }
- else if ( lFilterProperties[nFilterProperty].Name == "DocumentService" )
+ lFilterProperties[nFilterProperty].Value >>= nFormatVersion;
+ }
+ else if ( lFilterProperties[nFilterProperty].Name == "TemplateName" )
+ {
+ lFilterProperties[nFilterProperty].Value >>= sDefaultTemplate;
+ }
+ else if ( lFilterProperties[nFilterProperty].Name == "Flags" )
+ {
+ sal_Int32 nTmp(0);
+ lFilterProperties[nFilterProperty].Value >>= nTmp;
+ assert((nTmp & ~o3tl::typed_flags<SfxFilterFlags>::mask) == 0);
+ nFlags = static_cast<SfxFilterFlags>(nTmp);
+ }
+ else if ( lFilterProperties[nFilterProperty].Name == "UIName" )
+ {
+ lFilterProperties[nFilterProperty].Value >>= sUIName;
+ }
+ else if ( lFilterProperties[nFilterProperty].Name == "UserData" )
+ {
+ uno::Sequence< OUString > lUserData;
+ lFilterProperties[nFilterProperty].Value >>= lUserData;
+ sUserData = implc_convertStringlistToString( lUserData, ',', OUString() );
+ }
+ else if ( lFilterProperties[nFilterProperty].Name == "DocumentService" )
+ {
+ lFilterProperties[nFilterProperty].Value >>= sServiceName;
+ }
+ else if (lFilterProperties[nFilterProperty].Name == "ExportExtension")
+ {
+ // Extension preferred by the filter. This takes precedence
+ // over those that are given in the file format type.
+ lFilterProperties[nFilterProperty].Value >>= sExtension;
+ sExtension = "*." + sExtension;
+ }
+ else if ( lFilterProperties[nFilterProperty].Name == "Type" )
+ {
+ lFilterProperties[nFilterProperty].Value >>= sType;
+ // Try to get filter .. but look for any exceptions!
+ // May be filter was deleted by another thread ...
+ try
{
- lFilterProperties[nFilterProperty].Value >>= sServiceName;
+ aResult = xTypeCFG->getByName( sType );
}
- else if (lFilterProperties[nFilterProperty].Name == "ExportExtension")
+ catch (const container::NoSuchElementException&)
{
- // Extension preferred by the filter. This takes precedence
- // over those that are given in the file format type.
- lFilterProperties[nFilterProperty].Value >>= sExtension;
- sExtension = "*." + sExtension;
+ aResult = uno::Any();
}
- else if ( lFilterProperties[nFilterProperty].Name == "Type" )
- {
- lFilterProperties[nFilterProperty].Value >>= sType;
- // Try to get filter .. but look for any exceptions!
- // May be filter was deleted by another thread ...
- try
- {
- aResult = xTypeCFG->getByName( sType );
- }
- catch (const container::NoSuchElementException&)
- {
- aResult = uno::Any();
- }
- uno::Sequence< beans::PropertyValue > lTypeProperties;
- if( aResult >>= lTypeProperties )
+ uno::Sequence< beans::PropertyValue > lTypeProperties;
+ if( aResult >>= lTypeProperties )
+ {
+ // get indirect available properties then (types)
+ sal_Int32 nTypePropertyCount = lTypeProperties.getLength();
+ sal_Int32 nTypeProperty = 0 ;
+ for( nTypeProperty=0; nTypeProperty<nTypePropertyCount; ++nTypeProperty )
{
- // get indirect available properties then (types)
- sal_Int32 nTypePropertyCount = lTypeProperties.getLength();
- sal_Int32 nTypeProperty = 0 ;
- for( nTypeProperty=0; nTypeProperty<nTypePropertyCount; ++nTypeProperty )
+ if ( lTypeProperties[nTypeProperty].Name == "ClipboardFormat" )
{
- if ( lTypeProperties[nTypeProperty].Name == "ClipboardFormat" )
- {
- lTypeProperties[nTypeProperty].Value >>= sHumanName;
- }
- else if ( lTypeProperties[nTypeProperty].Name == "DocumentIconID" )
- {
- lTypeProperties[nTypeProperty].Value >>= nDocumentIconId;
- }
- else if ( lTypeProperties[nTypeProperty].Name == "MediaType" )
- {
- lTypeProperties[nTypeProperty].Value >>= sMimeType;
- }
- else if ( lTypeProperties[nTypeProperty].Name == "Extensions" )
- {
- if (sExtension.isEmpty())
- {
- uno::Sequence< OUString > lExtensions;
- lTypeProperties[nTypeProperty].Value >>= lExtensions;
- sExtension = implc_convertStringlistToString( lExtensions, ';', "*." );
- }
- }
- else if ( lTypeProperties[nTypeProperty].Name == "URLPattern" )
+ lTypeProperties[nTypeProperty].Value >>= sHumanName;
+ }
+ else if ( lTypeProperties[nTypeProperty].Name == "DocumentIconID" )
+ {
+ lTypeProperties[nTypeProperty].Value >>= nDocumentIconId;
+ }
+ else if ( lTypeProperties[nTypeProperty].Name == "MediaType" )
+ {
+ lTypeProperties[nTypeProperty].Value >>= sMimeType;
+ }
+ else if ( lTypeProperties[nTypeProperty].Name == "Extensions" )
+ {
+ if (sExtension.isEmpty())
{
- uno::Sequence< OUString > lPattern;
- lTypeProperties[nTypeProperty].Value >>= lPattern;
- sPattern = implc_convertStringlistToString( lPattern, ';', OUString() );
+ uno::Sequence< OUString > lExtensions;
+ lTypeProperties[nTypeProperty].Value >>= lExtensions;
+ sExtension = implc_convertStringlistToString( lExtensions, ';', "*." );
}
}
+ else if ( lTypeProperties[nTypeProperty].Name == "URLPattern" )
+ {
+ uno::Sequence< OUString > lPattern;
+ lTypeProperties[nTypeProperty].Value >>= lPattern;
+ sPattern = implc_convertStringlistToString( lPattern, ';', OUString() );
+ }
}
}
- else if ( lFilterProperties[nFilterProperty].Name == "Enabled" )
- {
- lFilterProperties[nFilterProperty].Value >>= bEnabled;
- }
-
+ }
+ else if ( lFilterProperties[nFilterProperty].Name == "Enabled" )
+ {
+ lFilterProperties[nFilterProperty].Value >>= bEnabled;
}
- if ( sServiceName.isEmpty() )
- return;
+ }
- // old formats are found ... using HumanPresentableName!
- if( !sHumanName.isEmpty() )
- {
- nClipboardId = SotExchange::RegisterFormatName( sHumanName );
+ if ( sServiceName.isEmpty() )
+ return;
- // For external filters ignore clipboard IDs
- if(nFlags & SfxFilterFlags::STARONEFILTER)
- {
- nClipboardId = SotClipboardFormatId::NONE;
- }
- }
- // register SfxFilter
- // first erase module name from old filter names!
- // e.g: "scalc: DIF" => "DIF"
- sal_Int32 nStartRealName = sFilterName.indexOf( ": " );
- if( nStartRealName != -1 )
- {
- SAL_WARN( "sfx.bastyp", "Old format, not supported!");
- sFilterName = sFilterName.copy( nStartRealName+2 );
- }
+ // old formats are found ... using HumanPresentableName!
+ if( !sHumanName.isEmpty() )
+ {
+ nClipboardId = SotExchange::RegisterFormatName( sHumanName );
- std::shared_ptr<const SfxFilter> pFilter = bUpdate ? SfxFilter::GetFilterByName( sFilterName ) : nullptr;
- if (!pFilter)
- {
- pFilter.reset(new SfxFilter( sFilterName ,
- sExtension ,
- nFlags ,
- nClipboardId ,
- sType ,
- sMimeType ,
- sUserData ,
- sServiceName ,
- bEnabled ));
- rList.push_back( pFilter );
- }
- else
+ // For external filters ignore clipboard IDs
+ if(nFlags & SfxFilterFlags::STARONEFILTER)
{
- SfxFilter* pFilt = const_cast<SfxFilter*>(pFilter.get());
- pFilt->maFilterName = sFilterName;
- pFilt->aWildCard = WildCard(sExtension, ';');
- pFilt->nFormatType = nFlags;
- pFilt->lFormat = nClipboardId;
- pFilt->aTypeName = sType;
- pFilt->aMimeType = sMimeType;
- pFilt->aUserData = sUserData;
- pFilt->aServiceName = sServiceName;
- pFilt->mbEnabled = bEnabled;
+ nClipboardId = SotClipboardFormatId::NONE;
}
+ }
+ // register SfxFilter
+ // first erase module name from old filter names!
+ // e.g: "scalc: DIF" => "DIF"
+ sal_Int32 nStartRealName = sFilterName.indexOf( ": " );
+ if( nStartRealName != -1 )
+ {
+ SAL_WARN( "sfx.bastyp", "Old format, not supported!");
+ sFilterName = sFilterName.copy( nStartRealName+2 );
+ }
+ std::shared_ptr<const SfxFilter> pFilter = bUpdate ? SfxFilter::GetFilterByName( sFilterName ) : nullptr;
+ if (!pFilter)
+ {
+ pFilter.reset(new SfxFilter( sFilterName ,
+ sExtension ,
+ nFlags ,
+ nClipboardId ,
+ sType ,
+ sMimeType ,
+ sUserData ,
+ sServiceName ,
+ bEnabled ));
+ rList.push_back( pFilter );
+ }
+ else
+ {
SfxFilter* pFilt = const_cast<SfxFilter*>(pFilter.get());
+ pFilt->maFilterName = sFilterName;
+ pFilt->aWildCard = WildCard(sExtension, ';');
+ pFilt->nFormatType = nFlags;
+ pFilt->lFormat = nClipboardId;
+ pFilt->aTypeName = sType;
+ pFilt->aMimeType = sMimeType;
+ pFilt->aUserData = sUserData;
+ pFilt->aServiceName = sServiceName;
+ pFilt->mbEnabled = bEnabled;
+ }
- // Don't forget to set right UIName!
- // Otherwise internal name is used as fallback ...
- pFilt->SetUIName( sUIName );
- pFilt->SetDefaultTemplate( sDefaultTemplate );
- if( nFormatVersion )
- {
- pFilt->SetVersion( nFormatVersion );
- }
- pFilt->SetURLPattern(sPattern);
+ SfxFilter* pFilt = const_cast<SfxFilter*>(pFilter.get());
+
+ // Don't forget to set right UIName!
+ // Otherwise internal name is used as fallback ...
+ pFilt->SetUIName( sUIName );
+ pFilt->SetDefaultTemplate( sDefaultTemplate );
+ if( nFormatVersion )
+ {
+ pFilt->SetVersion( nFormatVersion );
}
+ pFilt->SetURLPattern(sPattern);
}
void SfxFilterContainer::ReadFilters_Impl( bool bUpdate )
diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx
index 327cd406f7d6..f5ba6bcf4b50 100644
--- a/sfx2/source/bastyp/frmhtmlw.cxx
+++ b/sfx2/source/bastyp/frmhtmlw.cxx
@@ -133,100 +133,100 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL,
sGenerator = sGenerator.replaceFirst( "%1", os );
OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_generator, sGenerator, false, eDestEnc, pNonConvertableChars );
- if( i_xDocProps.is() )
+ if( !i_xDocProps.is() )
+ return;
+
+ // Reload
+ if( (i_xDocProps->getAutoloadSecs() != 0) ||
+ !i_xDocProps->getAutoloadURL().isEmpty() )
{
- // Reload
- if( (i_xDocProps->getAutoloadSecs() != 0) ||
- !i_xDocProps->getAutoloadURL().isEmpty() )
+ OUString sContent = OUString::number(
+ i_xDocProps->getAutoloadSecs() );
+
+ const OUString &rReloadURL = i_xDocProps->getAutoloadURL();
+ if( !rReloadURL.isEmpty() )
{
- OUString sContent = OUString::number(
- i_xDocProps->getAutoloadSecs() );
+ sContent += ";URL=";
+ sContent += URIHelper::simpleNormalizedMakeRelative(
+ rBaseURL, rReloadURL);
+ }
- const OUString &rReloadURL = i_xDocProps->getAutoloadURL();
- if( !rReloadURL.isEmpty() )
- {
- sContent += ";URL=";
- sContent += URIHelper::simpleNormalizedMakeRelative(
- rBaseURL, rReloadURL);
- }
+ OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_refresh, sContent, true,
+ eDestEnc, pNonConvertableChars );
+ }
- OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_refresh, sContent, true,
- eDestEnc, pNonConvertableChars );
- }
+ // Author
+ const OUString& rAuthor = i_xDocProps->getAuthor();
+ if( !rAuthor.isEmpty() )
+ OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_author, rAuthor, false,
+ eDestEnc, pNonConvertableChars );
- // Author
- const OUString& rAuthor = i_xDocProps->getAuthor();
- if( !rAuthor.isEmpty() )
- OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_author, rAuthor, false,
- eDestEnc, pNonConvertableChars );
+ // created
+ ::util::DateTime uDT = i_xDocProps->getCreationDate();
+ OUStringBuffer aBuffer;
+ ::sax::Converter::convertTimeOrDateTime(aBuffer, uDT);
- // created
- ::util::DateTime uDT = i_xDocProps->getCreationDate();
- OUStringBuffer aBuffer;
- ::sax::Converter::convertTimeOrDateTime(aBuffer, uDT);
+ OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_created, aBuffer.makeStringAndClear(), false,
+ eDestEnc, pNonConvertableChars );
- OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_created, aBuffer.makeStringAndClear(), false,
+ // changedby
+ const OUString& rChangedBy = i_xDocProps->getModifiedBy();
+ if( !rChangedBy.isEmpty() )
+ OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_changedby, rChangedBy, false,
eDestEnc, pNonConvertableChars );
- // changedby
- const OUString& rChangedBy = i_xDocProps->getModifiedBy();
- if( !rChangedBy.isEmpty() )
- OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_changedby, rChangedBy, false,
- eDestEnc, pNonConvertableChars );
+ // changed
+ uDT = i_xDocProps->getModificationDate();
+ ::sax::Converter::convertTimeOrDateTime(aBuffer, uDT);
- // changed
- uDT = i_xDocProps->getModificationDate();
- ::sax::Converter::convertTimeOrDateTime(aBuffer, uDT);
+ OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_changed, aBuffer.makeStringAndClear(), false,
+ eDestEnc, pNonConvertableChars );
- OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_changed, aBuffer.makeStringAndClear(), false,
+ // Subject
+ const OUString& rTheme = i_xDocProps->getSubject();
+ if( !rTheme.isEmpty() )
+ OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_classification, rTheme, false,
eDestEnc, pNonConvertableChars );
- // Subject
- const OUString& rTheme = i_xDocProps->getSubject();
- if( !rTheme.isEmpty() )
- OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_classification, rTheme, false,
+ // Description
+ const OUString& rComment = i_xDocProps->getDescription();
+ if( !rComment.isEmpty() )
+ OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_description, rComment, false,
+ eDestEnc, pNonConvertableChars);
+
+ // Keywords
+ OUString Keywords = ::comphelper::string::convertCommaSeparated(
+ i_xDocProps->getKeywords());
+ if( !Keywords.isEmpty() )
+ OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_keywords, Keywords, false,
+ eDestEnc, pNonConvertableChars);
+
+ uno::Reference < script::XTypeConverter > xConverter( script::Converter::create(
+ ::comphelper::getProcessComponentContext() ) );
+ uno::Reference<beans::XPropertySet> xUserDefinedProps(
+ i_xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW);
+ uno::Reference<beans::XPropertySetInfo> xPropInfo =
+ xUserDefinedProps->getPropertySetInfo();
+ DBG_ASSERT(xPropInfo.is(), "UserDefinedProperties Info is null");
+ uno::Sequence<beans::Property> props = xPropInfo->getProperties();
+ for (sal_Int32 i = 0; i < props.getLength(); ++i)
+ {
+ try
+ {
+ OUString name = props[i].Name;
+ uno::Any aStr = xConverter->convertToSimpleType(
+ xUserDefinedProps->getPropertyValue(name),
+ uno::TypeClass_STRING);
+ OUString str;
+ aStr >>= str;
+ OUString valstr(comphelper::string::stripEnd(str, ' '));
+ OutMeta( rStrm, pIndent, name, valstr, false,
eDestEnc, pNonConvertableChars );
-
- // Description
- const OUString& rComment = i_xDocProps->getDescription();
- if( !rComment.isEmpty() )
- OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_description, rComment, false,
- eDestEnc, pNonConvertableChars);
-
- // Keywords
- OUString Keywords = ::comphelper::string::convertCommaSeparated(
- i_xDocProps->getKeywords());
- if( !Keywords.isEmpty() )
- OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_keywords, Keywords, false,
- eDestEnc, pNonConvertableChars);
-
- uno::Reference < script::XTypeConverter > xConverter( script::Converter::create(
- ::comphelper::getProcessComponentContext() ) );
- uno::Reference<beans::XPropertySet> xUserDefinedProps(
- i_xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW);
- uno::Reference<beans::XPropertySetInfo> xPropInfo =
- xUserDefinedProps->getPropertySetInfo();
- DBG_ASSERT(xPropInfo.is(), "UserDefinedProperties Info is null");
- uno::Sequence<beans::Property> props = xPropInfo->getProperties();
- for (sal_Int32 i = 0; i < props.getLength(); ++i)
+ }
+ catch (const uno::Exception&)
{
- try
- {
- OUString name = props[i].Name;
- uno::Any aStr = xConverter->convertToSimpleType(
- xUserDefinedProps->getPropertyValue(name),
- uno::TypeClass_STRING);
- OUString str;
- aStr >>= str;
- OUString valstr(comphelper::string::stripEnd(str, ' '));
- OutMeta( rStrm, pIndent, name, valstr, false,
- eDestEnc, pNonConvertableChars );
- }
- catch (const uno::Exception&)
- {
- // may happen with concurrent modification...
- SAL_INFO("sfx", "SfxFrameHTMLWriter::Out_DocInfo: exception");
- }
+ // may happen with concurrent modification...
+ SAL_INFO("sfx", "SfxFrameHTMLWriter::Out_DocInfo: exception");
}
}
}
diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx
index 0659564edf16..a1eb0394c1ec 100644
--- a/sfx2/source/bastyp/progress.cxx
+++ b/sfx2/source/bastyp/progress.cxx
@@ -268,35 +268,35 @@ void SfxProgress::Resume()
{
if( pImpl->pActiveProgress ) return;
- if ( bSuspended )
- {
- SAL_INFO("sfx.bastyp", "SfxProgress: resumed");
- if ( pImpl->xStatusInd.is() )
- {
- pImpl->xStatusInd->start( pImpl->aText, pImpl->nMax );
- pImpl->xStatusInd->setValue( nVal );
- }
+ if ( !bSuspended )
+ return;
- if ( pImpl->bWaitMode )
- {
- if ( pImpl->xObjSh.is() )
- {
- for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pImpl->xObjSh.get() );
- pFrame;
- pFrame = SfxViewFrame::GetNext( *pFrame, pImpl->xObjSh.get() ) )
- pFrame->GetWindow().EnterWait();
- }
- }
+ SAL_INFO("sfx.bastyp", "SfxProgress: resumed");
+ if ( pImpl->xStatusInd.is() )
+ {
+ pImpl->xStatusInd->start( pImpl->aText, pImpl->nMax );
+ pImpl->xStatusInd->setValue( nVal );
+ }
+ if ( pImpl->bWaitMode )
+ {
if ( pImpl->xObjSh.is() )
{
- SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pImpl->xObjSh.get());
- if ( pFrame )
- pFrame->GetBindings().ENTERREGISTRATIONS();
+ for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pImpl->xObjSh.get() );
+ pFrame;
+ pFrame = SfxViewFrame::GetNext( *pFrame, pImpl->xObjSh.get() ) )
+ pFrame->GetWindow().EnterWait();
}
+ }
- bSuspended = false;
+ if ( pImpl->xObjSh.is() )
+ {
+ SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pImpl->xObjSh.get());
+ if ( pFrame )
+ pFrame->GetBindings().ENTERREGISTRATIONS();
}
+
+ bSuspended = false;
}
@@ -313,30 +313,30 @@ void SfxProgress::Suspend()
{
if( pImpl->pActiveProgress ) return;
- if ( !bSuspended )
- {
- SAL_INFO("sfx.bastyp", "SfxProgress: suspended");
- bSuspended = true;
+ if ( bSuspended )
+ return;
- if ( pImpl->xStatusInd.is() )
- {
- pImpl->xStatusInd->reset();
- }
+ SAL_INFO("sfx.bastyp", "SfxProgress: suspended");
+ bSuspended = true;
- if ( pImpl->xObjSh.is() )
- {
- for ( SfxViewFrame *pFrame =
- SfxViewFrame::GetFirst(pImpl->xObjSh.get());
- pFrame;
- pFrame = SfxViewFrame::GetNext( *pFrame, pImpl->xObjSh.get() ) )
- pFrame->GetWindow().LeaveWait();
- }
- if ( pImpl->xObjSh.is() )
- {
- SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pImpl->xObjSh.get() );
- if ( pFrame )
- pFrame->GetBindings().LEAVEREGISTRATIONS();
- }
+ if ( pImpl->xStatusInd.is() )
+ {
+ pImpl->xStatusInd->reset();
+ }
+
+ if ( pImpl->xObjSh.is() )
+ {
+ for ( SfxViewFrame *pFrame =
+ SfxViewFrame::GetFirst(pImpl->xObjSh.get());
+ pFrame;
+ pFrame = SfxViewFrame::GetNext( *pFrame, pImpl->xObjSh.get() ) )
+ pFrame->GetWindow().LeaveWait();
+ }
+ if ( pImpl->xObjSh.is() )
+ {
+ SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pImpl->xObjSh.get() );
+ if ( pFrame )
+ pFrame->GetBindings().LEAVEREGISTRATIONS();
}
}
diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx
index 1bf5a179bd0d..53f25cb95423 100644
--- a/sfx2/source/bastyp/sfxhtml.cxx
+++ b/sfx2/source/bastyp/sfxhtml.cxx
@@ -257,43 +257,43 @@ void SfxHTMLParser::GetScriptType_Impl( SvKeyValueIterator *pHTTPHeader )
{
aScriptType = SVX_MACRO_LANGUAGE_JAVASCRIPT;
eScriptType = JAVASCRIPT;
- if( pHTTPHeader )
+ if( !pHTTPHeader )
+ return;
+
+ SvKeyValue aKV;
+ for( bool bCont = pHTTPHeader->GetFirst( aKV ); bCont;
+ bCont = pHTTPHeader->GetNext( aKV ) )
{
- SvKeyValue aKV;
- for( bool bCont = pHTTPHeader->GetFirst( aKV ); bCont;
- bCont = pHTTPHeader->GetNext( aKV ) )
+ if( aKV.GetKey().equalsIgnoreAsciiCase(
+ OOO_STRING_SVTOOLS_HTML_META_content_script_type ) )
{
- if( aKV.GetKey().equalsIgnoreAsciiCase(
- OOO_STRING_SVTOOLS_HTML_META_content_script_type ) )
+ if( !aKV.GetValue().isEmpty() )
{
- if( !aKV.GetValue().isEmpty() )
+ OUString aTmp( aKV.GetValue() );
+ if( aTmp.startsWithIgnoreAsciiCase( "text/" ) )
+ aTmp = aTmp.copy( 5 );
+ else if( aTmp.startsWithIgnoreAsciiCase( "application/" ) )
+ aTmp = aTmp.copy( 12 );
+ else
+ break;
+
+ if( aTmp.startsWithIgnoreAsciiCase( "x-" ) ) // MIME-experimental
+ {
+ aTmp = aTmp.copy( 2 );
+ }
+
+ if( aTmp.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_LG_starbasic ) )
+ {
+ eScriptType = STARBASIC;
+ aScriptType = SVX_MACRO_LANGUAGE_STARBASIC;
+ }
+ if( !aTmp.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_LG_javascript ) )
{
- OUString aTmp( aKV.GetValue() );
- if( aTmp.startsWithIgnoreAsciiCase( "text/" ) )
- aTmp = aTmp.copy( 5 );
- else if( aTmp.startsWithIgnoreAsciiCase( "application/" ) )
- aTmp = aTmp.copy( 12 );
- else
- break;
-
- if( aTmp.startsWithIgnoreAsciiCase( "x-" ) ) // MIME-experimental
- {
- aTmp = aTmp.copy( 2 );
- }
-
- if( aTmp.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_LG_starbasic ) )
- {
- eScriptType = STARBASIC;
- aScriptType = SVX_MACRO_LANGUAGE_STARBASIC;
- }
- if( !aTmp.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_LG_javascript ) )
- {
- eScriptType = EXTENDED_STYPE;
- aScriptType = aTmp;
- }
+ eScriptType = EXTENDED_STYPE;
+ aScriptType = aTmp;
}
- break;
}
+ break;
}
}
}