loplugin:flatten in sd

Change-Id: I57cf26d800d8d414014b88c250ee1cbd47551bc4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100007
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2020-08-03 15:52:33 +02:00
parent ece7781530
commit 186c34af5d
11 changed files with 543 additions and 544 deletions

View File

@@ -916,19 +916,19 @@ void CustomAnimationList::append( CustomAnimationEffectPtr pEffect )
static void selectShape(weld::TreeView* pTreeList, const Reference< XShape >& xShape )
{
std::unique_ptr<weld::TreeIter> xEntry = pTreeList->make_iterator();
if (pTreeList->get_iter_first(*xEntry))
if (!pTreeList->get_iter_first(*xEntry))
return;
do
{
do
CustomAnimationListEntryItem* pEntry = reinterpret_cast<CustomAnimationListEntryItem*>(pTreeList->get_id(*xEntry).toInt64());
CustomAnimationEffectPtr pEffect(pEntry->getEffect());
if (pEffect)
{
CustomAnimationListEntryItem* pEntry = reinterpret_cast<CustomAnimationListEntryItem*>(pTreeList->get_id(*xEntry).toInt64());
CustomAnimationEffectPtr pEffect(pEntry->getEffect());
if (pEffect)
{
if (pEffect->getTarget() == xShape)
pTreeList->select(*xEntry);
}
} while (pTreeList->iter_next(*xEntry));
}
if (pEffect->getTarget() == xShape)
pTreeList->select(*xEntry);
}
} while (pTreeList->iter_next(*xEntry));
}
void CustomAnimationList::onSelectionChanged(const Any& rSelection)

View File

