summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2010-08-25 15:47:38 +0200
committerVladimir Glazunov <vg@openoffice.org>2010-08-25 15:47:38 +0200
commite121bc93cec360896d9e09d4a1c50cfc43261e42 (patch)
treeda26a7fada899565fa2ec89381a846d70a84be78 /svtools
parentdeee1f03fb16af83c642121a5682af3398d90ece (diff)
parent39102116500fee3379a992293e8ea8125c1e8d86 (diff)
DEV300: merge 000330 till r. b727f1beb700
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/config/menuoptions.cxx14
-rw-r--r--svtools/source/contnr/svlbox.cxx11
-rw-r--r--svtools/source/filter.vcl/filter/filter2.cxx2
-rw-r--r--svtools/source/filter.vcl/wmf/winwmf.cxx69
4 files changed, 58 insertions, 38 deletions
diff --git a/svtools/source/config/menuoptions.cxx b/svtools/source/config/menuoptions.cxx
index 70d9d1623ef2..1551361f252f 100644
--- a/svtools/source/config/menuoptions.cxx
+++ b/svtools/source/config/menuoptions.cxx
@@ -316,6 +316,7 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames )
sal_Bool bMenuIcons = true;
sal_Bool bSystemMenuIcons = true;
+ sal_Bool bMenuSettingsChanged = false;
// Step over list of property names and get right value from coreesponding value list to set it on internal members!
sal_Int32 nCount = seqPropertyNames.getLength();
@@ -334,12 +335,12 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames )
else if( seqPropertyNames[nProperty] == PROPERTYNAME_SHOWICONSINMENUES )
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\ShowIconsInMenues\"?" );
- seqValues[nProperty] >>= bMenuIcons;
+ bMenuSettingsChanged = seqValues[nProperty] >>= bMenuIcons;
}
else if( seqPropertyNames[nProperty] == PROPERTYNAME_SYSTEMICONSINMENUES )
{
DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtMenuOptions_Impl::SvtMenuOptions_Impl()\nWho has changed the value type of \"Office.Common\\View\\Menu\\IsSystemIconsInMenus\"?" );
- seqValues[nProperty] >>= bSystemMenuIcons;
+ bMenuSettingsChanged = seqValues[nProperty] >>= bSystemMenuIcons;
}
#if OSL_DEBUG_LEVEL > 1
@@ -347,7 +348,8 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames )
#endif
}
- m_nMenuIcons = bSystemMenuIcons ? 2 : bMenuIcons;
+ if ( bMenuSettingsChanged )
+ m_nMenuIcons = bSystemMenuIcons ? 2 : bMenuIcons;
for ( USHORT n=0; n<aList.Count(); n++ )
aList.GetObject(n)->Call( this );
@@ -377,11 +379,13 @@ void SvtMenuOptions_Impl::Commit()
break;
//Output cache of current setting as possibly modified by System Theme for older version
case PROPERTYHANDLE_SHOWICONSINMENUES : {
- seqValues[nProperty] <<=(sal_Bool)(Application::GetSettings().GetStyleSettings().GetUseImagesInMenus());
+ sal_Bool bValue = (sal_Bool)(Application::GetSettings().GetStyleSettings().GetUseImagesInMenus());
+ seqValues[nProperty] <<= bValue;
}
break;
case PROPERTYHANDLE_SYSTEMICONSINMENUES : {
- seqValues[nProperty] <<= (m_nMenuIcons == 2 ? sal_True : sal_False) ;
+ sal_Bool bValue = (m_nMenuIcons == 2 ? sal_True : sal_False) ;
+ seqValues[nProperty] <<= bValue;
}
break;
}
diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx
index fb71f64772ad..a69253c69629 100644
--- a/svtools/source/contnr/svlbox.cxx
+++ b/svtools/source/contnr/svlbox.cxx
@@ -1518,6 +1518,13 @@ void SvLBox::MakeVisible( SvLBoxEntry* )
void SvLBox::Command( const CommandEvent& i_rCommandEvent )
{
DBG_CHKTHIS(SvLBox,0);
+
+ if ( COMMAND_STARTDRAG == i_rCommandEvent.GetCommand() )
+ {
+ Point aEventPos( i_rCommandEvent.GetMousePosPixel() );
+ MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT );
+ MouseButtonUp( aMouseEvt );
+ }
Control::Command( i_rCommandEvent );
}
@@ -1775,6 +1782,10 @@ void SvLBox::StartDrag( sal_Int8, const Point& rPosPixel )
{
DBG_CHKTHIS(SvLBox,0);
+ Point aEventPos( rPosPixel );
+ MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT );
+ MouseButtonUp( aMouseEvt );
+
nOldDragMode = GetDragDropMode();
if ( !nOldDragMode )
return;
diff --git a/svtools/source/filter.vcl/filter/filter2.cxx b/svtools/source/filter.vcl/filter/filter2.cxx
index de2bef64ba6e..6abab2626516 100644
--- a/svtools/source/filter.vcl/filter/filter2.cxx
+++ b/svtools/source/filter.vcl/filter/filter2.cxx
@@ -1201,7 +1201,7 @@ BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL )
nFormat = GFF_PCT;
else
{
- BYTE sBuf[4];
+ BYTE sBuf[3]={0};
rStm.Seek( nStmPos + 522 );
rStm.Read( sBuf, 3 );
diff --git a/svtools/source/filter.vcl/wmf/winwmf.cxx b/svtools/source/filter.vcl/wmf/winwmf.cxx
index f7c4f51ce1e2..cea1ab490b04 100644
--- a/svtools/source/filter.vcl/wmf/winwmf.cxx
+++ b/svtools/source/filter.vcl/wmf/winwmf.cxx
@@ -1081,6 +1081,8 @@ void WMFReader::ReadWMF()
nEMFRec = 0;
nEMFSize = 0;
+ sal_Bool bEMFAvailable = sal_False;
+
pOut->SetMapMode( MM_ANISOTROPIC );
pOut->SetWinOrg( Point() );
pOut->SetWinExt( Size( 1, 1 ) );
@@ -1117,50 +1119,53 @@ void WMFReader::ReadWMF()
break;
}
- if( aBmpSaveList.Count() &&
- ( nFunction != W_META_STRETCHDIB ) &&
- ( nFunction != W_META_DIBBITBLT ) &&
- ( nFunction != W_META_DIBSTRETCHBLT ) )
- {
- pOut->ResolveBitmapActions( aBmpSaveList );
- }
- if ( !nSkipActions )
- ReadRecordParams( nFunction );
- else
- nSkipActions--;
-
- if( pEMFStream && nEMFRecCount == nEMFRec )
+ if ( !bEMFAvailable )
{
- GDIMetaFile aMeta;
- pEMFStream->Seek( 0 );
- EnhWMFReader* pEMFReader = new EnhWMFReader ( *pEMFStream, aMeta );
- BOOL bRead = pEMFReader->ReadEnhWMF();
- delete pEMFReader; // destroy first!!!
-
- if( bRead )
+ if( aBmpSaveList.Count() &&
+ ( nFunction != W_META_STRETCHDIB ) &&
+ ( nFunction != W_META_DIBBITBLT ) &&
+ ( nFunction != W_META_DIBSTRETCHBLT ) )
{
- pOut->AddFromGDIMetaFile( aMeta );
- pOut->SetrclFrame( Rectangle(0, 0, aMeta.GetPrefSize().Width(), aMeta.GetPrefSize().Height() ));
- // we have successfully read the embedded EMF data
- // no need to process WMF data further
- break;
+ pOut->ResolveBitmapActions( aBmpSaveList );
}
+ if ( !nSkipActions )
+ ReadRecordParams( nFunction );
else
+ nSkipActions--;
+
+ if( pEMFStream && nEMFRecCount == nEMFRec )
{
- // something went wrong
- // continue with WMF, don't try this again
- delete pEMFStream;
- pEMFStream = NULL;
- }
+ GDIMetaFile aMeta;
+ pEMFStream->Seek( 0 );
+ EnhWMFReader* pEMFReader = new EnhWMFReader ( *pEMFStream, aMeta );
+ bEMFAvailable = pEMFReader->ReadEnhWMF();
+ delete pEMFReader; // destroy first!!!
+ if( bEMFAvailable )
+ {
+ pOut->AddFromGDIMetaFile( aMeta );
+ pOut->SetrclFrame( Rectangle(0, 0, aMeta.GetPrefSize().Width(), aMeta.GetPrefSize().Height() ));
+
+ // the stream needs to be set to the wmf end position,
+ // otherwise the GfxLink that is created will be incorrect
+ // (leading to graphic loss after swapout/swapin).
+ // so we will proceed normally, but are ignoring further wmf
+ // records
+ }
+ else
+ {
+ // something went wrong
+ // continue with WMF, don't try this again
+ delete pEMFStream;
+ pEMFStream = NULL;
+ }
+ }
}
-
nPos += nRecSize * 2;
if ( nPos <= nEndPos )
pWMF->Seek( nPos );
else
pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR );
-
}
}
else