From 94c8d24c100c876de416ea51a9330d5b21c1c16b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 1 Dec 2010 09:57:04 +0100 Subject: dba34b: removed unused includes --- svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx | 3 --- 1 file changed, 3 deletions(-) (limited to 'svx') diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index d7df0a932f9c..8f7e36769318 100755 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -57,8 +57,6 @@ #include /** === end UNO includes === **/ -#include -#include #include #include #include @@ -69,7 +67,6 @@ #include #include -#include #include /* -- cgit From 2e082fe92cc64f6abee53440be67ff39bc83e433 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 2 Dec 2010 14:16:42 +0100 Subject: dba34c: #i115876# --- svx/source/form/fmobj.cxx | 4 +++- svx/source/form/fmpgeimp.cxx | 33 ++++++++++++++++++++++++++++----- svx/source/inc/fmpgeimp.hxx | 1 + 3 files changed, 32 insertions(+), 6 deletions(-) (limited to 'svx') diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx index e679779887a2..ba2fba4f40f3 100644 --- a/svx/source/form/fmobj.cxx +++ b/svx/source/form/fmobj.cxx @@ -650,7 +650,9 @@ void FmFormObj::SetUnoControlModel( const Reference< com::sun::star::awt::XContr { SdrUnoObj::SetUnoControlModel( _rxModel ); - // TODO: call something like formObjectInserted at the form page, to tell it the new model + FmFormPage* pFormPage = PTR_CAST( FmFormPage, GetPage() ); + if ( pFormPage ) + pFormPage->GetImpl().formModelAssigned( *this ); impl_checkRefDevice_nothrow( true ); } diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx index 3ade4bdd3091..ceafd55566e2 100644 --- a/svx/source/form/fmpgeimp.cxx +++ b/svx/source/form/fmpgeimp.cxx @@ -275,7 +275,7 @@ namespace _map->put( makeAny( xControlModel ), makeAny( xControlShape ) ); } - static void lcl_removeFormObject( const FmFormObj& _object, const Reference< XMap >& _map ) + static void lcl_removeFormObject_throw( const FmFormObj& _object, const Reference< XMap >& _map, bool i_ignoreNonExistence = false ) { // the control model Reference< XControlModel > xControlModel( _object.GetUnoControlModel(), UNO_QUERY ); @@ -287,8 +287,11 @@ namespace Any aOldAssignment = #endif _map->remove( makeAny( xControlModel ) ); - OSL_ENSURE( aOldAssignment == makeAny( Reference< XControlShape >( const_cast< FmFormObj& >( _object ).getUnoShape(), UNO_QUERY ) ), - "lcl_removeFormObject: map was inconsistent!" ); + (void)aOldAssignment; + OSL_ENSURE( !i_ignoreNonExistence || + ( aOldAssignment == makeAny( Reference< XControlShape >( const_cast< FmFormObj& >( _object ).getUnoShape(), UNO_QUERY ) ) ), + "lcl_removeFormObject: map was inconsistent!" ); + (void)i_ignoreNonExistence; } } @@ -703,7 +706,26 @@ Reference< XForm > FmFormPageImpl::findFormForDataSource( return sName; } -//------------------------------------------------------------------ +//---------------------------------------------------------------------------------------------------------------------- +void FmFormPageImpl::formModelAssigned( const FmFormObj& _object ) +{ + Reference< XMap > xControlShapeMap( m_aControlShapeMap.get(), UNO_QUERY ); + if ( !xControlShapeMap.is() ) + // our map does not exist -> not interested in this event + return; + + try + { + lcl_removeFormObject_throw( _object, xControlShapeMap, false ); + lcl_insertFormObject_throw( _object, xControlShapeMap ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + +//---------------------------------------------------------------------------------------------------------------------- void FmFormPageImpl::formObjectInserted( const FmFormObj& _object ) { Reference< XMap > xControlShapeMap( m_aControlShapeMap.get(), UNO_QUERY ); @@ -721,6 +743,7 @@ void FmFormPageImpl::formObjectInserted( const FmFormObj& _object ) } } +//---------------------------------------------------------------------------------------------------------------------- void FmFormPageImpl::formObjectRemoved( const FmFormObj& _object ) { Reference< XMap > xControlShapeMap( m_aControlShapeMap.get(), UNO_QUERY ); @@ -730,7 +753,7 @@ void FmFormPageImpl::formObjectRemoved( const FmFormObj& _object ) try { - lcl_removeFormObject( _object, xControlShapeMap ); + lcl_removeFormObject_throw( _object, xControlShapeMap ); } catch( const Exception& ) { diff --git a/svx/source/inc/fmpgeimp.hxx b/svx/source/inc/fmpgeimp.hxx index 755c754853dc..d5061af70bdf 100644 --- a/svx/source/inc/fmpgeimp.hxx +++ b/svx/source/inc/fmpgeimp.hxx @@ -135,6 +135,7 @@ public: void formObjectInserted( const FmFormObj& _object ); void formObjectRemoved( const FmFormObj& _object ); + void formModelAssigned( const FmFormObj& _object ); /** returns an object mapping from control models to drawing shapes. */ -- cgit From ea6c7c0d73e7d898d6e4759cb33997b7a48d2bd7 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 2 Dec 2010 15:29:46 +0100 Subject: dba34c: FmFormPageImpl needs late init, else the 'copy-ctor' crashs after the previous change --- svx/source/form/fmpage.cxx | 5 ++++- svx/source/form/fmpgeimp.cxx | 13 +++++-------- svx/source/inc/fmpgeimp.hxx | 3 ++- 3 files changed, 11 insertions(+), 10 deletions(-) (limited to 'svx') diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx index 0a5c7da9ea3c..94c6e80dcc07 100644 --- a/svx/source/form/fmpage.cxx +++ b/svx/source/form/fmpage.cxx @@ -105,12 +105,15 @@ FmFormPage::FmFormPage(FmFormModel& rModel, StarBASIC* _pBasic, FASTBOOL bMaster FmFormPage::FmFormPage(const FmFormPage& rPage) :SdrPage(rPage) #ifndef SVX_LIGHT - ,m_pImpl(new FmFormPageImpl( *this, rPage.GetImpl() ) ) + ,m_pImpl(new FmFormPageImpl( *this ) ) #else ,m_pImpl(NULL) #endif ,m_pBasic(0) { +#ifndef SVX_LIGHT + m_pImpl->initFrom( rPage.GetImpl() ); +#endif RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "svx", "Ocke.Janssen@sun.com", "FmFormPage::FmFormPage" ); m_sPageName = rPage.m_sPageName; } diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx index ceafd55566e2..ec612e2ea782 100644 --- a/svx/source/form/fmpgeimp.cxx +++ b/svx/source/form/fmpgeimp.cxx @@ -167,19 +167,16 @@ namespace } //------------------------------------------------------------------------------ -FmFormPageImpl::FmFormPageImpl( FmFormPage& _rPage, const FmFormPageImpl& rImpl ) - :m_rPage( _rPage ) - ,m_bFirstActivation( sal_True ) - ,m_bAttemptedFormCreation( false ) +void FmFormPageImpl::initFrom( FmFormPageImpl& i_foreignImpl ) { DBG_CTOR(FmFormPageImpl,NULL); // clone the Forms collection - Reference< XCloneable > xCloneable( const_cast< FmFormPageImpl& >( rImpl ).getForms( false ), UNO_QUERY ); + Reference< XCloneable > xCloneable( const_cast< FmFormPageImpl& >( i_foreignImpl ).getForms( false ), UNO_QUERY ); if ( !xCloneable.is() ) { // great, nothing to do - OSL_ENSURE( !const_cast< FmFormPageImpl& >( rImpl ).getForms( false ).is(), "FmFormPageImpl::FmFormPageImpl: a non-cloneable forms container!?" ); + OSL_ENSURE( !const_cast< FmFormPageImpl& >( i_foreignImpl ).getForms( false ).is(), "FmFormPageImpl::FmFormPageImpl: a non-cloneable forms container!?" ); return; } try @@ -196,7 +193,7 @@ FmFormPageImpl::FmFormPageImpl( FmFormPage& _rPage, const FmFormPageImpl& rImpl aVisitor.process( FormComponentPair( xCloneable, m_xForms ), aAssignmentProcessor ); // assign the cloned models to their SdrObjects - SdrObjListIter aForeignIter( rImpl.m_rPage ); + SdrObjListIter aForeignIter( i_foreignImpl.m_rPage ); SdrObjListIter aOwnIter( m_rPage ); OSL_ENSURE( aForeignIter.IsMore() == aOwnIter.IsMore(), "FmFormPageImpl::FmFormPageImpl: inconsistent number of objects (1)!" ); @@ -230,7 +227,7 @@ FmFormPageImpl::FmFormPageImpl( FmFormPage& _rPage, const FmFormPageImpl& rImpl MapControlModels::const_iterator assignment = aModelAssignment.find( xForeignModel ); OSL_ENSURE( assignment != aModelAssignment.end(), "FmFormPageImpl::FmFormPageImpl: no clone found for this model!" ); if ( assignment == aModelAssignment.end() ) - // the source SdrObject has a model, but it is not part of the model hierarchy in rImpl.getForms(). + // the source SdrObject has a model, but it is not part of the model hierarchy in i_foreignImpl.getForms(). // Pathological, too ... continue; diff --git a/svx/source/inc/fmpgeimp.hxx b/svx/source/inc/fmpgeimp.hxx index d5061af70bdf..9eb91c809d66 100644 --- a/svx/source/inc/fmpgeimp.hxx +++ b/svx/source/inc/fmpgeimp.hxx @@ -81,9 +81,10 @@ protected: public: FmFormPageImpl( FmFormPage& _rPage ); - FmFormPageImpl( FmFormPage& _rPage, const FmFormPageImpl& rImpl ); ~FmFormPageImpl(); + void initFrom( FmFormPageImpl& i_foreignImpl ); + // nur wichtig fuer den DesignMode void setCurForm(::com::sun::star::uno::Reference< ::com::sun::star::form::XForm> xForm); ::com::sun::star::uno::Reference< ::com::sun::star::form::XForm> getDefaultForm(); -- cgit From 455c3c0ca387adde8aeafe598cb49f730d655bd9 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 3 Dec 2010 10:20:34 +0100 Subject: dba34c: #i115880# removed assertion - it does not really indicate a problem, and preventing it otherwise would be unreasonably expensive --- svx/source/form/fmpgeimp.cxx | 34 ++++++++------------- svx/source/svdraw/svdouno.cxx | 71 +++++++++---------------------------------- 2 files changed, 27 insertions(+), 78 deletions(-) (limited to 'svx') diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx index ec612e2ea782..a582d97d8d15 100644 --- a/svx/source/form/fmpgeimp.cxx +++ b/svx/source/form/fmpgeimp.cxx @@ -169,16 +169,16 @@ namespace //------------------------------------------------------------------------------ void FmFormPageImpl::initFrom( FmFormPageImpl& i_foreignImpl ) { - DBG_CTOR(FmFormPageImpl,NULL); - // clone the Forms collection - Reference< XCloneable > xCloneable( const_cast< FmFormPageImpl& >( i_foreignImpl ).getForms( false ), UNO_QUERY ); + const Reference< XNameContainer > xForeignForms( const_cast< FmFormPageImpl& >( i_foreignImpl ).getForms( false ) ); + const Reference< XCloneable > xCloneable( xForeignForms, UNO_QUERY ); if ( !xCloneable.is() ) { // great, nothing to do - OSL_ENSURE( !const_cast< FmFormPageImpl& >( i_foreignImpl ).getForms( false ).is(), "FmFormPageImpl::FmFormPageImpl: a non-cloneable forms container!?" ); + OSL_ENSURE( !xForeignForms.is(), "FmFormPageImpl::FmFormPageImpl: a non-cloneable forms container!?" ); return; } + try { m_xForms.set( xCloneable->createClone(), UNO_QUERY_THROW ); @@ -205,31 +205,23 @@ void FmFormPageImpl::initFrom( FmFormPageImpl& i_foreignImpl ) bool bForeignIsForm = pForeignObj && ( pForeignObj->GetObjInventor() == FmFormInventor ); bool bOwnIsForm = pOwnObj && ( pOwnObj->GetObjInventor() == FmFormInventor ); - if ( bForeignIsForm != bOwnIsForm ) - { - OSL_ENSURE( false, "FmFormPageImpl::FmFormPageImpl: inconsistent ordering of objects!" ); - // don't attempt to do further assignments, something's completely messed up - break; - } + ENSURE_OR_BREAK( bForeignIsForm == bOwnIsForm, "FmFormPageImpl::FmFormPageImpl: inconsistent ordering of objects!" ); + // if this fires, don't attempt to do further assignments, something's completely messed up + if ( !bForeignIsForm ) // no form control -> next round continue; Reference< XControlModel > xForeignModel( pForeignObj->GetUnoControlModel() ); - OSL_ENSURE( xForeignModel.is(), "FmFormPageImpl::FmFormPageImpl: control shape without control!" ); - if ( !xForeignModel.is() ) - // the SdrObject does not have a UNO Control Model. This is pathological, but well ... So the cloned - // SdrObject will also not have a UNO Control Model. - continue; - - OSL_ENSURE( !pOwnObj->GetUnoControlModel().is(), "FmFormPageImpl::FmFormPageImpl: there already is a control model for the target object!" ); + ENSURE_OR_CONTINUE( xForeignModel.is(), "FmFormPageImpl::FmFormPageImpl: control shape without control!" ); + // if this fires, the SdrObject does not have a UNO Control Model. This is pathological, but well ... + // So the cloned SdrObject will also not have a UNO Control Model. MapControlModels::const_iterator assignment = aModelAssignment.find( xForeignModel ); - OSL_ENSURE( assignment != aModelAssignment.end(), "FmFormPageImpl::FmFormPageImpl: no clone found for this model!" ); - if ( assignment == aModelAssignment.end() ) - // the source SdrObject has a model, but it is not part of the model hierarchy in i_foreignImpl.getForms(). + ENSURE_OR_CONTINUE( assignment != aModelAssignment.end(), "FmFormPageImpl::FmFormPageImpl: no clone found for this model!" ); + // if this fires, the source SdrObject has a model, but it is not part of the model hierarchy in + // i_foreignImpl.getForms(). // Pathological, too ... - continue; pOwnObj->SetUnoControlModel( assignment->second ); } diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx index b98e5ba5c1c6..eeae4d8079a8 100644 --- a/svx/source/svdraw/svdouno.cxx +++ b/svx/source/svdraw/svdouno.cxx @@ -318,68 +318,25 @@ void SdrUnoObj::operator = (const SdrObject& rObj) SdrRectObj::operator = (rObj); // release the reference to the current control model - SetUnoControlModel(uno::Reference< awt::XControlModel >()); + SetUnoControlModel( NULL ); - aUnoControlModelTypeName = ((SdrUnoObj&) rObj).aUnoControlModelTypeName; - aUnoControlTypeName = ((SdrUnoObj&) rObj).aUnoControlTypeName; + const SdrUnoObj& rUnoObj = dynamic_cast< const SdrUnoObj& >( rObj ); - // copy the uno control model - uno::Reference< awt::XControlModel > xCtrl( ((SdrUnoObj&) rObj).GetUnoControlModel(), uno::UNO_QUERY ); - uno::Reference< util::XCloneable > xClone( xCtrl, uno::UNO_QUERY ); + aUnoControlModelTypeName = rUnoObj.aUnoControlModelTypeName; + aUnoControlTypeName = rUnoObj.aUnoControlTypeName; - if ( xClone.is() ) - { - // copy the model by cloning - uno::Reference< awt::XControlModel > xNewModel( xClone->createClone(), uno::UNO_QUERY ); - DBG_ASSERT( xNewModel.is(), "SdrUnoObj::operator =, no control model!"); - xUnoControlModel = xNewModel; - } - else + // copy the uno control model + const uno::Reference< awt::XControlModel > xSourceControlModel( rUnoObj.GetUnoControlModel(), uno::UNO_QUERY ); + if ( xSourceControlModel.is() ) { - // copy the model by streaming - uno::Reference< io::XPersistObject > xObj( xCtrl, uno::UNO_QUERY ); - uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - - if ( xObj.is() && xFactory.is() ) + try { - // creating a pipe - uno::Reference< io::XOutputStream > xOutPipe(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.Pipe")), uno::UNO_QUERY); - uno::Reference< io::XInputStream > xInPipe(xOutPipe, uno::UNO_QUERY); - - // creating the mark streams - uno::Reference< io::XInputStream > xMarkIn(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.MarkableInputStream")), uno::UNO_QUERY); - uno::Reference< io::XActiveDataSink > xMarkSink(xMarkIn, uno::UNO_QUERY); - - uno::Reference< io::XOutputStream > xMarkOut(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.MarkableOutputStream")), uno::UNO_QUERY); - uno::Reference< io::XActiveDataSource > xMarkSource(xMarkOut, uno::UNO_QUERY); - - // connect mark and sink - uno::Reference< io::XActiveDataSink > xSink(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.ObjectInputStream")), uno::UNO_QUERY); - - // connect mark and source - uno::Reference< io::XActiveDataSource > xSource(xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.io.ObjectOutputStream")), uno::UNO_QUERY); - - uno::Reference< io::XObjectOutputStream > xOutStrm(xSource, uno::UNO_QUERY); - uno::Reference< io::XObjectInputStream > xInStrm(xSink, uno::UNO_QUERY); - - if (xMarkSink.is() && xMarkSource.is() && xSink.is() && xSource.is()) - { - xMarkSink->setInputStream(xInPipe); - xMarkSource->setOutputStream(xOutPipe); - xSink->setInputStream(xMarkIn); - xSource->setOutputStream(xMarkOut); - - // write the object to source - xOutStrm->writeObject(xObj); - xOutStrm->closeOutput(); - // read the object - uno::Reference< awt::XControlModel > xModel(xInStrm->readObject(), uno::UNO_QUERY); - xInStrm->closeInput(); - - DBG_ASSERT(xModel.is(), "SdrUnoObj::operator =, keine Model erzeugt"); - - xUnoControlModel = xModel; - } + uno::Reference< util::XCloneable > xClone( xSourceControlModel, uno::UNO_QUERY_THROW ); + xUnoControlModel.set( xClone->createClone(), uno::UNO_QUERY_THROW ); + } + catch( const uno::Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); } } -- cgit From 794b301edcb9e8b52925c35ddeed71d1576dc72a Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 7 Dec 2010 12:19:33 +0100 Subject: dba34c: some slots can be enabled in alive mode as well --- svx/source/form/fmshell.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'svx') diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx index 96bdd27d62e1..cb376a1b4acd 100644 --- a/svx/source/form/fmshell.cxx +++ b/svx/source/form/fmshell.cxx @@ -905,19 +905,19 @@ void FmFormShell::GetState(SfxItemSet &rSet) case SID_FM_USE_WIZARDS: if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::E_SDATABASE ) ) rSet.Put( SfxVisibilityItem( nWhich, sal_False ) ); - else if (!m_bDesignMode || !GetFormModel()) + else if (!GetFormModel()) rSet.DisableItem( nWhich ); else rSet.Put( SfxBoolItem(nWhich, GetImpl()->GetWizardUsing() ) ); break; case SID_FM_AUTOCONTROLFOCUS: - if (!m_bDesignMode || !GetFormModel()) + if (!GetFormModel()) rSet.DisableItem( nWhich ); else rSet.Put( SfxBoolItem(nWhich, GetFormModel()->GetAutoControlFocus() ) ); break; case SID_FM_OPEN_READONLY: - if (!m_bDesignMode || !GetFormModel()) + if (!GetFormModel()) rSet.DisableItem( nWhich ); else rSet.Put( SfxBoolItem(nWhich, GetFormModel()->GetOpenInDesignMode() ) ); -- cgit From 0ca1b7ace4da7df621d38aa9df8fab3e5984577f Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 6 Jan 2011 12:32:17 +0100 Subject: dba34c: #i113405# remove row from rowset when it can not be accessed anymore and adjust rowcount --- svx/source/fmcomp/gridctrl.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'svx') diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 1944bd47dad5..4defba88e3ef 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -2001,6 +2001,18 @@ void DbGridControl::AdjustRows() RowRemoved(GetRowCount() - nDelta, nDelta, sal_False); // es sind Zeilen weggefallen, dann ab der aktuellen Position neu zeichen Invalidate(); + + sal_Int32 nNewPos = AlignSeekCursor(); + if (m_bSynchDisplay) + DbGridControl_Base::GoToRow(nNewPos); + + SetCurrent(nNewPos); + // there are rows so go to the selected current column + if (nRecordCount) + GoToRowColumnId(nNewPos, GetColumnId(GetCurColumnId())); + if (!IsResizing() && GetRowCount()) + RecalcRows(GetTopRow(), GetVisibleRows(), sal_True); + m_aBar.InvalidateAll(m_nCurrentPos, sal_True); } else // zuwenig RowInserted(GetRowCount(), -nDelta, sal_True); -- cgit From ea51944d952612269d8a5ceb3dad9e019e81e4a5 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 12 Jan 2011 14:27:13 +0100 Subject: dba34c: unused var when not in debug --- svx/source/form/fmpgeimp.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'svx') diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx index 90f12f411447..9aeae3856ff6 100644 --- a/svx/source/form/fmpgeimp.cxx +++ b/svx/source/form/fmpgeimp.cxx @@ -276,11 +276,15 @@ namespace Any aOldAssignment = #endif _map->remove( makeAny( xControlModel ) ); + #if OSL_DEBUG_LEVEL > 0 (void)aOldAssignment; + #endif OSL_ENSURE( !i_ignoreNonExistence || ( aOldAssignment == makeAny( Reference< XControlShape >( const_cast< FmFormObj& >( _object ).getUnoShape(), UNO_QUERY ) ) ), "lcl_removeFormObject: map was inconsistent!" ); + #if OSL_DEBUG_LEVEL > 0 (void)i_ignoreNonExistence; + #endif } } -- cgit From c61e2a722864969fb5835df68c86c993934ad431 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 13 Jan 2011 14:31:54 +0100 Subject: dba34c: compile error --- svx/source/form/fmpgeimp.cxx | 2 -- 1 file changed, 2 deletions(-) (limited to 'svx') diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx index 9aeae3856ff6..a0d2f5a3c47a 100644 --- a/svx/source/form/fmpgeimp.cxx +++ b/svx/source/form/fmpgeimp.cxx @@ -282,9 +282,7 @@ namespace OSL_ENSURE( !i_ignoreNonExistence || ( aOldAssignment == makeAny( Reference< XControlShape >( const_cast< FmFormObj& >( _object ).getUnoShape(), UNO_QUERY ) ) ), "lcl_removeFormObject: map was inconsistent!" ); - #if OSL_DEBUG_LEVEL > 0 (void)i_ignoreNonExistence; - #endif } } -- cgit From 710128334ee6f2dd538a67d2ecaf2d7b07bb6868 Mon Sep 17 00:00:00 2001 From: ka Date: Fri, 4 Feb 2011 14:49:25 +0100 Subject: ka102: SVG import implementation --- svx/inc/svx/svdograf.hxx | 1 + svx/source/dialog/_bmpmask.cxx | 3 +++ svx/source/gallery2/galtheme.cxx | 1 + svx/source/svdraw/svdedtv.cxx | 6 +++++- svx/source/svdraw/svdfmtf.cxx | 25 +++++++++++++++++++++++-- svx/source/svdraw/svdfmtf.hxx | 1 + svx/source/svdraw/svdograf.cxx | 18 ++++++++++++------ svx/source/xml/xmlgrhlp.cxx | 9 +++++---- 8 files changed, 51 insertions(+), 13 deletions(-) (limited to 'svx') diff --git a/svx/inc/svx/svdograf.hxx b/svx/inc/svx/svdograf.hxx index 1eba8822402a..c76c77ec325a 100644 --- a/svx/inc/svx/svdograf.hxx +++ b/svx/inc/svx/svdograf.hxx @@ -148,6 +148,7 @@ public: // Keep ATM for SD. sal_Bool IsAnimated() const; sal_Bool IsEPS() const; + sal_Bool IsRenderGraphic() const; sal_Bool IsSwappedOut() const; const MapMode& GetGrafPrefMapMode() const; diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index d010109d34b3..71b50a93f894 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -1001,6 +1001,9 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile& rMtf ) default: { + OSL_ENSURE( pAction->GetType() != META_RENDERGRAPHIC_ACTION, + "META_RENDERGRAPHIC_ACTION currently not supported at masking" ); + pAction->Duplicate(); aMtf.AddAction( pAction ); } diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 730c1179a07e..9e34e463c805 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -901,6 +901,7 @@ BOOL GalleryTheme::InsertGraphic( const Graphic& rGraphic, ULONG nInsertPos ) case( GFX_LINK_TYPE_NATIVE_WMF ): nExportFormat = CVT_WMF; break; case( GFX_LINK_TYPE_NATIVE_MET ): nExportFormat = CVT_MET; break; case( GFX_LINK_TYPE_NATIVE_PCT ): nExportFormat = CVT_PCT; break; + case( GFX_LINK_TYPE_NATIVE_SVG ): nExportFormat = CVT_SVG; break; default: break; } diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index d2c1e7bc52ef..05d7c7711430 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -644,8 +644,12 @@ void SdrEditView::CheckPossibilities() BOOL bGraf=HAS_BASE(SdrGrafObj,pObj); BOOL bOle2=HAS_BASE(SdrOle2Obj,pObj); - if( bGraf && ((SdrGrafObj*)pObj)->HasGDIMetaFile() && !((SdrGrafObj*)pObj)->IsEPS() ) + if( bGraf && + ((SdrGrafObj*)pObj)->HasGDIMetaFile() && + !( ((SdrGrafObj*)pObj)->IsEPS() || ((SdrGrafObj*)pObj)->IsRenderGraphic() ) ) + { bImportMtfPossible = TRUE; + } if (bOle2) bImportMtfPossible=((SdrOle2Obj*)pObj)->GetObjRef().is(); diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index f10610317578..cf282aab3dc7 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -195,7 +195,7 @@ ULONG ImpSdrGDIMetaFileImport::DoImport(const GDIMetaFile& rMtf, case META_POP_ACTION : DoAction((MetaPopAction &)*pAct); break; case META_HATCH_ACTION : DoAction((MetaHatchAction &)*pAct); break; case META_COMMENT_ACTION : DoAction((MetaCommentAction &)*pAct, pMtf); break; - + case META_RENDERGRAPHIC_ACTION : DoAction((MetaRenderGraphicAction &)*pAct); break; } if(pProgrInfo != NULL) @@ -272,7 +272,7 @@ void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, FASTBOOL bForceText { bNoLine = FALSE; bNoFill = FALSE; FASTBOOL bLine=TRUE && !bForceTextAttr; - FASTBOOL bFill=pObj==NULL || pObj->IsClosedObj() && !bForceTextAttr; + FASTBOOL bFill=pObj==NULL || ( pObj->IsClosedObj() && !bForceTextAttr ); FASTBOOL bText=bForceTextAttr || (pObj!=NULL && pObj->GetOutlinerParaObject()!=NULL); if ( bLine ) @@ -1025,4 +1025,25 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction& rAct, GDIMetaFile* pM } } +//////////////////////////////////////////////////////////////////////////////////////////////////// + +void ImpSdrGDIMetaFileImport::DoAction(MetaRenderGraphicAction& rAct) +{ + GDIMetaFile aMtf; + const ::vcl::RenderGraphic& rRenderGraphic = rAct.GetRenderGraphic(); + Rectangle aRect( rAct.GetPoint(), rAct.GetSize() ); + const Point aPos; + const Size aPrefSize( rRenderGraphic.GetPrefSize() ); + + aRect.Right()++; aRect.Bottom()++; + + aMtf.SetPrefMapMode( rRenderGraphic.GetPrefMapMode() ); + aMtf.SetPrefSize( aPrefSize ); + aMtf.AddAction( new MetaRenderGraphicAction( aPos, aPrefSize, rRenderGraphic ) ); + aMtf.WindStart(); + + SdrGrafObj* pGraf=new SdrGrafObj( aMtf, aRect ); + InsertObj( pGraf ); +} + // eof diff --git a/svx/source/svdraw/svdfmtf.hxx b/svx/source/svdraw/svdfmtf.hxx index 2562b81efa8d..494e43dbadfc 100644 --- a/svx/source/svdraw/svdfmtf.hxx +++ b/svx/source/svdraw/svdfmtf.hxx @@ -140,6 +140,7 @@ protected: void DoAction(MetaISectRectClipRegionAction& rAct) { rAct.Execute(&aVD); } void DoAction(MetaISectRegionClipRegionAction& rAct) { rAct.Execute(&aVD); } void DoAction(MetaCommentAction& rAct, GDIMetaFile* pMtf); + void DoAction(MetaRenderGraphicAction& rAct); void ImportText( const Point& rPos, const XubString& rStr, const MetaAction& rAct ); void SetAttributes(SdrObject* pObj, FASTBOOL bForceTextAttr=FALSE); diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index b299d4c7a2ef..e95e3bf5296e 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -504,6 +504,11 @@ sal_Bool SdrGrafObj::IsEPS() const return pGraphic->IsEPS(); } +sal_Bool SdrGrafObj::IsRenderGraphic() const +{ + return pGraphic->IsRenderGraphic(); +} + sal_Bool SdrGrafObj::IsSwappedOut() const { return mbIsPreview ? sal_True : pGraphic->IsSwappedOut(); @@ -658,6 +663,7 @@ void SdrGrafObj::ReleaseGraphicLink() void SdrGrafObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const { FASTBOOL bAnim = pGraphic->IsAnimated(); + FASTBOOL bRenderGraphic = pGraphic->HasRenderGraphic(); FASTBOOL bNoPresGrf = ( pGraphic->GetType() != GRAPHIC_NONE ) && !bEmptyPresObj; rInfo.bResizeFreeAllowed = aGeo.nDrehWink % 9000 == 0 || @@ -665,11 +671,11 @@ void SdrGrafObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const aGeo.nDrehWink % 27000 == 0; rInfo.bResizePropAllowed = TRUE; - rInfo.bRotateFreeAllowed = bNoPresGrf && !bAnim; - rInfo.bRotate90Allowed = bNoPresGrf && !bAnim; - rInfo.bMirrorFreeAllowed = bNoPresGrf && !bAnim; - rInfo.bMirror45Allowed = bNoPresGrf && !bAnim; - rInfo.bMirror90Allowed = !bEmptyPresObj; + rInfo.bRotateFreeAllowed = bNoPresGrf && !bAnim && !bRenderGraphic; + rInfo.bRotate90Allowed = bNoPresGrf && !bAnim && !bRenderGraphic; + rInfo.bMirrorFreeAllowed = bNoPresGrf && !bAnim && !bRenderGraphic; + rInfo.bMirror45Allowed = bNoPresGrf && !bAnim && !bRenderGraphic; + rInfo.bMirror90Allowed = !bEmptyPresObj && !bRenderGraphic; rInfo.bTransparenceAllowed = FALSE; rInfo.bGradientAllowed = FALSE; rInfo.bShearAllowed = FALSE; @@ -677,7 +683,7 @@ void SdrGrafObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const rInfo.bCanConvToPath = FALSE; rInfo.bCanConvToPathLineToArea = FALSE; rInfo.bCanConvToPolyLineToArea = FALSE; - rInfo.bCanConvToPoly = !IsEPS(); + rInfo.bCanConvToPoly = !IsEPS() && !bRenderGraphic; rInfo.bCanConvToContour = (rInfo.bCanConvToPoly || LineGeometryUsageIsNecessary()); } diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index a1a7565f314d..548224991b19 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -153,7 +153,7 @@ SvXMLGraphicInputStream::SvXMLGraphicInputStream( const ::rtl::OUString& rGraphi { pStm->SetVersion( SOFFICE_FILEFORMAT_8 ); pStm->SetCompressMode( COMPRESSMODE_ZBITMAP ); - ( (GDIMetaFile&) aGraphic.GetGDIMetaFile() ).Write( *pStm ); + ( (GDIMetaFile&) aGraphic.GetGDIMetaFile() ).Write( *pStm, GDIMETAFILE_WRITE_REPLACEMENT_RENDERGRAPHIC ); bRet = ( pStm->GetError() == 0 ); } } @@ -543,7 +543,8 @@ String SvXMLGraphicHelper::ImplGetGraphicMimeType( const String& rFileName ) con { "gif", "image/gif" }, { "png", "image/png" }, { "jpg", "image/jpeg" }, - { "tif", "image/tiff" } + { "tif", "image/tiff" }, + { "svg", "image/svg+xml" } }; String aMimeType; @@ -648,7 +649,7 @@ sal_Bool SvXMLGraphicHelper::ImplWriteGraphic( const ::rtl::OUString& rPictureSt pStream->Write( rLink.GetData(), rLink.GetDataSize() ); } else - rMtf.Write( *pStream ); + rMtf.Write( *pStream, GDIMETAFILE_WRITE_REPLACEMENT_RENDERGRAPHIC ); bRet = ( pStream->GetError() == 0 ); } @@ -728,6 +729,7 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, s case( GFX_LINK_TYPE_NATIVE_WMF ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".wmf" ) ); break; case( GFX_LINK_TYPE_NATIVE_MET ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".met" ) ); break; case( GFX_LINK_TYPE_NATIVE_PCT ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".pct" ) ); break; + case( GFX_LINK_TYPE_NATIVE_SVG ): aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".svg" ) ); break; default: aExtension = String( RTL_CONSTASCII_USTRINGPARAM( ".grf" ) ); @@ -1160,4 +1162,3 @@ Sequence< ::rtl::OUString > SAL_CALL SvXMLGraphicExportHelper_getSupportedServic } } // namespace svx - -- cgit From 591982d2f398724a74383338dd2268d05423130c Mon Sep 17 00:00:00 2001 From: ka Date: Mon, 7 Feb 2011 03:31:27 +0100 Subject: ka102: disable graphic attributes in case of RenderGraphic content --- svx/inc/svx/svdograf.hxx | 2 +- svx/source/svdraw/svdograf.cxx | 5 ++ svx/source/tbxctrls/grafctrl.cxx | 146 ++++++++++++++++++++++++--------------- 3 files changed, 98 insertions(+), 55 deletions(-) (limited to 'svx') diff --git a/svx/inc/svx/svdograf.hxx b/svx/inc/svx/svdograf.hxx index c76c77ec325a..fa095261c3b2 100644 --- a/svx/inc/svx/svdograf.hxx +++ b/svx/inc/svx/svdograf.hxx @@ -149,6 +149,7 @@ public: sal_Bool IsAnimated() const; sal_Bool IsEPS() const; sal_Bool IsRenderGraphic() const; + sal_Bool HasRenderGraphic() const; sal_Bool IsSwappedOut() const; const MapMode& GetGrafPrefMapMode() const; @@ -226,4 +227,3 @@ public: }; #endif //_SVDOGRAF_HXX - diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index e95e3bf5296e..fd7545dea0c4 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -509,6 +509,11 @@ sal_Bool SdrGrafObj::IsRenderGraphic() const return pGraphic->IsRenderGraphic(); } +sal_Bool SdrGrafObj::HasRenderGraphic() const +{ + return pGraphic->HasRenderGraphic(); +} + sal_Bool SdrGrafObj::IsSwappedOut() const { return mbIsPreview ? sal_True : pGraphic->IsSwappedOut(); diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx index 9f8c023c3b3d..e60e9ae27e47 100644 --- a/svx/source/tbxctrls/grafctrl.cxx +++ b/svx/source/tbxctrls/grafctrl.cxx @@ -856,10 +856,8 @@ void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView ) { SfxItemPool& rPool = rView.GetModel()->GetItemPool(); SfxItemSet aSet( rPool, SDRATTR_GRAF_FIRST, SDRATTR_GRAF_LAST ); - - const bool bUndo = rView.IsUndoEnabled(); - - String aUndoStr; + String aUndoStr; + const bool bUndo = rView.IsUndoEnabled(); if( bUndo ) { @@ -1140,6 +1138,28 @@ void SvxGrafAttrHelper::GetGrafAttrState( SfxItemSet& rSet, SdrView& rView ) SfxItemSet aAttrSet( rPool ); SfxWhichIter aIter( rSet ); USHORT nWhich = aIter.FirstWhich(); + const SdrMarkList& rMarkList = rView.GetMarkedObjectList(); + bool bEnableColors = true; + bool bEnableTransparency = true; + bool bEnableCrop = ( 1 == rMarkList.GetMarkCount() ); + + for( int i = 0, nCount = rMarkList.GetMarkCount(); i < nCount; ++i ) + { + SdrGrafObj* pGrafObj = dynamic_cast< SdrGrafObj* >( rMarkList.GetMark( i )->GetMarkedSdrObj() ); + + if( !pGrafObj || + ( pGrafObj->GetGraphicType() == GRAPHIC_NONE ) || + ( pGrafObj->GetGraphicType() == GRAPHIC_DEFAULT ) || + pGrafObj->HasRenderGraphic() ) + { + bEnableColors = bEnableTransparency = bEnableCrop = false; + break; + } + else if( bEnableTransparency && ( pGrafObj->HasGDIMetaFile() || pGrafObj->IsAnimated() ) ) + { + bEnableTransparency = false; + } + } rView.GetAttributes( aAttrSet ); @@ -1153,8 +1173,15 @@ void SvxGrafAttrHelper::GetGrafAttrState( SfxItemSet& rSet, SdrView& rView ) { if( SFX_ITEM_AVAILABLE <= aAttrSet.GetItemState( SDRATTR_GRAFMODE ) ) { - rSet.Put( SfxUInt16Item( nSlotId, - sal::static_int_cast< UINT16 >( ITEMVALUE( aAttrSet, SDRATTR_GRAFMODE, SdrGrafModeItem ) ) ) ); + if( bEnableColors ) + { + rSet.Put( SfxUInt16Item( nSlotId, + sal::static_int_cast< UINT16 >( ITEMVALUE( aAttrSet, SDRATTR_GRAFMODE, SdrGrafModeItem ) ) ) ); + } + else + { + rSet.DisableItem( SID_ATTR_GRAF_MODE ); + } } } break; @@ -1163,8 +1190,15 @@ void SvxGrafAttrHelper::GetGrafAttrState( SfxItemSet& rSet, SdrView& rView ) { if( SFX_ITEM_AVAILABLE <= aAttrSet.GetItemState( SDRATTR_GRAFRED ) ) { - rSet.Put( SfxInt16Item( nSlotId, - ITEMVALUE( aAttrSet, SDRATTR_GRAFRED, SdrGrafRedItem ) ) ); + if( bEnableColors ) + { + rSet.Put( SfxInt16Item( nSlotId, + ITEMVALUE( aAttrSet, SDRATTR_GRAFRED, SdrGrafRedItem ) ) ); + } + else + { + rSet.DisableItem( SID_ATTR_GRAF_RED ); + } } } break; @@ -1173,8 +1207,15 @@ void SvxGrafAttrHelper::GetGrafAttrState( SfxItemSet& rSet, SdrView& rView ) { if( SFX_ITEM_AVAILABLE <= aAttrSet.GetItemState( SDRATTR_GRAFGREEN ) ) { - rSet.Put( SfxInt16Item( nSlotId, - ITEMVALUE( aAttrSet, SDRATTR_GRAFGREEN, SdrGrafGreenItem ) ) ); + if( bEnableColors ) + { + rSet.Put( SfxInt16Item( nSlotId, + ITEMVALUE( aAttrSet, SDRATTR_GRAFGREEN, SdrGrafGreenItem ) ) ); + } + else + { + rSet.DisableItem( SID_ATTR_GRAF_GREEN ); + } } } break; @@ -1183,8 +1224,15 @@ void SvxGrafAttrHelper::GetGrafAttrState( SfxItemSet& rSet, SdrView& rView ) { if( SFX_ITEM_AVAILABLE <= aAttrSet.GetItemState( SDRATTR_GRAFBLUE ) ) { - rSet.Put( SfxInt16Item( nSlotId, - ITEMVALUE( aAttrSet, SDRATTR_GRAFBLUE, SdrGrafBlueItem ) ) ); + if( bEnableColors ) + { + rSet.Put( SfxInt16Item( nSlotId, + ITEMVALUE( aAttrSet, SDRATTR_GRAFBLUE, SdrGrafBlueItem ) ) ); + } + else + { + rSet.DisableItem( SID_ATTR_GRAF_BLUE ); + } } } break; @@ -1193,8 +1241,15 @@ void SvxGrafAttrHelper::GetGrafAttrState( SfxItemSet& rSet, SdrView& rView ) { if( SFX_ITEM_AVAILABLE <= aAttrSet.GetItemState( SDRATTR_GRAFLUMINANCE ) ) { - rSet.Put( SfxInt16Item( nSlotId, - ITEMVALUE( aAttrSet, SDRATTR_GRAFLUMINANCE, SdrGrafLuminanceItem ) ) ); + if( bEnableColors ) + { + rSet.Put( SfxInt16Item( nSlotId, + ITEMVALUE( aAttrSet, SDRATTR_GRAFLUMINANCE, SdrGrafLuminanceItem ) ) ); + } + else + { + rSet.DisableItem( SID_ATTR_GRAF_LUMINANCE ); + } } } break; @@ -1203,8 +1258,15 @@ void SvxGrafAttrHelper::GetGrafAttrState( SfxItemSet& rSet, SdrView& rView ) { if( SFX_ITEM_AVAILABLE <= aAttrSet.GetItemState( SDRATTR_GRAFCONTRAST ) ) { - rSet.Put( SfxInt16Item( nSlotId, - ITEMVALUE( aAttrSet, SDRATTR_GRAFCONTRAST, SdrGrafContrastItem ) ) ); + if( bEnableColors ) + { + rSet.Put( SfxInt16Item( nSlotId, + ITEMVALUE( aAttrSet, SDRATTR_GRAFCONTRAST, SdrGrafContrastItem ) ) ); + } + else + { + rSet.DisableItem( SID_ATTR_GRAF_CONTRAST ); + } } } break; @@ -1213,8 +1275,15 @@ void SvxGrafAttrHelper::GetGrafAttrState( SfxItemSet& rSet, SdrView& rView ) { if( SFX_ITEM_AVAILABLE <= aAttrSet.GetItemState( SDRATTR_GRAFGAMMA ) ) { - rSet.Put( SfxUInt32Item( nSlotId, - ITEMVALUE( aAttrSet, SDRATTR_GRAFGAMMA, SdrGrafGamma100Item ) ) ); + if( bEnableColors ) + { + rSet.Put( SfxUInt32Item( nSlotId, + ITEMVALUE( aAttrSet, SDRATTR_GRAFGAMMA, SdrGrafGamma100Item ) ) ); + } + else + { + rSet.DisableItem( SID_ATTR_GRAF_GAMMA ); + } } } break; @@ -1223,53 +1292,22 @@ void SvxGrafAttrHelper::GetGrafAttrState( SfxItemSet& rSet, SdrView& rView ) { if( SFX_ITEM_AVAILABLE <= aAttrSet.GetItemState( SDRATTR_GRAFTRANSPARENCE ) ) { - const SdrMarkList& rMarkList = rView.GetMarkedObjectList(); - BOOL bEnable = TRUE; - - for( USHORT i = 0, nCount = (USHORT) rMarkList.GetMarkCount(); - ( i < nCount ) && bEnable; i++ ) + if( bEnableTransparency ) { - SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - - if( !pObj || !pObj->ISA( SdrGrafObj ) || - ( (SdrGrafObj*) pObj )->HasGDIMetaFile() || - ( (SdrGrafObj*) pObj )->IsAnimated() ) - { - bEnable = FALSE; - } - } - - if( bEnable ) rSet.Put( SfxUInt16Item( nSlotId, ITEMVALUE( aAttrSet, SDRATTR_GRAFTRANSPARENCE, SdrGrafTransparenceItem ) ) ); + } else + { rSet.DisableItem( SID_ATTR_GRAF_TRANSPARENCE ); + } } } break; case( SID_ATTR_GRAF_CROP ): { - const SdrMarkList& rMarkList = rView.GetMarkedObjectList(); - BOOL bDisable = TRUE; - - if( 1 == rMarkList.GetMarkCount() ) - { - SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); - - if( pObj && pObj->ISA( SdrGrafObj ) ) - { - SdrGrafObj* pGrafObj = (SdrGrafObj*) pObj; - - if( ( pGrafObj->GetGraphicType() != GRAPHIC_NONE ) && - ( pGrafObj->GetGraphicType() != GRAPHIC_DEFAULT ) ) - { - bDisable = FALSE; - } - } - } - - if( bDisable ) + if( !bEnableCrop ) rSet.DisableItem( nSlotId ); } break; -- cgit From d2b362879156f49ac77a69942cab2ffb0fdac12b Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Wed, 16 Mar 2011 17:23:01 +0100 Subject: #i116487# Adjust copyright date to 2011 --- svx/source/intro/about_ooo.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'svx') diff --git a/svx/source/intro/about_ooo.src b/svx/source/intro/about_ooo.src index b49a0ff927cf..4523ffd739ce 100644 --- a/svx/source/intro/about_ooo.src +++ b/svx/source/intro/about_ooo.src @@ -30,7 +30,7 @@ String ABOUT_STR_COPYRIGHT { - Text[ en-US ] = "Copyright © 2000, 2010 Oracle and/or its affiliates. All rights reserved.\nThis product was created by %OOOVENDOR, based on OpenOffice.org.\nOpenOffice.org acknowledges all community members, especially those mentioned at\n http://www.openoffice.org/welcome/credits.html."; + Text[ en-US ] = "Copyright © 2000, 2011 Oracle and/or its affiliates. All rights reserved.\nThis product was created by %OOOVENDOR, based on OpenOffice.org.\nOpenOffice.org acknowledges all community members, especially those mentioned at\n http://www.openoffice.org/welcome/credits.html."; }; StringArray ABOUT_STR_DEVELOPER_ARY -- cgit From aa67a378129447f60c1eb234f0657b14196b24d0 Mon Sep 17 00:00:00 2001 From: os Date: Tue, 22 Mar 2011 15:32:53 +0100 Subject: #i105244# handling of extensions while saving pictures fixed --- svx/inc/svx/xoutbmp.hxx | 1 + svx/source/xoutdev/_xoutbmp.cxx | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) mode change 100644 => 100755 svx/inc/svx/xoutbmp.hxx mode change 100644 => 100755 svx/source/xoutdev/_xoutbmp.cxx (limited to 'svx') diff --git a/svx/inc/svx/xoutbmp.hxx b/svx/inc/svx/xoutbmp.hxx old mode 100644 new mode 100755 index 1d0fca8de220..6dd59dbd6e57 --- a/svx/inc/svx/xoutbmp.hxx +++ b/svx/inc/svx/xoutbmp.hxx @@ -43,6 +43,7 @@ #define XOUTBMP_CONTOUR_HORZ 0x00000001L #define XOUTBMP_CONTOUR_VERT 0x00000002L #define XOUTBMP_CONTOUR_EDGEDETECT 0x00000004L +#define XOUTBMP_DONT_ADD_EXTENSION 0x00000008L #define XOUTBMP_DONT_EXPAND_FILENAME 0x10000000L #define XOUTBMP_USE_GIF_IF_POSSIBLE 0x20000000L diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx old mode 100644 new mode 100755 index e8958bf82479..62c434097699 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -367,7 +367,8 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, String& rFileName, if( aExt.Len() ) { - aURL.setExtension( aExt ); + if( 0 == (nFlags & XOUTBMP_DONT_ADD_EXTENSION)) + aURL.setExtension( aExt ); rFileName = aURL.GetMainURL( INetURLObject::NO_DECODE ); SfxMedium aMedium( aURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_WRITE | STREAM_SHARE_DENYNONE | STREAM_TRUNC, sal_True ); @@ -472,7 +473,8 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, String& rFileName, if( ( GRFILTER_FORMAT_NOTFOUND != nFilter ) && ( aGraphic.GetType() != GRAPHIC_NONE ) ) { - aURL.setExtension( aExt ); + if( 0 == (nFlags & XOUTBMP_DONT_ADD_EXTENSION)) + aURL.setExtension( aExt ); rFileName = aURL.GetMainURL( INetURLObject::NO_DECODE ); nErr = ExportGraphic( aGraphic, aURL, *pFilter, nFilter, NULL ); } -- cgit