@@ -141,101 +141,101 @@ SdTransferable::~SdTransferable()
void SdTransferable::CreateObjectReplacement( SdrObject* pObj )
{
if( pObj )
if( !pObj )
return;
mpOLEDataHelper.reset();
mpGraphic.reset();
mpBookmark.reset();
mpImageMap.reset();
if( nullptr!= dynamic_cast< const SdrOle2Obj* >( pObj ) )
{
mpOLEDataHelper.reset();
mpGraphic.reset();
mpBookmark.reset();
mpImageMap.reset();
if( nullptr!= dynamic_cast< const SdrOle2Obj* >( pObj ) )
try
{
try
uno::Reference < embed::XEmbeddedObject > xObj = static_cast< SdrOle2Obj* >( pObj )->GetObjRef();
uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY );
if( xObj.is() && xPersist.is() && xPersist->hasEntry() )
{
uno::Reference < embed::XEmbeddedObject > xObj = static_cast< SdrOle2Obj* >( pObj )->GetObjRef();
uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY );
if( xObj.is() && xPersist.is() && xPersist->hasEntry() )
{
mpOLEDataHelper.reset( new TransferableDataHelper( new SvEmbedTransferHelper( xObj, static_cast< SdrOle2Obj* >( pObj )->GetGraphic(), static_cast< SdrOle2Obj* >( pObj )->GetAspect() ) ) );
mpOLEDataHelper.reset( new TransferableDataHelper( new SvEmbedTransferHelper( xObj, static_cast< SdrOle2Obj* >( pObj )->GetGraphic(), static_cast< SdrOle2Obj* >( pObj )->GetAspect() ) ) );
// TODO/LATER: the standalone handling of the graphic should not be used any more in future
// The EmbedDataHelper should bring the graphic in future
const Graphic* pObjGr = static_cast< SdrOle2Obj* >( pObj )->GetGraphic();
if ( pObjGr )
mpGraphic.reset( new Graphic( *pObjGr ) );
}
}
catch( uno::Exception& )
{}
}
else if( dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr && (mpSourceDoc && !SdDrawDocument::GetAnimationInfo( pObj )) )
{
mpGraphic.reset( new Graphic( static_cast< SdrGrafObj* >( pObj )->GetTransformedGraphic() ) );
}
else if( pObj->IsUnoObj() && SdrInventor::FmForm == pObj->GetObjInventor() && ( pObj->GetObjIdentifier() == sal_uInt16(OBJ_FM_BUTTON) ) )
{
SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >( pObj );
if (SdrInventor::FmForm == pUnoCtrl->GetObjInventor())
{
const Reference< css::awt::XControlModel >& xControlModel( pUnoCtrl->GetUnoControlModel() );
if( !xControlModel.is() )
return;
Reference< css::beans::XPropertySet > xPropSet( xControlModel, UNO_QUERY );
if( !xPropSet.is() )
return;
css::form::FormButtonType eButtonType;
Any aTmp( xPropSet->getPropertyValue( "ButtonType" ) );
if( aTmp >>= eButtonType )
{
OUString aLabel, aURL;
xPropSet->getPropertyValue( "Label" ) >>= aLabel;
xPropSet->getPropertyValue( "TargetURL" ) >>= aURL;
mpBookmark.reset( new INetBookmark( aURL, aLabel ) );
}
// TODO/LATER: the standalone handling of the graphic should not be used any more in future
// The EmbedDataHelper should bring the graphic in future
const Graphic* pObjGr = static_cast< SdrOle2Obj* >( pObj )->GetGraphic();
if ( pObjGr )
mpGraphic.reset( new Graphic( *pObjGr ) );
}
}
else if( dynamic_cast< const SdrTextObj *>( pObj ) != nullptr )
catch( uno::Exception& )
{}
}
else if( dynamic_cast< const SdrGrafObj *>( pObj ) != nullptr && (mpSourceDoc && !SdDrawDocument::GetAnimationInfo( pObj )) )
{
mpGraphic.reset( new Graphic( static_cast< SdrGrafObj* >( pObj )->GetTransformedGraphic() ) );
}
else if( pObj->IsUnoObj() && SdrInventor::FmForm == pObj->GetObjInventor() && ( pObj->GetObjIdentifier() == sal_uInt16(OBJ_FM_BUTTON) ) )
{
SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >( pObj );
if (SdrInventor::FmForm == pUnoCtrl->GetObjInventor())
{
const OutlinerParaObject* pPara;
const Reference< css::awt::XControlModel >& xControlModel( pUnoCtrl->GetUnoControlModel() );
if( (pPara = static_cast< SdrTextObj* >( pObj )->GetOutlinerParaObject()) != nullptr )
if( !xControlModel.is() )
return;
Reference< css::beans::XPropertySet > xPropSet( xControlModel, UNO_QUERY );
if( !xPropSet.is() )
return;
css::form::FormButtonType eButtonType;
Any aTmp( xPropSet->getPropertyValue( "ButtonType" ) );
if( aTmp >>= eButtonType )
{
const SvxFieldItem* pField;
OUString aLabel, aURL;
if( (pField = pPara->GetTextObject().GetField()) != nullptr )
xPropSet->getPropertyValue( "Label" ) >>= aLabel;
xPropSet->getPropertyValue( "TargetURL" ) >>= aURL;
mpBookmark.reset( new INetBookmark( aURL, aLabel ) );
}
}
}
else if( dynamic_cast< const SdrTextObj *>( pObj ) != nullptr )
{
const OutlinerParaObject* pPara;
if( (pPara = static_cast< SdrTextObj* >( pObj )->GetOutlinerParaObject()) != nullptr )
{
const SvxFieldItem* pField;
if( (pField = pPara->GetTextObject().GetField()) != nullptr )
{
const SvxFieldData* pData = pField->GetField();
if( auto pURL = dynamic_cast< const SvxURLField *>( pData ) )
{
const SvxFieldData* pData = pField->GetField();
if( auto pURL = dynamic_cast< const SvxURLField *>( pData ) )
// #i63399# This special code identifies TextFrames which have just a URL
// as content and directly add this to the clipboard, probably to avoid adding
// an unnecessary DrawObject to the target where paste may take place. This is
// wanted only for SdrObjects with no fill and no line, else it is necessary to
// use the whole SdrObect. Test here for Line/FillStyle and take shortcut only
// when both are unused
if(!pObj->HasFillStyle() && !pObj->HasLineStyle())
{
// #i63399# This special code identifies TextFrames which have just a URL
// as content and directly add this to the clipboard, probably to avoid adding
// an unnecessary DrawObject to the target where paste may take place. This is
// wanted only for SdrObjects with no fill and no line, else it is necessary to
// use the whole SdrObect. Test here for Line/FillStyle and take shortcut only
// when both are unused
if(!pObj->HasFillStyle() && !pObj->HasLineStyle())
{
mpBookmark.reset( new INetBookmark( pURL->GetURL(), pURL->GetRepresentation() ) );
}
mpBookmark.reset( new INetBookmark( pURL->GetURL(), pURL->GetRepresentation() ) );
}
}
}
}
SvxIMapInfo* pInfo = SvxIMapInfo::GetIMapInfo( pObj );
if( pInfo )
mpImageMap.reset( new ImageMap( pInfo->GetImageMap() ) );
}
SvxIMapInfo* pInfo = SvxIMapInfo::GetIMapInfo( pObj );
if( pInfo )
mpImageMap.reset( new ImageMap( pInfo->GetImageMap() ) );
}
void SdTransferable::CreateData()
@@ -301,32 +301,32 @@ void SdTransferable::CreateData()
}
// set VisArea and adjust objects if necessary
if( maVisArea.IsEmpty() &&
if( !(maVisArea.IsEmpty() &&
mpSdDrawDocumentIntern && mpSdViewIntern &&
mpSdDrawDocumentIntern->GetPageCount() )
mpSdDrawDocumentIntern->GetPageCount()) )
return;
SdPage* pPage = mpSdDrawDocumentIntern->GetSdPage( 0, PageKind::Standard );
if( 1 == mpSdDrawDocumentIntern->GetPageCount() )
{
SdPage* pPage = mpSdDrawDocumentIntern->GetSdPage( 0, PageKind::Standard );
// #112978# need to use GetAllMarkedBoundRect instead of GetAllMarkedRect to get
// fat lines correctly
maVisArea = mpSdViewIntern->GetAllMarkedBoundRect();
Point aOrigin( maVisArea.TopLeft() );
Size aVector( -aOrigin.X(), -aOrigin.Y() );
if( 1 == mpSdDrawDocumentIntern->GetPageCount() )
for( size_t nObj = 0, nObjCount = pPage->GetObjCount(); nObj < nObjCount; ++nObj )
{
// #112978# need to use GetAllMarkedBoundRect instead of GetAllMarkedRect to get
// fat lines correctly
maVisArea = mpSdViewIntern->GetAllMarkedBoundRect();
Point aOrigin( maVisArea.TopLeft() );
Size aVector( -aOrigin.X(), -aOrigin.Y() );
for( size_t nObj = 0, nObjCount = pPage->GetObjCount(); nObj < nObjCount; ++nObj )
{
SdrObject* pObj = pPage->GetObj( nObj );
pObj->NbcMove( aVector );
}
SdrObject* pObj = pPage->GetObj( nObj );
pObj->NbcMove( aVector );
}
else
maVisArea.SetSize( pPage->GetSize() );
// output is at the zero point
maVisArea.SetPos( Point() );
}
else
maVisArea.SetSize( pPage->GetSize() );
// output is at the zero point
maVisArea.SetPos( Point() );
}
static bool lcl_HasOnlyControls( SdrModel* pModel )
@@ -375,68 +375,68 @@ static bool lcl_HasOnlyOneTable( SdrModel* pModel )
void SdTransferable::AddSupportedFormats()
{
if( !mbPageTransferable || mbPageTransferablePersistent )
if( !(!mbPageTransferable || mbPageTransferablePersistent) )
return;
if( !mbLateInit )
CreateData();
if( mpObjDesc )
AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
if( mpOLEDataHelper )
{
if( !mbLateInit )
CreateData();
AddFormat( SotClipboardFormatId::EMBED_SOURCE );
if( mpObjDesc )
AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
DataFlavorExVector aVector( mpOLEDataHelper->GetDataFlavorExVector() );
if( mpOLEDataHelper )
for( const auto& rItem : aVector )
AddFormat( rItem );
}
else if( mpGraphic )
{
// #i25616#
AddFormat( SotClipboardFormatId::DRAWING );
AddFormat( SotClipboardFormatId::SVXB );
if( mpGraphic->GetType() == GraphicType::Bitmap )
{
AddFormat( SotClipboardFormatId::EMBED_SOURCE );
DataFlavorExVector aVector( mpOLEDataHelper->GetDataFlavorExVector() );
for( const auto& rItem : aVector )
AddFormat( rItem );
}
else if( mpGraphic )
{
// #i25616#
AddFormat( SotClipboardFormatId::DRAWING );
AddFormat( SotClipboardFormatId::SVXB );
if( mpGraphic->GetType() == GraphicType::Bitmap )
{
AddFormat( SotClipboardFormatId::PNG );
AddFormat( SotClipboardFormatId::BITMAP );
AddFormat( SotClipboardFormatId::GDIMETAFILE );
}
else
{
AddFormat( SotClipboardFormatId::GDIMETAFILE );
AddFormat( SotClipboardFormatId::PNG );
AddFormat( SotClipboardFormatId::BITMAP );
}
}
else if( mpBookmark )
{
AddFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK );
AddFormat( SotClipboardFormatId::STRING );
AddFormat( SotClipboardFormatId::PNG );
AddFormat( SotClipboardFormatId::BITMAP );
AddFormat( SotClipboardFormatId::GDIMETAFILE );
}
else
{
AddFormat( SotClipboardFormatId::EMBED_SOURCE );
AddFormat( SotClipboardFormatId::DRAWING );
if( !mpSdDrawDocument || !lcl_HasOnlyControls( mpSdDrawDocument ) )
{
AddFormat( SotClipboardFormatId::GDIMETAFILE );
AddFormat( SotClipboardFormatId::PNG );
AddFormat( SotClipboardFormatId::BITMAP );
}
if( lcl_HasOnlyOneTable( mpSdDrawDocument ) ) {
AddFormat( SotClipboardFormatId::RTF );
AddFormat( SotClipboardFormatId::RICHTEXT );
}
AddFormat( SotClipboardFormatId::GDIMETAFILE );
AddFormat( SotClipboardFormatId::PNG );
AddFormat( SotClipboardFormatId::BITMAP );
}
}
else if( mpBookmark )
{
AddFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK );
AddFormat( SotClipboardFormatId::STRING );
}
else
{
AddFormat( SotClipboardFormatId::EMBED_SOURCE );
AddFormat( SotClipboardFormatId::DRAWING );
if( !mpSdDrawDocument || !lcl_HasOnlyControls( mpSdDrawDocument ) )
{
AddFormat( SotClipboardFormatId::GDIMETAFILE );
AddFormat( SotClipboardFormatId::PNG );
AddFormat( SotClipboardFormatId::BITMAP );
}
if( mpImageMap )
AddFormat( SotClipboardFormatId::SVIM );
if( lcl_HasOnlyOneTable( mpSdDrawDocument ) ) {
AddFormat( SotClipboardFormatId::RTF );
AddFormat( SotClipboardFormatId::RICHTEXT );
}
}
if( mpImageMap )
AddFormat( SotClipboardFormatId::SVIM );
}
bool SdTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDoc )
@@ -666,44 +666,44 @@ void SdTransferable::SetObjectDescriptor( std::unique_ptr<TransferableObjectDesc
void SdTransferable::SetPageBookmarks( const std::vector<OUString> &rPageBookmarks, bool bPersistent )
{
if( mpSourceDoc )
if( !mpSourceDoc )
return;
if( mpSdViewIntern )
mpSdViewIntern->HideSdrPage();
mpSdDrawDocument->ClearModel(false);
mpPageDocShell = nullptr;
maPageBookmarks.clear();
if( bPersistent )
{
if( mpSdViewIntern )
mpSdViewIntern->HideSdrPage();
mpSdDrawDocument->ClearModel(false);
mpPageDocShell = nullptr;
maPageBookmarks.clear();
if( bPersistent )
{
mpSdDrawDocument->CreateFirstPages(mpSourceDoc);
mpSdDrawDocument->InsertBookmarkAsPage( rPageBookmarks, nullptr, false, true, 1, true,
mpSourceDoc->GetDocSh(), true, true, false );
}
else
{
mpPageDocShell = mpSourceDoc->GetDocSh();
maPageBookmarks = rPageBookmarks;
}
if( mpSdViewIntern )
{
SdPage* pPage = mpSdDrawDocument->GetSdPage( 0, PageKind::Standard );
if( pPage )
{
mpSdViewIntern->MarkAllObj( mpSdViewIntern->ShowSdrPage( pPage ) );
}
}
// set flags for page transferable; if ( mbPageTransferablePersistent == sal_False ),
// don't offer any formats => it's just for internal purposes
mbPageTransferable = true;
mbPageTransferablePersistent = bPersistent;
mpSdDrawDocument->CreateFirstPages(mpSourceDoc);
mpSdDrawDocument->InsertBookmarkAsPage( rPageBookmarks, nullptr, false, true, 1, true,
mpSourceDoc->GetDocSh(), true, true, false );
}
else
{
mpPageDocShell = mpSourceDoc->GetDocSh();
maPageBookmarks = rPageBookmarks;
}
if( mpSdViewIntern )
{
SdPage* pPage = mpSdDrawDocument->GetSdPage( 0, PageKind::Standard );
if( pPage )
{
mpSdViewIntern->MarkAllObj( mpSdViewIntern->ShowSdrPage( pPage ) );
}
}
// set flags for page transferable; if ( mbPageTransferablePersistent == sal_False ),
// don't offer any formats => it's just for internal purposes
mbPageTransferable = true;
mbPageTransferablePersistent = bPersistent;
}
sal_Int64 SAL_CALL SdTransferable::getSomething( const css::uno::Sequence< sal_Int8 >& rId )

View File

@@ -217,34 +217,34 @@ LayoutToolbarMenu::LayoutToolbarMenu(SlideLayoutController* pControl, weld::Widg
mxFrame2->show();
}
if( eMode == DrawViewMode_DRAW )
if( eMode != DrawViewMode_DRAW )
return;
if( !mxFrame.is() )
return;
OUString sSlotStr;
if( bInsertPage )
sSlotStr = ".uno:DuplicatePage";
else
sSlotStr = ".uno:Undo";
css::uno::Reference<css::graphic::XGraphic> xSlotImage = vcl::CommandInfoProvider::GetXGraphicForCommand(sSlotStr, mxFrame);
OUString sSlotTitle;
if( bInsertPage )
{
if( mxFrame.is() )
{
OUString sSlotStr;
if( bInsertPage )
sSlotStr = ".uno:DuplicatePage";
else
sSlotStr = ".uno:Undo";
css::uno::Reference<css::graphic::XGraphic> xSlotImage = vcl::CommandInfoProvider::GetXGraphicForCommand(sSlotStr, mxFrame);
OUString sSlotTitle;
if( bInsertPage )
{
auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(sSlotStr, mxControl->getModuleName());
sSlotTitle = vcl::CommandInfoProvider::GetLabelForCommand(aProperties);
}
else
sSlotTitle = SdResId( STR_RESET_LAYOUT );
mxMoreButton->set_label(sSlotTitle);
mxMoreButton->set_image(xSlotImage);
mxMoreButton->connect_clicked(LINK(this, LayoutToolbarMenu, SelectToolbarMenuHdl));
mxMoreButton->show();
}
auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(sSlotStr, mxControl->getModuleName());
sSlotTitle = vcl::CommandInfoProvider::GetLabelForCommand(aProperties);
}
else
sSlotTitle = SdResId( STR_RESET_LAYOUT );
mxMoreButton->set_label(sSlotTitle);
mxMoreButton->set_image(xSlotImage);
mxMoreButton->connect_clicked(LINK(this, LayoutToolbarMenu, SelectToolbarMenuHdl));
mxMoreButton->show();
}
IMPL_LINK(LayoutToolbarMenu, SelectValueSetHdl, ValueSet*, pLayoutSet, void)

