Kaydet (Commit) d3971ec2 authored tarafından Noel Grandin's avatar Noel Grandin

new loplugin:blockblock

Change-Id: I7b68b70fa4c7234e8882f7627026959a596968fd
Reviewed-on: https://gerrit.libreoffice.org/43025Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst f50bf3c5
......@@ -1143,56 +1143,54 @@ void DlgEditor::printPage( sal_Int32 nPage, Printer* pPrinter, const OUString& r
void DlgEditor::Print( Printer* pPrinter, const OUString& rTitle ) // not working yet
{
{
MapMode aOldMap( pPrinter->GetMapMode());
vcl::Font aOldFont( pPrinter->GetFont() );
MapMode aMap( MapUnit::Map100thMM );
pPrinter->SetMapMode( aMap );
vcl::Font aFont;
aFont.SetAlignment( ALIGN_BOTTOM );
aFont.SetFontSize( Size( 0, 360 ));
pPrinter->SetFont( aFont );
Size aPaperSz = pPrinter->GetOutputSize();
aPaperSz.Width() -= (Print::nLeftMargin + Print::nRightMargin);
aPaperSz.Height() -= (Print::nTopMargin + Print::nBottomMargin);
lcl_PrintHeader( pPrinter, rTitle );
Bitmap aDlg;
Size aBmpSz( pPrinter->PixelToLogic( aDlg.GetSizePixel() ) );
double nPaperSzWidth = aPaperSz.Width();
double nPaperSzHeight = aPaperSz.Height();
double nBmpSzWidth = aBmpSz.Width();
double nBmpSzHeight = aBmpSz.Height();
double nScaleX = (nPaperSzWidth / nBmpSzWidth );
double nScaleY = (nPaperSzHeight / nBmpSzHeight );
Size aOutputSz;
if( nBmpSzHeight * nScaleX <= nPaperSzHeight )
{
aOutputSz.Width() = (long)(nBmpSzWidth * nScaleX);
aOutputSz.Height() = (long)(nBmpSzHeight * nScaleX);
}
else
{
aOutputSz.Width() = (long)(nBmpSzWidth * nScaleY);
aOutputSz.Height() = (long)(nBmpSzHeight * nScaleY);
}
MapMode aOldMap( pPrinter->GetMapMode());
vcl::Font aOldFont( pPrinter->GetFont() );
MapMode aMap( MapUnit::Map100thMM );
pPrinter->SetMapMode( aMap );
vcl::Font aFont;
aFont.SetAlignment( ALIGN_BOTTOM );
aFont.SetFontSize( Size( 0, 360 ));
pPrinter->SetFont( aFont );
Point aPosOffs(
(aPaperSz.Width() / 2) - (aOutputSz.Width() / 2),
(aPaperSz.Height()/ 2) - (aOutputSz.Height() / 2));
Size aPaperSz = pPrinter->GetOutputSize();
aPaperSz.Width() -= (Print::nLeftMargin + Print::nRightMargin);
aPaperSz.Height() -= (Print::nTopMargin + Print::nBottomMargin);
aPosOffs.X() += Print::nLeftMargin;
aPosOffs.Y() += Print::nTopMargin;
lcl_PrintHeader( pPrinter, rTitle );
pPrinter->DrawBitmap( aPosOffs, aOutputSz, aDlg );
Bitmap aDlg;
Size aBmpSz( pPrinter->PixelToLogic( aDlg.GetSizePixel() ) );
double nPaperSzWidth = aPaperSz.Width();
double nPaperSzHeight = aPaperSz.Height();
double nBmpSzWidth = aBmpSz.Width();
double nBmpSzHeight = aBmpSz.Height();
double nScaleX = (nPaperSzWidth / nBmpSzWidth );
double nScaleY = (nPaperSzHeight / nBmpSzHeight );
pPrinter->SetMapMode( aOldMap );
pPrinter->SetFont( aOldFont );
Size aOutputSz;
if( nBmpSzHeight * nScaleX <= nPaperSzHeight )
{
aOutputSz.Width() = (long)(nBmpSzWidth * nScaleX);
aOutputSz.Height() = (long)(nBmpSzHeight * nScaleX);
}
else
{
aOutputSz.Width() = (long)(nBmpSzWidth * nScaleY);
aOutputSz.Height() = (long)(nBmpSzHeight * nScaleY);
}
Point aPosOffs(
(aPaperSz.Width() / 2) - (aOutputSz.Width() / 2),
(aPaperSz.Height()/ 2) - (aOutputSz.Height() / 2));
aPosOffs.X() += Print::nLeftMargin;
aPosOffs.Y() += Print::nTopMargin;
pPrinter->DrawBitmap( aPosOffs, aOutputSz, aDlg );
pPrinter->SetMapMode( aOldMap );
pPrinter->SetFont( aOldFont );
}
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <cassert>
#include <string>
#include <iostream>
#include <fstream>
#include <set>
#include "plugin.hxx"
/**
Check for places where we declare a block directly inside a block
*/
namespace {
class BlockBlock:
public RecursiveASTVisitor<BlockBlock>, public loplugin::RewritePlugin
{
public:
explicit BlockBlock(InstantiationData const & data): RewritePlugin(data) {}
virtual void run() override
{
StringRef fn( compiler.getSourceManager().getFileEntryForID(
compiler.getSourceManager().getMainFileID())->getName() );
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sal/osl/unx/file_misc.cxx"))
return;
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
}
bool VisitCompoundStmt(CompoundStmt const * );
};
bool BlockBlock::VisitCompoundStmt(CompoundStmt const * compound)
{
if (ignoreLocation(compound))
return true;
if (compound->size() != 1)
return true;
auto inner = *compound->body_begin();
if (!isa<CompoundStmt>(inner))
return true;
if (compiler.getSourceManager().isMacroBodyExpansion(compound->getLocStart()))
return true;
if (compiler.getSourceManager().isMacroBodyExpansion(inner->getLocStart()))
return true;
report(
DiagnosticsEngine::Warning,
"block directly inside block",
compound->getLocStart())
<< compound->getSourceRange();
report(
DiagnosticsEngine::Note,
"inner block here",
inner->getLocStart())
<< inner->getSourceRange();
return true;
}
loplugin::Plugin::Registration< BlockBlock > X("blockblock", true);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
int main() { // expected-error {{block directly inside block [loplugin:blockblock]}}
{ // expected-note {{inner block here [loplugin:blockblock]}}
int x = 1;
(void)x;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
......@@ -89,16 +89,14 @@ sdbcx::ObjectType OUsers::appendObject( const OUString& _rForName, const Referen
// XDrop
void OUsers::dropObject(sal_Int32 /*nPos*/,const OUString& _sElementName)
{
{
OUString aSql( "REVOKE ALL ON * FROM " );
OUString aQuote = m_xConnection->getMetaData()->getIdentifierQuoteString( );
aSql += ::dbtools::quoteName(aQuote,_sElementName);
OUString aSql( "REVOKE ALL ON * FROM " );
OUString aQuote = m_xConnection->getMetaData()->getIdentifierQuoteString( );
aSql += ::dbtools::quoteName(aQuote,_sElementName);
Reference< XStatement > xStmt = m_xConnection->createStatement( );
if(xStmt.is())
xStmt->execute(aSql);
::comphelper::disposeComponent(xStmt);
}
Reference< XStatement > xStmt = m_xConnection->createStatement( );
if(xStmt.is())
xStmt->execute(aSql);
::comphelper::disposeComponent(xStmt);
}
......
......@@ -1463,25 +1463,23 @@ OSQLParser::OSQLParser(const css::uno::Reference< css::uno::XComponentContext >&
OSQLParser::~OSQLParser()
{
::osl::MutexGuard aGuard(getMutex());
OSL_ENSURE(s_nRefCount > 0, "OSQLParser::~OSQLParser() : suspicious call : has a refcount of 0 !");
if (!--s_nRefCount)
{
::osl::MutexGuard aGuard(getMutex());
OSL_ENSURE(s_nRefCount > 0, "OSQLParser::~OSQLParser() : suspicious call : has a refcount of 0 !");
if (!--s_nRefCount)
{
s_pScanner->setScanner(true);
delete s_pScanner;
s_pScanner = nullptr;
s_pScanner->setScanner(true);
delete s_pScanner;
s_pScanner = nullptr;
delete s_pGarbageCollector;
s_pGarbageCollector = nullptr;
// Is only set the first time, so we should delete it only when there are no more instances
s_xLocaleData = nullptr;
delete s_pGarbageCollector;
s_pGarbageCollector = nullptr;
// Is only set the first time, so we should delete it only when there are no more instances
s_xLocaleData = nullptr;
RuleIDMap aEmpty;
s_aReverseRuleIDLookup.swap( aEmpty );
}
m_pParseTree = nullptr;
RuleIDMap aEmpty;
s_aReverseRuleIDLookup.swap( aEmpty );
}
m_pParseTree = nullptr;
}
void OSQLParseNode::substituteParameterNames(OSQLParseNode const * _pNode)
......
......@@ -1820,24 +1820,20 @@ sal_uInt16 SvxSwPosSizeTabPage::FillPosLB(FrmMap *_pMap,
std::size_t nCount = ::lcl_GetFrmMapCount(_pMap);
for (std::size_t i = 0; _pMap && i < nCount; ++i)
{
// #61359# why not from the left/from inside or from the top?
// if (!bFormat || (pMap[i].eStrId != SwFPos::FROMLEFT && pMap[i].eStrId != SwFPos::FROMTOP))
SvxSwFramePosString::StringId eStrId = m_pHoriMirrorCB->IsChecked() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId;
eStrId = lcl_ChangeResIdToVerticalOrRTL(eStrId, m_bIsVerticalFrame, m_bIsInRightToLeft);
OUString sEntry(SvxSwFramePosString::GetString(eStrId));
if (_rLB.GetEntryPos(sEntry) == LISTBOX_ENTRY_NOTFOUND)
{
SvxSwFramePosString::StringId eStrId = m_pHoriMirrorCB->IsChecked() ? _pMap[i].eMirrorStrId : _pMap[i].eStrId;
eStrId = lcl_ChangeResIdToVerticalOrRTL(eStrId, m_bIsVerticalFrame, m_bIsInRightToLeft);
OUString sEntry(SvxSwFramePosString::GetString(eStrId));
if (_rLB.GetEntryPos(sEntry) == LISTBOX_ENTRY_NOTFOUND)
{
// don't insert duplicate entries at character wrapped borders
_rLB.InsertEntry(sEntry);
}
// #i22341# - add condition to handle map <aVCharMap>
// that is ambiguous in the alignment.
if ( _pMap[i].nAlign == _nAlign &&
( !(_pMap == aVCharMap) || _pMap[i].nLBRelations & nLBRelations ) )
{
sSelEntry = sEntry;
}
// don't insert duplicate entries at character wrapped borders
_rLB.InsertEntry(sEntry);
}
// #i22341# - add condition to handle map <aVCharMap>
// that is ambiguous in the alignment.
if ( _pMap[i].nAlign == _nAlign &&
( !(_pMap == aVCharMap) || _pMap[i].nLBRelations & nLBRelations ) )
{
sSelEntry = sEntry;
}
}
......
......@@ -414,13 +414,11 @@ void SAL_CALL OTableContainer::elementRemoved( const ContainerEvent& /*Event*/ )
void SAL_CALL OTableContainer::elementReplaced( const ContainerEvent& Event )
{
// create a new config entry
{
OUString sOldComposedName,sNewComposedName;
Event.ReplacedElement >>= sOldComposedName;
Event.Accessor >>= sNewComposedName;
OUString sOldComposedName,sNewComposedName;
Event.ReplacedElement >>= sOldComposedName;
Event.Accessor >>= sNewComposedName;
renameObject(sOldComposedName,sNewComposedName);
}
renameObject(sOldComposedName,sNewComposedName);
}
void SAL_CALL OTableContainer::disposing()
......
......@@ -1300,78 +1300,75 @@ void ODocumentDefinition::saveAs()
}
try
{
{
::SolarMutexGuard aSolarGuard;
// the request
DocumentSaveRequest aRequest;
aRequest.Name = m_pImpl->m_aProps.aTitle;
aRequest.Content.set(m_xParentContainer,UNO_QUERY);
OInteractionRequest* pRequest = new OInteractionRequest(makeAny(aRequest));
Reference< XInteractionRequest > xRequest(pRequest);
// some knittings
// two continuations allowed: OK and Cancel
ODocumentSaveContinuation* pDocuSave = new ODocumentSaveContinuation;
pRequest->addContinuation(pDocuSave);
OInteraction< XInteractionDisapprove >* pDisApprove = new OInteraction< XInteractionDisapprove >;
pRequest->addContinuation(pDisApprove);
OInteractionAbort* pAbort = new OInteractionAbort;
pRequest->addContinuation(pAbort);
// create the handler, let it handle the request
Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(m_aContext, nullptr) );
xHandler->handle(xRequest);
::SolarMutexGuard aSolarGuard;
if ( pAbort->wasSelected() )
return;
if ( pDisApprove->wasSelected() )
return;
if ( pDocuSave->wasSelected() )
// the request
DocumentSaveRequest aRequest;
aRequest.Name = m_pImpl->m_aProps.aTitle;
aRequest.Content.set(m_xParentContainer,UNO_QUERY);
OInteractionRequest* pRequest = new OInteractionRequest(makeAny(aRequest));
Reference< XInteractionRequest > xRequest(pRequest);
// some knittings
// two continuations allowed: OK and Cancel
ODocumentSaveContinuation* pDocuSave = new ODocumentSaveContinuation;
pRequest->addContinuation(pDocuSave);
OInteraction< XInteractionDisapprove >* pDisApprove = new OInteraction< XInteractionDisapprove >;
pRequest->addContinuation(pDisApprove);
OInteractionAbort* pAbort = new OInteractionAbort;
pRequest->addContinuation(pAbort);
// create the handler, let it handle the request
Reference< XInteractionHandler2 > xHandler( InteractionHandler::createWithParent(m_aContext, nullptr) );
xHandler->handle(xRequest);
if ( pAbort->wasSelected() )
return;
if ( pDisApprove->wasSelected() )
return;
if ( pDocuSave->wasSelected() )
{
::osl::MutexGuard aGuard(m_aMutex);
Reference<XNameContainer> xNC(pDocuSave->getContent(),UNO_QUERY);
if ( xNC.is() )
{
::osl::MutexGuard aGuard(m_aMutex);
Reference<XNameContainer> xNC(pDocuSave->getContent(),UNO_QUERY);
if ( xNC.is() )
if ( m_pImpl->m_aProps.aTitle != pDocuSave->getName() )
{
if ( m_pImpl->m_aProps.aTitle != pDocuSave->getName() )
try
{
try
{
Reference< XStorage> xStorage = getContainerStorage();
OUString sPersistentName = ::dbtools::createUniqueName(xStorage,"Obj");
xStorage->copyElementTo(m_pImpl->m_aProps.sPersistentName,xStorage,sPersistentName);
OUString sOldName = m_pImpl->m_aProps.aTitle;
rename(pDocuSave->getName());
updateDocumentTitle();
uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence(
{
{PROPERTY_NAME, uno::Any(sOldName)}, // set as folder
{PROPERTY_PERSISTENT_NAME, uno::Any(sPersistentName)},
{PROPERTY_AS_TEMPLATE, uno::Any(m_pImpl->m_aProps.bAsTemplate)},
}));
Reference< XMultiServiceFactory > xORB( m_xParentContainer, UNO_QUERY_THROW );
Reference< XInterface > xComponent( xORB->createInstanceWithArguments( SERVICE_SDB_DOCUMENTDEFINITION, aArguments ) );
Reference< XNameContainer > xNameContainer( m_xParentContainer, UNO_QUERY_THROW );
xNameContainer->insertByName( sOldName, makeAny( xComponent ) );
}
catch(const Exception&)
Reference< XStorage> xStorage = getContainerStorage();
OUString sPersistentName = ::dbtools::createUniqueName(xStorage,"Obj");
xStorage->copyElementTo(m_pImpl->m_aProps.sPersistentName,xStorage,sPersistentName);
OUString sOldName = m_pImpl->m_aProps.aTitle;
rename(pDocuSave->getName());
updateDocumentTitle();
uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence(
{
DBG_UNHANDLED_EXCEPTION();
}
{PROPERTY_NAME, uno::Any(sOldName)}, // set as folder
{PROPERTY_PERSISTENT_NAME, uno::Any(sPersistentName)},
{PROPERTY_AS_TEMPLATE, uno::Any(m_pImpl->m_aProps.bAsTemplate)},
}));
Reference< XMultiServiceFactory > xORB( m_xParentContainer, UNO_QUERY_THROW );
Reference< XInterface > xComponent( xORB->createInstanceWithArguments( SERVICE_SDB_DOCUMENTDEFINITION, aArguments ) );
Reference< XNameContainer > xNameContainer( m_xParentContainer, UNO_QUERY_THROW );
xNameContainer->insertByName( sOldName, makeAny( xComponent ) );
}
Reference<XEmbedPersist> xPersist(m_xEmbeddedObject,UNO_QUERY);
if ( xPersist.is() )
catch(const Exception&)
{
xPersist->storeOwn();
notifyDataSourceModified();
DBG_UNHANDLED_EXCEPTION();
}
}
Reference<XEmbedPersist> xPersist(m_xEmbeddedObject,UNO_QUERY);
if ( xPersist.is() )
{
xPersist->storeOwn();
notifyDataSourceModified();
}
}
}
}
catch(const Exception&)
{
......
......@@ -1114,18 +1114,16 @@ TOTypeInfoSP queryPrimaryKeyType(const OTypeInfoMap& _rTypeInfo)
// because we don't have the possibility to know how to create
// such auto increment column later on
// so until we know how to do it, we create a column without autoincrement
// if ( !aIter->second->bAutoIncrement )
{ // therefore we have searched
if ( aIter->second->nType == DataType::INTEGER )
{
pTypeInfo = aIter->second; // alternative
break;
}
else if ( !pTypeInfo.get() && aIter->second->nType == DataType::DOUBLE )
pTypeInfo = aIter->second; // alternative
else if ( !pTypeInfo.get() && aIter->second->nType == DataType::REAL )
pTypeInfo = aIter->second; // alternative
// therefore we have searched
if ( aIter->second->nType == DataType::INTEGER )
{
pTypeInfo = aIter->second; // alternative
break;
}
else if ( !pTypeInfo.get() && aIter->second->nType == DataType::DOUBLE )
pTypeInfo = aIter->second; // alternative
else if ( !pTypeInfo.get() && aIter->second->nType == DataType::REAL )
pTypeInfo = aIter->second; // alternative
}
if ( !pTypeInfo.get() ) // just a fallback
pTypeInfo = queryTypeInfoByType(DataType::VARCHAR,_rTypeInfo);
......
......@@ -606,14 +606,12 @@ bool UpdateInstallDialog::Thread::download(OUString const & sDownloadURL, Update
sTitle, css::ucb::NameClash::OVERWRITE ))
{
//the user may have cancelled the dialog because downloading took to long
{
SolarMutexGuard g;
if (m_stop) {
return m_stop;
}
//all errors should be handled by the command environment.
aUpdateData.sLocalURL = destFolder + "/" + sTitle;
SolarMutexGuard g;
if (m_stop) {
return m_stop;
}
//all errors should be handled by the command environment.
aUpdateData.sLocalURL = destFolder + "/" + sTitle;
}
return m_stop;
......
......@@ -1195,14 +1195,11 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, sal_Int32 nInsPos,
LANGUAGE_FRENCH_SWISS,
LANGUAGE_FRENCH_LUXEMBOURG))
{
OUString s( cNonBreakingSpace ); // UNICODE code for no break space
if( rDoc.Insert( bSttQuote ? nInsPos+1 : nInsPos, s ))
{
OUString s( cNonBreakingSpace );
// UNICODE code for no break space
if( rDoc.Insert( bSttQuote ? nInsPos+1 : nInsPos, s ))
{
if( !bSttQuote )
++nInsPos;
}
if( !bSttQuote )
++nInsPos;
}
}
}
......
......@@ -404,67 +404,65 @@ uno::Sequence< sal_Int32 > const & OCommonEmbeddedObject::GetIntermediateStatesS
void SAL_CALL OCommonEmbeddedObject::changeState( sal_Int32 nNewState )
{
{
::osl::ResettableMutexGuard aGuard( m_aMutex );
if ( m_bDisposed )
throw lang::DisposedException(); // TODO
::osl::ResettableMutexGuard aGuard( m_aMutex );
if ( m_bDisposed )
throw lang::DisposedException(); // TODO
if ( m_nObjectState == -1 )
throw embed::WrongStateException( "The object has no persistence!",
static_cast< ::cppu::OWeakObject* >(this) );
if ( m_nObjectState == -1 )
throw embed::WrongStateException( "The object has no persistence!",
static_cast< ::cppu::OWeakObject* >(this) );
sal_Int32 nOldState = m_nObjectState;
sal_Int32 nOldState = m_nObjectState;
if ( m_nTargetState != -1 )
{
// means that the object is currently trying to reach the target state
throw embed::StateChangeInProgressException( OUString(),
uno::Reference< uno::XInterface >(),
m_nTargetState );
}
else
{
TargetStateControl_Impl aControl( m_nTargetState, nNewState );
if ( m_nTargetState != -1 )
{
// means that the object is currently trying to reach the target state
throw embed::StateChangeInProgressException( OUString(),
uno::Reference< uno::XInterface >(),
m_nTargetState );
}
else
{
TargetStateControl_Impl aControl( m_nTargetState, nNewState );
// in case the object is already in requested state
if ( m_nObjectState == nNewState )
{
// if active object is activated again, bring its window to top
if ( m_nObjectState == embed::EmbedStates::ACTIVE )
m_xDocHolder->Show();
// in case the object is already in requested state
if ( m_nObjectState == nNewState )
{
// if active object is activated again, bring its window to top
if ( m_nObjectState == embed::EmbedStates::ACTIVE )
m_xDocHolder->Show();
return;
}
return;
}
// retrieve sequence of states that should be passed to reach desired state
uno::Sequence< sal_Int32 > aIntermediateStates = GetIntermediateStatesSequence_Impl( nNewState );
// retrieve sequence of states that should be passed to reach desired state
uno::Sequence< sal_Int32 > aIntermediateStates = GetIntermediateStatesSequence_Impl( nNewState );
// notify listeners that the object is going to change the state
StateChangeNotification_Impl( true, nOldState, nNewState,aGuard );
// notify listeners that the object is going to change the state
StateChangeNotification_Impl( true, nOldState, nNewState,aGuard );
try {
for ( sal_Int32 nInd = 0; nInd < aIntermediateStates.getLength(); nInd++ )
SwitchStateTo_Impl( aIntermediateStates[nInd] );
try {
for ( sal_Int32 nInd = 0; nInd < aIntermediateStates.getLength(); nInd++ )
SwitchStateTo_Impl( aIntermediateStates[nInd] );
SwitchStateTo_Impl( nNewState );
}
catch( const uno::Exception& )
{
if ( nOldState != m_nObjectState )
// notify listeners that the object has changed the state
StateChangeNotification_Impl( false, nOldState, m_nObjectState, aGuard );
SwitchStateTo_Impl( nNewState );
}
catch( const uno::Exception& )
{
if ( nOldState != m_nObjectState )
// notify listeners that the object has changed the state
StateChangeNotification_Impl( false, nOldState, m_nObjectState, aGuard );
throw;
}
throw;
}
}
// notify listeners that the object has changed the state
StateChangeNotification_Impl( false, nOldState, nNewState, aGuard );
// notify listeners that the object has changed the state
StateChangeNotification_Impl( false, nOldState, nNewState, aGuard );
// let the object window be shown
if ( nNewState == embed::EmbedStates::UI_ACTIVE || nNewState == embed::EmbedStates::INPLACE_ACTIVE )
PostEvent_Impl( "OnVisAreaChanged" );
}
// let the object window be shown
if ( nNewState == embed::EmbedStates::UI_ACTIVE || nNewState == embed::EmbedStates::INPLACE_ACTIVE )
PostEvent_Impl( "OnVisAreaChanged" );
}
......
......@@ -131,19 +131,17 @@ void CGMBitmap::ImplGetBitmap( CGMBitmapDescriptor& rDesc )
case 24 :
{
BitmapColor aBitmapColor;
for ( ny = 0; --nyCount; ny++, rDesc.mpBuf += rDesc.mnScanSize )
{
BitmapColor aBitmapColor;
for ( ny = 0; --nyCount; ny++, rDesc.mpBuf += rDesc.mnScanSize )
sal_uInt8* pTemp = rDesc.mpBuf;
nxC = nxCount;
for ( nx = 0; --nxC; nx++ )
{
sal_uInt8* pTemp = rDesc.mpBuf;
nxC = nxCount;
for ( nx = 0; --nxC; nx++ )
{
aBitmapColor.SetRed( *pTemp++ );
aBitmapColor.SetGreen( *pTemp++ );
aBitmapColor.SetBlue( *pTemp++ );
rDesc.mpAcc->SetPixel( ny, nx, aBitmapColor );
}
aBitmapColor.SetRed( *pTemp++ );
aBitmapColor.SetGreen( *pTemp++ );
aBitmapColor.SetBlue( *pTemp++ );
rDesc.mpAcc->SetPixel( ny, nx, aBitmapColor );
}
}
}
......
......@@ -1371,44 +1371,42 @@ void SVGTextWriter::implWriteBulletChars()