View File

@@ -821,97 +821,96 @@ IMPL_LINK(SvxBulletAndPositionDlg, GraphicHdl_Impl, const OString&, rIdent, void
}
}
}
if (bSucc)
if (!bSucc)
return;
aSize = OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(eCoreUnit));
sal_uInt16 nMask = 1;
for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
{
aSize = OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(eCoreUnit));
sal_uInt16 nMask = 1;
for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
if (nActNumLvl & nMask)
{
if (nActNumLvl & nMask)
{
SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
aNumFmt.SetCharFormatName(m_sNumCharFmtName);
aNumFmt.SetGraphic(aGrfName);
SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
aNumFmt.SetCharFormatName(m_sNumCharFmtName);
aNumFmt.SetGraphic(aGrfName);
// set size for a later comparison
const SvxBrushItem* pBrushItem = aNumFmt.GetBrush();
// initiate asynchronous loading
sal_Int16 eOrient = aNumFmt.GetVertOrient();
aNumFmt.SetGraphicBrush(pBrushItem, &aSize, &eOrient);
aInitSize[i] = aNumFmt.GetGraphicSize();
// set size for a later comparison
const SvxBrushItem* pBrushItem = aNumFmt.GetBrush();
// initiate asynchronous loading
sal_Int16 eOrient = aNumFmt.GetVertOrient();
aNumFmt.SetGraphicBrush(pBrushItem, &aSize, &eOrient);
aInitSize[i] = aNumFmt.GetGraphicSize();
pActNum->SetLevel(i, aNumFmt);
}
nMask <<= 1;
pActNum->SetLevel(i, aNumFmt);
}
m_xRatioCB->set_sensitive(true);
m_xWidthFT->set_sensitive(true);
m_xHeightFT->set_sensitive(true);
m_xWidthMF->set_sensitive(true);
m_xHeightMF->set_sensitive(true);
SetMetricValue(*m_xWidthMF, aSize.Width(), eCoreUnit);
SetMetricValue(*m_xHeightMF, aSize.Height(), eCoreUnit);
SetModified();
//needed due to asynchronous loading of graphics in the SvxBrushItem
aInvalidateTimer.Start();
nMask <<= 1;
}
m_xRatioCB->set_sensitive(true);
m_xWidthFT->set_sensitive(true);
m_xHeightFT->set_sensitive(true);
m_xWidthMF->set_sensitive(true);
m_xHeightMF->set_sensitive(true);
SetMetricValue(*m_xWidthMF, aSize.Width(), eCoreUnit);
SetMetricValue(*m_xHeightMF, aSize.Height(), eCoreUnit);
SetModified();
//needed due to asynchronous loading of graphics in the SvxBrushItem
aInvalidateTimer.Start();
}
IMPL_LINK_NOARG(SvxBulletAndPositionDlg, PopupActivateHdl_Impl, weld::ToggleButton&, void)
{
if (!m_xGalleryMenu)
if (m_xGalleryMenu)
return;
m_xGalleryMenu = m_xBuilder->weld_menu("gallerysubmenu");
weld::WaitObject aWait(p_Window);
if (!GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames))
return;
GalleryExplorer::BeginLocking(GALLERY_THEME_BULLETS);
Graphic aGraphic;
OUString sGrfName;
ScopedVclPtrInstance<VirtualDevice> pVD;
size_t i = 0;
for (const auto& grfName : aGrfNames)
{
m_xGalleryMenu = m_xBuilder->weld_menu("gallerysubmenu");
weld::WaitObject aWait(p_Window);
if (GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames))
sGrfName = grfName;
OUString sItemId = "gallery" + OUString::number(i);
INetURLObject aObj(sGrfName);
if (aObj.GetProtocol() == INetProtocol::File)
sGrfName = aObj.PathToFileName();
if (GalleryExplorer::GetGraphicObj(GALLERY_THEME_BULLETS, i, &aGraphic))
{
GalleryExplorer::BeginLocking(GALLERY_THEME_BULLETS);
Graphic aGraphic;
OUString sGrfName;
ScopedVclPtrInstance<VirtualDevice> pVD;
size_t i = 0;
for (const auto& grfName : aGrfNames)
BitmapEx aBitmap(aGraphic.GetBitmapEx());
Size aSize(aBitmap.GetSizePixel());
if (aSize.Width() > MAX_BMP_WIDTH || aSize.Height() > MAX_BMP_HEIGHT)
{
sGrfName = grfName;
OUString sItemId = "gallery" + OUString::number(i);
INetURLObject aObj(sGrfName);
if (aObj.GetProtocol() == INetProtocol::File)
sGrfName = aObj.PathToFileName();
if (GalleryExplorer::GetGraphicObj(GALLERY_THEME_BULLETS, i, &aGraphic))
{
BitmapEx aBitmap(aGraphic.GetBitmapEx());
Size aSize(aBitmap.GetSizePixel());
if (aSize.Width() > MAX_BMP_WIDTH || aSize.Height() > MAX_BMP_HEIGHT)
{
bool bWidth = aSize.Width() > aSize.Height();
double nScale
= bWidth ? double(MAX_BMP_WIDTH) / static_cast<double>(aSize.Width())
: double(MAX_BMP_HEIGHT) / static_cast<double>(aSize.Height());
aBitmap.Scale(nScale, nScale);
}
pVD->SetOutputSizePixel(aBitmap.GetSizePixel(), false);
pVD->DrawBitmapEx(Point(), aBitmap);
// We want to show only icon names not full path.
aObj.removeExtension();
OUString sIconName
= aObj.GetLastName(INetURLObject::DecodeMechanism::WithCharset);
m_xGalleryMenu->append(sItemId, sIconName, *pVD);
}
else
{
m_xGalleryMenu->append(sItemId, sGrfName);
}
++i;
bool bWidth = aSize.Width() > aSize.Height();
double nScale = bWidth
? double(MAX_BMP_WIDTH) / static_cast<double>(aSize.Width())
: double(MAX_BMP_HEIGHT) / static_cast<double>(aSize.Height());
aBitmap.Scale(nScale, nScale);
}
GalleryExplorer::EndLocking(GALLERY_THEME_BULLETS);
pVD->SetOutputSizePixel(aBitmap.GetSizePixel(), false);
pVD->DrawBitmapEx(Point(), aBitmap);
// We want to show only icon names not full path.
aObj.removeExtension();
OUString sIconName = aObj.GetLastName(INetURLObject::DecodeMechanism::WithCharset);
m_xGalleryMenu->append(sItemId, sIconName, *pVD);
}
else
{
m_xGalleryMenu->append(sItemId, sGrfName);
}
++i;
}
GalleryExplorer::EndLocking(GALLERY_THEME_BULLETS);
}
IMPL_LINK_NOARG(SvxBulletAndPositionDlg, BulletHdl_Impl, weld::Button&, void)
@@ -950,26 +949,26 @@ IMPL_LINK_NOARG(SvxBulletAndPositionDlg, BulletHdl_Impl, weld::Button&, void)
aMap.SetCharFont(aActBulletFont);
if (bSameBullet)
aMap.SetChar(cBullet);
if (aMap.run() == RET_OK)
if (aMap.run() != RET_OK)
return;
// change Font Numrules
aActBulletFont = aMap.GetCharFont();
sal_uInt16 _nMask = 1;
for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
{
// change Font Numrules
aActBulletFont = aMap.GetCharFont();
sal_uInt16 _nMask = 1;
for (sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
if (nActNumLvl & _nMask)
{
if (nActNumLvl & _nMask)
{
SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
aNumFmt.SetBulletFont(&aActBulletFont);
aNumFmt.SetBulletChar(static_cast<sal_Unicode>(aMap.GetChar()));
pActNum->SetLevel(i, aNumFmt);
}
_nMask <<= 1;
SvxNumberFormat aNumFmt(pActNum->GetLevel(i));
aNumFmt.SetBulletFont(&aActBulletFont);
aNumFmt.SetBulletChar(static_cast<sal_Unicode>(aMap.GetChar()));
pActNum->SetLevel(i, aNumFmt);
}
SetModified();
_nMask <<= 1;
}
SetModified();
}
IMPL_LINK(SvxBulletAndPositionDlg, SizeHdl_Impl, weld::MetricSpinButton&, rField, void)

View File

@@ -358,22 +358,22 @@ IMPL_LINK(SdNavigatorWin, MenuSelectHdl, const OString&, rIdent, void)
sal_uInt32 nMenuId = rIdent.toUInt32();
NavigatorDragType eDT = static_cast<NavigatorDragType>(nMenuId);
if( meDragType != eDT )
if( meDragType == eDT )
return;
meDragType = eDT;
SetDragImage();
if( meDragType == NAVIGATOR_DRAGTYPE_URL )
{
meDragType = eDT;
SetDragImage();
// patch, prevents endless loop
if (mxTlbObjects->count_selected_rows() > 1)
mxTlbObjects->unselect_all();
if( meDragType == NAVIGATOR_DRAGTYPE_URL )
{
// patch, prevents endless loop
if (mxTlbObjects->count_selected_rows() > 1)
mxTlbObjects->unselect_all();
mxTlbObjects->set_selection_mode(SelectionMode::Single);
}
else
mxTlbObjects->set_selection_mode(SelectionMode::Multiple);
mxTlbObjects->set_selection_mode(SelectionMode::Single);
}
else
mxTlbObjects->set_selection_mode(SelectionMode::Multiple);
}
IMPL_LINK( SdNavigatorWin, ShapeFilterCallback, const OString&, rIdent, void )
@@ -390,19 +390,19 @@ IMPL_LINK( SdNavigatorWin, ShapeFilterCallback, const OString&, rIdent, void )
// Remember the selection in the FrameView.
NavDocInfo* pInfo = GetDocInfo();
if (pInfo != nullptr)
if (pInfo == nullptr)
return;
::sd::DrawDocShell* pDocShell = pInfo->mpDocShell;
if (pDocShell != nullptr)
{
::sd::DrawDocShell* pDocShell = pInfo->mpDocShell;
if (pDocShell != nullptr)
::sd::ViewShell* pViewShell = pDocShell->GetViewShell();
if (pViewShell != nullptr)
{
::sd::ViewShell* pViewShell = pDocShell->GetViewShell();
if (pViewShell != nullptr)
::sd::FrameView* pFrameView = pViewShell->GetFrameView();
if (pFrameView != nullptr)
{
::sd::FrameView* pFrameView = pViewShell->GetFrameView();
if (pFrameView != nullptr)
{
pFrameView->SetIsNavigatorShowingAllShapes(bShowAllShapes);
}
pFrameView->SetIsNavigatorShowingAllShapes(bShowAllShapes);
}
}
}

View File

@@ -111,29 +111,29 @@ void FuConstructBezierPolygon::DoExecute( SfxRequest& rReq )
if( SfxItemState::SET == pArgs->GetItemState( SID_ADD_MOTION_PATH, true, &pPoolItem ) )
maTargets = static_cast<const SfxUnoAnyItem*>( pPoolItem )->GetValue();
if (nSlotId == SID_DRAW_FREELINE_NOFILL)
{
const SfxUInt16Item* pTransparence = rReq.GetArg<SfxUInt16Item>(FN_PARAM_1);
const SfxStringItem* pColor = rReq.GetArg<SfxStringItem>(FN_PARAM_2);
const SfxUInt16Item* pWidth = rReq.GetArg<SfxUInt16Item>(FN_PARAM_3);
const SfxStringItem* pShapeName = rReq.GetArg<SfxStringItem>(SID_SHAPE_NAME);
if (nSlotId != SID_DRAW_FREELINE_NOFILL)
return;
if (pTransparence && pTransparence->GetValue() > 0)
{
mnTransparence = pTransparence->GetValue();
}
if (pColor && !pColor->GetValue().isEmpty())
{
msColor = pColor->GetValue();
}
if (pWidth && pWidth->GetValue() > 0)
{
mnWidth = pWidth->GetValue();
}
if (pShapeName && !pShapeName->GetValue().isEmpty())
{
msShapeName = pShapeName->GetValue();
}
const SfxUInt16Item* pTransparence = rReq.GetArg<SfxUInt16Item>(FN_PARAM_1);
const SfxStringItem* pColor = rReq.GetArg<SfxStringItem>(FN_PARAM_2);
const SfxUInt16Item* pWidth = rReq.GetArg<SfxUInt16Item>(FN_PARAM_3);
const SfxStringItem* pShapeName = rReq.GetArg<SfxStringItem>(SID_SHAPE_NAME);
if (pTransparence && pTransparence->GetValue() > 0)
{
mnTransparence = pTransparence->GetValue();
}
if (pColor && !pColor->GetValue().isEmpty())
{
msColor = pColor->GetValue();
}
if (pWidth && pWidth->GetValue() > 0)
{
mnWidth = pWidth->GetValue();
}
if (pShapeName && !pShapeName->GetValue().isEmpty())
{
msShapeName = pShapeName->GetValue();
}
}

View File

@@ -172,18 +172,18 @@ IMPL_LINK(MasterPagesSelector, RightClickHandler, const MouseEvent&, rEvent, voi
mxPreviewValueSet->GrabFocus ();
mxPreviewValueSet->ReleaseMouse();
SfxViewFrame* pViewFrame = mrBase.GetViewFrame();
if (pViewFrame != nullptr)
if (pViewFrame == nullptr)
return;
SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
if (pDispatcher != nullptr)
{
SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
if (pDispatcher != nullptr)
sal_uInt16 nIndex = mxPreviewValueSet->GetItemId (rEvent.GetPosPixel());
if (nIndex > 0)
{
sal_uInt16 nIndex = mxPreviewValueSet->GetItemId (rEvent.GetPosPixel());
if (nIndex > 0)
{
mxPreviewValueSet->SelectItem (nIndex);
// Now do the actual display of the context menu
ShowContextMenu(&rEvent.GetPosPixel());
}
mxPreviewValueSet->SelectItem (nIndex);
// Now do the actual display of the context menu
ShowContextMenu(&rEvent.GetPosPixel());
}
}
}
@@ -193,35 +193,35 @@ void MasterPagesSelector::ShowContextMenu(const Point* pPos)
// Use the currently selected item and show the popup menu in its
// center.
const sal_uInt16 nIndex = mxPreviewValueSet->GetSelectedItemId();
if (nIndex > 0)
if (nIndex <= 0)
return;
// The position of the upper left corner of the context menu is
// taken either from the mouse position (when the command was sent
// as reaction to a right click) or in the center of the selected
// item (when the command was sent as reaction to Shift+F10.)
Point aPosition;
if (!pPos)
{
// The position of the upper left corner of the context menu is
// taken either from the mouse position (when the command was sent
// as reaction to a right click) or in the center of the selected
// item (when the command was sent as reaction to Shift+F10.)
Point aPosition;
if (!pPos)
{
::tools::Rectangle aBBox (mxPreviewValueSet->GetItemRect(nIndex));
aPosition = aBBox.Center();
}
else
aPosition = *pPos;
// Setup the menu.
VclBuilder aBuilder(nullptr, AllSettings::GetUIRootDir(), GetContextMenuUIFile(), "");
VclPtr<PopupMenu> pMenu(aBuilder.get_menu("menu"));
FloatingWindow* pMenuWindow = dynamic_cast<FloatingWindow*>(pMenu->GetWindow());
if (pMenuWindow != nullptr)
pMenuWindow->SetPopupModeFlags(
pMenuWindow->GetPopupModeFlags() | FloatWinPopupFlags::NoMouseUpClose);
pMenu->SetSelectHdl(LINK(this, MasterPagesSelector, OnMenuItemSelected));
ProcessPopupMenu(*pMenu);
// Show the menu.
pMenu->Execute(this, ::tools::Rectangle(aPosition,Size(1,1)), PopupMenuFlags::ExecuteDown);
::tools::Rectangle aBBox (mxPreviewValueSet->GetItemRect(nIndex));
aPosition = aBBox.Center();
}
else
aPosition = *pPos;
// Setup the menu.
VclBuilder aBuilder(nullptr, AllSettings::GetUIRootDir(), GetContextMenuUIFile(), "");
VclPtr<PopupMenu> pMenu(aBuilder.get_menu("menu"));
FloatingWindow* pMenuWindow = dynamic_cast<FloatingWindow*>(pMenu->GetWindow());
if (pMenuWindow != nullptr)
pMenuWindow->SetPopupModeFlags(
pMenuWindow->GetPopupModeFlags() | FloatWinPopupFlags::NoMouseUpClose);
pMenu->SetSelectHdl(LINK(this, MasterPagesSelector, OnMenuItemSelected));
ProcessPopupMenu(*pMenu);
// Show the menu.
pMenu->Execute(this, ::tools::Rectangle(aPosition,Size(1,1)), PopupMenuFlags::ExecuteDown);
}
void MasterPagesSelector::Command (const CommandEvent& rEvent)

View File

@@ -1080,18 +1080,18 @@ IMPL_LINK_NOARG(SlideBackground, PaperSizeModifyHdl, weld::ComboBox&, void)
{ &aSizeItem, mpPageItem.get(), &aFitObjs });
// Notify LOK clients of the page size change.
if (comphelper::LibreOfficeKit::isActive())
if (!comphelper::LibreOfficeKit::isActive())
return;
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
{
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
if (pViewShell->GetDocId() == mrBase.GetDocId())
{
if (pViewShell->GetDocId() == mrBase.GetDocId())
{
SdXImpressDocument* pDoc = comphelper::getUnoTunnelImplementation<SdXImpressDocument>(pViewShell->GetCurrentDocument());
SfxLokHelper::notifyDocumentSizeChangedAllViews(pDoc);
}
pViewShell = SfxViewShell::GetNext(*pViewShell);
SdXImpressDocument* pDoc = comphelper::getUnoTunnelImplementation<SdXImpressDocument>(pViewShell->GetCurrentDocument());
SfxLokHelper::notifyDocumentSizeChangedAllViews(pDoc);
}
pViewShell = SfxViewShell::GetNext(*pViewShell);
}
}

View File

@@ -1613,33 +1613,33 @@ void SdOutliner::EnterEditMode (bool bGrabFocus)
// Make FuText the current function.
SfxUInt16Item aItem (SID_TEXTEDIT, 1);
std::shared_ptr<sd::ViewShell> pViewShell (mpWeakViewShell.lock());
if (pViewShell && pViewShell->GetDispatcher())
if (!(pViewShell && pViewShell->GetDispatcher()))
return;
pViewShell->GetDispatcher()->ExecuteList(
SID_TEXTEDIT, SfxCallMode::SYNCHRON | SfxCallMode::RECORD, {&aItem});
if (mpView->IsTextEdit())
{
pViewShell->GetDispatcher()->ExecuteList(
SID_TEXTEDIT, SfxCallMode::SYNCHRON | SfxCallMode::RECORD, {&aItem});
if (mpView->IsTextEdit())
{
// end text edition before starting it again
mpView->SdrEndTextEdit();
}
// To be consistent with the usual behaviour in the Office the text
// object that is put into edit mode would have also to be selected.
// Starting the text edit mode is not enough so we do it here by
// hand.
mpView->UnmarkAllObj(pPV);
mpView->MarkObj(mpSearchSpellTextObj, pPV);
mpSearchSpellTextObj->setActiveText(mnText);
// Turn on the edit mode for the text object.
mpView->SdrBeginTextEdit(mpSearchSpellTextObj, pPV, mpWindow, true, this,
pOutlinerView, true, true, bGrabFocus);
SetUpdateMode(true);
mbFoundObject = true;
// end text edition before starting it again
mpView->SdrEndTextEdit();
}
// To be consistent with the usual behaviour in the Office the text
// object that is put into edit mode would have also to be selected.
// Starting the text edit mode is not enough so we do it here by
// hand.
mpView->UnmarkAllObj(pPV);
mpView->MarkObj(mpSearchSpellTextObj, pPV);
mpSearchSpellTextObj->setActiveText(mnText);
// Turn on the edit mode for the text object.
mpView->SdrBeginTextEdit(mpSearchSpellTextObj, pPV, mpWindow, true, this,
pOutlinerView, true, true, bGrabFocus);
SetUpdateMode(true);
mbFoundObject = true;
}
ESelection SdOutliner::GetSearchStartPosition() const

View File

@@ -294,112 +294,112 @@ bool DrawView::SetAttributes(const SfxItemSet& rSet,
void DrawView::SetMasterAttributes( SdrObject* pObject, const SdPage& rPage, SfxItemSet rSet, SfxStyleSheetBasePool* pStShPool, bool& bOk, bool bMaster, bool bSlide )
{
SdrInventor nInv = pObject->GetObjInventor();
SdrInventor nInv = pObject->GetObjInventor();
if (nInv == SdrInventor::Default)
{
sal_uInt16 eObjKind = pObject->GetObjIdentifier();
PresObjKind ePresObjKind = rPage.GetPresObjKind(pObject);
if (bSlide && eObjKind == OBJ_TEXT)
if (nInv != SdrInventor::Default)
return;
sal_uInt16 eObjKind = pObject->GetObjIdentifier();
PresObjKind ePresObjKind = rPage.GetPresObjKind(pObject);
if (bSlide && eObjKind == OBJ_TEXT)
{
// Presentation object (except outline)
SfxStyleSheet* pSheet = rPage.GetTextStyleSheetForObject(pObject);
DBG_ASSERT(pSheet, "StyleSheet not found");
SfxItemSet aTempSet( pSheet->GetItemSet() );
aTempSet.Put( rSet );
aTempSet.ClearInvalidItems();
// Undo-Action
mpDocSh->GetUndoManager()->AddUndoAction(
std::make_unique<StyleSheetUndoAction>(&mrDoc, pSheet, &aTempSet));
pSheet->GetItemSet().Put(aTempSet,false);
pSheet->Broadcast(SfxHint(SfxHintId::DataChanged));
bOk = true;
}
if (!bSlide &&
(ePresObjKind == PresObjKind::Title ||
ePresObjKind == PresObjKind::Notes))
{
// Presentation object (except outline)
SfxStyleSheet* pSheet = rPage.GetStyleSheetForPresObj( ePresObjKind );
DBG_ASSERT(pSheet, "StyleSheet not found");
SfxItemSet aTempSet( pSheet->GetItemSet() );
aTempSet.Put( rSet );
aTempSet.ClearInvalidItems();
// Undo-Action
mpDocSh->GetUndoManager()->AddUndoAction(
std::make_unique<StyleSheetUndoAction>(&mrDoc, pSheet, &aTempSet));
pSheet->GetItemSet().Put(aTempSet,false);
pSheet->Broadcast(SfxHint(SfxHintId::DataChanged));
bOk = true;
}
else if (eObjKind == OBJ_OUTLINETEXT)
{
if (bMaster)
{
// Presentation object (except outline)
SfxStyleSheet* pSheet = rPage.GetTextStyleSheetForObject(pObject);
DBG_ASSERT(pSheet, "StyleSheet not found");
SfxItemSet aTempSet( pSheet->GetItemSet() );
aTempSet.Put( rSet );
aTempSet.ClearInvalidItems();
// Undo-Action
mpDocSh->GetUndoManager()->AddUndoAction(
std::make_unique<StyleSheetUndoAction>(&mrDoc, pSheet, &aTempSet));
pSheet->GetItemSet().Put(aTempSet,false);
pSheet->Broadcast(SfxHint(SfxHintId::DataChanged));
bOk = true;
}
if (!bSlide &&
(ePresObjKind == PresObjKind::Title ||
ePresObjKind == PresObjKind::Notes))
{
// Presentation object (except outline)
SfxStyleSheet* pSheet = rPage.GetStyleSheetForPresObj( ePresObjKind );
DBG_ASSERT(pSheet, "StyleSheet not found");
SfxItemSet aTempSet( pSheet->GetItemSet() );
aTempSet.Put( rSet );
aTempSet.ClearInvalidItems();
// Undo-Action
mpDocSh->GetUndoManager()->AddUndoAction(
std::make_unique<StyleSheetUndoAction>(&mrDoc, pSheet, &aTempSet));
pSheet->GetItemSet().Put(aTempSet,false);
pSheet->Broadcast(SfxHint(SfxHintId::DataChanged));
bOk = true;
}
else if (eObjKind == OBJ_OUTLINETEXT)
{
if (bMaster)
// Presentation object outline
for (sal_uInt16 nLevel = 9; nLevel > 0; nLevel--)
{
// Presentation object outline
for (sal_uInt16 nLevel = 9; nLevel > 0; nLevel--)
OUString aName = rPage.GetLayoutName() + " " +
OUString::number(nLevel);
SfxStyleSheet* pSheet = static_cast<SfxStyleSheet*>(pStShPool->
Find(aName, SfxStyleFamily::Page));
DBG_ASSERT(pSheet, "StyleSheet not found");
SfxItemSet aTempSet( pSheet->GetItemSet() );
if( nLevel > 1 )
{
OUString aName = rPage.GetLayoutName() + " " +
OUString::number(nLevel);
SfxStyleSheet* pSheet = static_cast<SfxStyleSheet*>(pStShPool->
Find(aName, SfxStyleFamily::Page));
DBG_ASSERT(pSheet, "StyleSheet not found");
SfxItemSet aTempSet( pSheet->GetItemSet() );
if( nLevel > 1 )
// for all levels over 1, clear all items that will be
// hard set to level 1
SfxWhichIter aWhichIter(rSet);
sal_uInt16 nWhich(aWhichIter.FirstWhich());
while( nWhich )
{
// for all levels over 1, clear all items that will be
// hard set to level 1
SfxWhichIter aWhichIter(rSet);
sal_uInt16 nWhich(aWhichIter.FirstWhich());
while( nWhich )
{
if( SfxItemState::SET == rSet.GetItemState( nWhich ) )
aTempSet.ClearItem( nWhich );
nWhich = aWhichIter.NextWhich();
}
}
else
{
// put the items hard into level one
aTempSet.Put( rSet );
if( SfxItemState::SET == rSet.GetItemState( nWhich ) )
aTempSet.ClearItem( nWhich );
nWhich = aWhichIter.NextWhich();
}
aTempSet.ClearInvalidItems();
// Undo-Action
mpDocSh->GetUndoManager()->AddUndoAction(
std::make_unique<StyleSheetUndoAction>(&mrDoc, pSheet, &aTempSet));
pSheet->GetItemSet().Set(aTempSet,false);
pSheet->Broadcast(SfxHint(SfxHintId::DataChanged));
}
// remove all hard set items from shape that are now set in style
SfxWhichIter aWhichIter(rSet);
sal_uInt16 nWhich(aWhichIter.FirstWhich());
while( nWhich )
else
{
if( SfxItemState::SET == rSet.GetItemState( nWhich ) )
pObject->ClearMergedItem( nWhich );
nWhich = aWhichIter.NextWhich();
// put the items hard into level one
aTempSet.Put( rSet );
}
aTempSet.ClearInvalidItems();
// Undo-Action
mpDocSh->GetUndoManager()->AddUndoAction(
std::make_unique<StyleSheetUndoAction>(&mrDoc, pSheet, &aTempSet));
pSheet->GetItemSet().Set(aTempSet,false);
pSheet->Broadcast(SfxHint(SfxHintId::DataChanged));
}
else
pObject->SetMergedItemSet(rSet);
bOk = true;
// remove all hard set items from shape that are now set in style
SfxWhichIter aWhichIter(rSet);
sal_uInt16 nWhich(aWhichIter.FirstWhich());
while( nWhich )
{
if( SfxItemState::SET == rSet.GetItemState( nWhich ) )
pObject->ClearMergedItem( nWhich );
nWhich = aWhichIter.NextWhich();
}
}
}
else
pObject->SetMergedItemSet(rSet);
bOk = true;
}
}
/**

View File

@@ -75,30 +75,30 @@ namespace
OUString sColor;
const SfxPoolItem* pColorStringItem = nullptr;
if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pColorStringItem))
if (SfxItemState::SET != pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pColorStringItem))
return;
sColor = static_cast<const SfxStringItem*>(pColorStringItem)->GetValue();
if (sColor == "transparent")
aColor = COL_TRANSPARENT;
else
aColor = Color(sColor.toInt32(16));
switch (nSlot)
{
sColor = static_cast<const SfxStringItem*>(pColorStringItem)->GetValue();
if (sColor == "transparent")
aColor = COL_TRANSPARENT;
else
aColor = Color(sColor.toInt32(16));
switch (nSlot)
case SID_ATTR_CHAR_COLOR:
{
case SID_ATTR_CHAR_COLOR:
{
SvxColorItem aColorItem(aColor, EE_CHAR_COLOR);
pArgs->Put(aColorItem);
break;
}
SvxColorItem aColorItem(aColor, EE_CHAR_COLOR);
pArgs->Put(aColorItem);
break;
}
case SID_ATTR_CHAR_BACK_COLOR:
{
SvxBackgroundColorItem pBackgroundItem(aColor, EE_CHAR_BKGCOLOR);
pArgs->Put(pBackgroundItem);
break;
}
case SID_ATTR_CHAR_BACK_COLOR:
{
SvxBackgroundColorItem pBackgroundItem(aColor, EE_CHAR_BKGCOLOR);
pArgs->Put(pBackgroundItem);
break;
}
}
}