summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2010-01-21 13:49:22 +0100
committerMathias Bauer <mba@openoffice.org>2010-01-21 13:49:22 +0100
commite1418e1b155368d8e9be649c2ce809d012d565fa (patch)
treeb6627dc74804b255dbc28f0a6199324deb128482 /svtools
parent9fe074cacb027df327a00e39724ece4166b68147 (diff)
parent7f5f6c30e89c27422a1576ccceb9b0d79c8e3f0d (diff)
resync to DEV300_m70
Diffstat (limited to 'svtools')
-rw-r--r--svtools/inc/svtools/grfmgr.hxx2
-rw-r--r--svtools/inc/svtools/imapobj.hxx2
-rw-r--r--svtools/source/control/filectrl.cxx3
-rw-r--r--svtools/source/dialogs/prnsetup.cxx2
-rw-r--r--svtools/source/filter.vcl/filter/filter2.cxx3
-rw-r--r--svtools/source/filter.vcl/wmf/emfwr.cxx94
-rw-r--r--svtools/source/filter.vcl/wmf/emfwr.hxx4
-rw-r--r--svtools/source/filter.vcl/wmf/wmfwr.cxx84
-rw-r--r--svtools/source/filter.vcl/wmf/wmfwr.hxx4
-rw-r--r--svtools/source/graphic/grfmgr.cxx4
-rw-r--r--svtools/source/misc/imap.cxx7
-rw-r--r--svtools/source/uno/unoiface.cxx80
-rw-r--r--svtools/util/makefile.mk1
13 files changed, 184 insertions, 106 deletions
diff --git a/svtools/inc/svtools/grfmgr.hxx b/svtools/inc/svtools/grfmgr.hxx
index f27d6e5e35aa..4231fdc3cb8e 100644
--- a/svtools/inc/svtools/grfmgr.hxx
+++ b/svtools/inc/svtools/grfmgr.hxx
@@ -350,7 +350,7 @@ public:
void ReleaseFromCache();
const Graphic& GetGraphic() const;
- void SetGraphic( const Graphic& rGraphic );
+ void SetGraphic( const Graphic& rGraphic, const GraphicObject* pCopyObj = 0);
void SetGraphic( const Graphic& rGraphic, const String& rLink );
/** Get graphic transformed according to given attributes
diff --git a/svtools/inc/svtools/imapobj.hxx b/svtools/inc/svtools/imapobj.hxx
index b8da0e5c3ee8..46b73ee95f2c 100644
--- a/svtools/inc/svtools/imapobj.hxx
+++ b/svtools/inc/svtools/imapobj.hxx
@@ -96,7 +96,7 @@ public:
static rtl_TextEncoding nActualTextEncoding;
- IMapObject() {};
+ IMapObject();
IMapObject( const String& rURL,
const String& rAltText,
const String& rDesc,
diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx
index d820dce097ed..f00cf45be0e6 100644
--- a/svtools/source/control/filectrl.cxx
+++ b/svtools/source/control/filectrl.cxx
@@ -78,6 +78,9 @@ WinBits FileControl::ImplInitStyle( WinBits nStyle )
maButton.SetStyle( (maButton.GetStyle()|WB_NOTABSTOP)&(~WB_TABSTOP) );
}
+ const WinBits nAlignmentStyle = ( WB_TOP | WB_VCENTER | WB_BOTTOM );
+ maEdit.SetStyle( ( maEdit.GetStyle() & ~nAlignmentStyle ) | ( nStyle & nAlignmentStyle ) );
+
if ( !(nStyle & WB_NOGROUP) )
nStyle |= WB_GROUP;
diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx
index dedb5b2d7143..74cfe7b1286a 100644
--- a/svtools/source/dialogs/prnsetup.cxx
+++ b/svtools/source/dialogs/prnsetup.cxx
@@ -59,7 +59,7 @@ void ImplFillPrnDlgListBox( const Printer* pPrinter,
}
pBox->Enable( nCount != 0 );
- pPropBtn->Enable( pPrinter->HasSupport( SUPPORT_SETUPDIALOG ) );
+ pPropBtn->Show( pPrinter->HasSupport( SUPPORT_SETUPDIALOG ) );
}
// -----------------------------------------------------------------------
diff --git a/svtools/source/filter.vcl/filter/filter2.cxx b/svtools/source/filter.vcl/filter/filter2.cxx
index d570dd34e50f..9e0e3ba43d54 100644
--- a/svtools/source/filter.vcl/filter/filter2.cxx
+++ b/svtools/source/filter.vcl/filter/filter2.cxx
@@ -471,7 +471,8 @@ BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo )
// Groesse des verbleibenden Puffers ermitteln
if ( bLinked )
- nMax = ( (SvMemoryStream&) rStm ).GetSize() - 16;
+ nMax = static_cast< SvMemoryStream& >(rStm).GetEndOfData()
+ - 16;
else
nMax = DATA_SIZE - 16;
diff --git a/svtools/source/filter.vcl/wmf/emfwr.cxx b/svtools/source/filter.vcl/wmf/emfwr.cxx
index df56afc4a250..e011dde1a0e8 100644
--- a/svtools/source/filter.vcl/wmf/emfwr.cxx
+++ b/svtools/source/filter.vcl/wmf/emfwr.cxx
@@ -33,6 +33,9 @@
#include "emfwr.hxx"
#include <vcl/salbtype.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <vcl/lineinfo.hxx>
// -----------
// - Defines -
@@ -829,6 +832,46 @@ void EMFWriter::ImplWriteTextRecord( const Point& rPos, const String rText, cons
// -----------------------------------------------------------------------------
+void EMFWriter::Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon)
+{
+ if(rLinePolygon.count())
+ {
+ basegfx::B2DPolyPolygon aLinePolyPolygon(rLinePolygon);
+ basegfx::B2DPolyPolygon aFillPolyPolygon;
+
+ rInfo.applyToB2DPolyPolygon(aLinePolyPolygon, aFillPolyPolygon);
+
+ if(aLinePolyPolygon.count())
+ {
+ for(sal_uInt32 a(0); a < aLinePolyPolygon.count(); a++)
+ {
+ const basegfx::B2DPolygon aCandidate(aLinePolyPolygon.getB2DPolygon(a));
+ ImplWritePolygonRecord( Polygon(aCandidate), FALSE );
+ }
+ }
+
+ if(aFillPolyPolygon.count())
+ {
+ const Color aOldLineColor(maVDev.GetLineColor());
+ const Color aOldFillColor(maVDev.GetFillColor());
+
+ maVDev.SetLineColor();
+ maVDev.SetFillColor(aOldLineColor);
+
+ for(sal_uInt32 a(0); a < aFillPolyPolygon.count(); a++)
+ {
+ const Polygon aPolygon(aFillPolyPolygon.getB2DPolygon(a));
+ ImplWritePolyPolygonRecord(PolyPolygon(Polygon(aPolygon)));
+ }
+
+ maVDev.SetLineColor(aOldLineColor);
+ maVDev.SetFillColor(aOldFillColor);
+ }
+ }
+}
+
+// -----------------------------------------------------------------------------
+
void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
{
for( ULONG j = 0, nActionCount = rMtf.GetActionCount(); j < nActionCount; j++ )
@@ -871,20 +914,31 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
{
const MetaLineAction* pA = (const MetaLineAction*) pAction;
- ImplCheckLineAttr();
+ if(pA->GetLineInfo().IsDefault())
+ {
+ ImplCheckLineAttr();
- ImplBeginRecord( WIN_EMR_MOVETOEX );
- ImplWritePoint( pA->GetStartPoint() );
- ImplEndRecord();
+ ImplBeginRecord( WIN_EMR_MOVETOEX );
+ ImplWritePoint( pA->GetStartPoint() );
+ ImplEndRecord();
- ImplBeginRecord( WIN_EMR_LINETO );
- ImplWritePoint( pA->GetEndPoint() );
- ImplEndRecord();
+ ImplBeginRecord( WIN_EMR_LINETO );
+ ImplWritePoint( pA->GetEndPoint() );
+ ImplEndRecord();
- ImplBeginRecord( WIN_EMR_SETPIXELV );
- ImplWritePoint( pA->GetEndPoint() );
- ImplWriteColor( maVDev.GetLineColor() );
- ImplEndRecord();
+ ImplBeginRecord( WIN_EMR_SETPIXELV );
+ ImplWritePoint( pA->GetEndPoint() );
+ ImplWriteColor( maVDev.GetLineColor() );
+ ImplEndRecord();
+ }
+ else
+ {
+ // LineInfo used; handle Dash/Dot and fat lines
+ basegfx::B2DPolygon aPolygon;
+ aPolygon.append(basegfx::B2DPoint(pA->GetStartPoint().X(), pA->GetStartPoint().Y()));
+ aPolygon.append(basegfx::B2DPoint(pA->GetEndPoint().X(), pA->GetEndPoint().Y()));
+ Impl_handleLineInfoPolyPolygons(pA->GetLineInfo(), aPolygon);
+ }
}
}
break;
@@ -983,7 +1037,23 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
case( META_POLYLINE_ACTION ):
{
if( maVDev.IsLineColor() )
- ImplWritePolygonRecord( ( (const MetaPolyLineAction*) pAction )->GetPolygon(), FALSE );
+ {
+ const MetaPolyLineAction* pA = (const MetaPolyLineAction*) pAction;
+ const Polygon& rPoly = pA->GetPolygon();
+
+ if( rPoly.GetSize() )
+ {
+ if(pA->GetLineInfo().IsDefault())
+ {
+ ImplWritePolygonRecord( rPoly, FALSE );
+ }
+ else
+ {
+ // LineInfo used; handle Dash/Dot and fat lines
+ Impl_handleLineInfoPolyPolygons(pA->GetLineInfo(), rPoly.getB2DPolygon());
+ }
+ }
+ }
}
break;
diff --git a/svtools/source/filter.vcl/wmf/emfwr.hxx b/svtools/source/filter.vcl/wmf/emfwr.hxx
index 150aa1692ade..2d3c8801ba49 100644
--- a/svtools/source/filter.vcl/wmf/emfwr.hxx
+++ b/svtools/source/filter.vcl/wmf/emfwr.hxx
@@ -42,6 +42,9 @@
// - EMFWriter -
// -------------
+class LineInfo;
+namespace basegfx { class B2DPolygon; }
+
class EMFWriter
{
private:
@@ -86,6 +89,7 @@ private:
void ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, UINT32 nROP );
void ImplWriteTextRecord( const Point& rPos, const String rText, const sal_Int32* pDXArray, sal_uInt32 nWidth );
+ void Impl_handleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon);
void ImplWrite( const GDIMetaFile& rMtf );
public:
diff --git a/svtools/source/filter.vcl/wmf/wmfwr.cxx b/svtools/source/filter.vcl/wmf/wmfwr.cxx
index d25d4e94f97a..30d4ff06c0d2 100644
--- a/svtools/source/filter.vcl/wmf/wmfwr.cxx
+++ b/svtools/source/filter.vcl/wmf/wmfwr.cxx
@@ -42,8 +42,9 @@
#include <i18nutil/unicode.hxx> //unicode::getUnicodeScriptType
#endif
-
#include <vcl/metric.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
//====================== MS-Windows-defines ===============================
@@ -1136,6 +1137,49 @@ void WMFWriter::SetAllAttr()
}
+void WMFWriter::HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon)
+{
+ if(rLinePolygon.count())
+ {
+ basegfx::B2DPolyPolygon aLinePolyPolygon(rLinePolygon);
+ basegfx::B2DPolyPolygon aFillPolyPolygon;
+
+ rInfo.applyToB2DPolyPolygon(aLinePolyPolygon, aFillPolyPolygon);
+
+ if(aLinePolyPolygon.count())
+ {
+ aSrcLineInfo = rInfo;
+ SetLineAndFillAttr();
+
+ for(sal_uInt32 a(0); a < aLinePolyPolygon.count(); a++)
+ {
+ const basegfx::B2DPolygon aCandidate(aLinePolyPolygon.getB2DPolygon(a));
+ WMFRecord_PolyLine(Polygon(aCandidate));
+ }
+ }
+
+ if(aFillPolyPolygon.count())
+ {
+ const Color aOldLineColor(aSrcLineColor);
+ const Color aOldFillColor(aSrcFillColor);
+
+ aSrcLineColor = Color( COL_TRANSPARENT );
+ aSrcFillColor = aOldLineColor;
+ SetLineAndFillAttr();
+
+ for(sal_uInt32 a(0); a < aFillPolyPolygon.count(); a++)
+ {
+ const Polygon aPolygon(aFillPolyPolygon.getB2DPolygon(a));
+ WMFRecord_Polygon(Polygon(aPolygon));
+ }
+
+ aSrcLineColor = aOldLineColor;
+ aSrcFillColor = aOldFillColor;
+ SetLineAndFillAttr();
+ }
+ }
+}
+
void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
{
ULONG nA, nACount;
@@ -1176,10 +1220,21 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
case META_LINE_ACTION:
{
const MetaLineAction* pA = (const MetaLineAction *) pMA;
- aSrcLineInfo = pA->GetLineInfo();
- SetLineAndFillAttr();
- WMFRecord_MoveTo( pA->GetStartPoint() );
- WMFRecord_LineTo( pA->GetEndPoint() );
+ if(pA->GetLineInfo().IsDefault())
+ {
+ aSrcLineInfo = pA->GetLineInfo();
+ SetLineAndFillAttr();
+ WMFRecord_MoveTo( pA->GetStartPoint() );
+ WMFRecord_LineTo( pA->GetEndPoint() );
+ }
+ else
+ {
+ // LineInfo used; handle Dash/Dot and fat lines
+ basegfx::B2DPolygon aPolygon;
+ aPolygon.append(basegfx::B2DPoint(pA->GetStartPoint().X(), pA->GetStartPoint().Y()));
+ aPolygon.append(basegfx::B2DPoint(pA->GetEndPoint().X(), pA->GetEndPoint().Y()));
+ HandleLineInfoPolyPolygons(pA->GetLineInfo(), aPolygon);
+ }
}
break;
@@ -1241,9 +1296,22 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
case META_POLYLINE_ACTION:
{
const MetaPolyLineAction* pA = (const MetaPolyLineAction*) pMA;
- aSrcLineInfo = pA->GetLineInfo();
- SetLineAndFillAttr();
- WMFRecord_PolyLine( pA->GetPolygon() );
+ const Polygon& rPoly = pA->GetPolygon();
+
+ if( rPoly.GetSize() )
+ {
+ if(pA->GetLineInfo().IsDefault())
+ {
+ aSrcLineInfo = pA->GetLineInfo();
+ SetLineAndFillAttr();
+ WMFRecord_PolyLine( rPoly );
+ }
+ else
+ {
+ // LineInfo used; handle Dash/Dot and fat lines
+ HandleLineInfoPolyPolygons(pA->GetLineInfo(), rPoly.getB2DPolygon());
+ }
+ }
}
break;
diff --git a/svtools/source/filter.vcl/wmf/wmfwr.hxx b/svtools/source/filter.vcl/wmf/wmfwr.hxx
index 48986a280404..03ca14e7633f 100644
--- a/svtools/source/filter.vcl/wmf/wmfwr.hxx
+++ b/svtools/source/filter.vcl/wmf/wmfwr.hxx
@@ -65,6 +65,9 @@ struct WMFWriterAttrStackMember
// -------------
class StarSymbolToMSMultiFont;
+class LineInfo;
+namespace basegfx { class B2DPolygon; }
+
class WMFWriter
{
private:
@@ -202,6 +205,7 @@ private:
void SetLineAndFillAttr();
void SetAllAttr();
+ void HandleLineInfoPolyPolygons(const LineInfo& rInfo, const basegfx::B2DPolygon& rLinePolygon);
void WriteRecords(const GDIMetaFile & rMTF);
void WriteHeader(const GDIMetaFile & rMTF, BOOL bPlaceable);
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index cdac200810bc..d5c8a0d3fd49 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -845,7 +845,7 @@ const Graphic& GraphicObject::GetGraphic() const
// -----------------------------------------------------------------------------
-void GraphicObject::SetGraphic( const Graphic& rGraphic )
+void GraphicObject::SetGraphic( const Graphic& rGraphic, const GraphicObject* pCopyObj )
{
mpMgr->ImplUnregisterObj( *this );
@@ -858,7 +858,7 @@ void GraphicObject::SetGraphic( const Graphic& rGraphic )
delete mpLink, mpLink = NULL;
delete mpSimpleCache, mpSimpleCache = NULL;
- mpMgr->ImplRegisterObj( *this, maGraphic );
+ mpMgr->ImplRegisterObj( *this, maGraphic, 0, pCopyObj);
if( mpSwapOutTimer )
mpSwapOutTimer->Start();
diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx
index df7760f7931b..b0aaee113c20 100644
--- a/svtools/source/misc/imap.cxx
+++ b/svtools/source/misc/imap.cxx
@@ -64,6 +64,12 @@ UINT16 IMapObject::nActualTextEncoding = (UINT16) RTL_TEXTENCODING_DONTKNOW;
#pragma optimize ( "", off )
#endif
+IMapObject::IMapObject()
+ : bActive( false )
+ , nReadVersion( 0 )
+{
+}
+
IMapObject::IMapObject( const String& rURL, const String& rAltText, const String& rDesc,
const String& rTarget, const String& rName, BOOL bURLActive )
: aURL( rURL )
@@ -72,6 +78,7 @@ IMapObject::IMapObject( const String& rURL, const String& rAltText, const String
, aTarget( rTarget )
, aName( rName )
, bActive( bURLActive )
+, nReadVersion( 0 )
{
}
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index a1ff1ad2ac3e..9c7c3eec33d1 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -549,86 +549,6 @@ void VCLXMultiLineEdit::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
}
// ----------------------------------------------------
-// class VCLXFileDialog
-// ----------------------------------------------------
-/*
-VCLXFileDialog::VCLXFileDialog()
-{
-}
-
-VCLXFileDialog::~VCLXFileDialog()
-{
-}
-
-::com::sun::star::uno::Any VCLXFileDialog::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
- SAL_STATIC_CAST( ::com::sun::star::awt::XXX*, this ) );
- return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ));
-}
-
-// ::com::sun::star::lang::XTypeProvider
-IMPL_XTYPEPROVIDER_START( VCLXFileDialog )
- getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XXX>* ) NULL )
-IMPL_XTYPEPROVIDER_END
-
-void VCLXFileDialog::setPath( const ::rtl::OUString& rPath )
-{
- ::vos::OGuard aGuard( GetMutex() );
-
- FileDialog* pDlg = (FileDialog*)GetWindow();
- if ( pDlg )
- pDlg->SetPath( ::rtl::OUStringToOString( rPath, CHARSET_SYSTEM ) );
-}
-
-::rtl::OUString VCLXFileDialog::getPath()
-{
- ::vos::OGuard aGuard( GetMutex() );
-
- ::rtl::OUString aPath;
- FileDialog* pDlg = (FileDialog*)GetWindow();
- if ( pDlg )
- aPath = StringToOUString( pDlg->GetPath(), CHARSET_SYSTEM );
- return aPath;
-}
-
-void VCLXFileDialog::setFilters( const ::com::sun::star::uno::Sequence< ::rtl::OUString>& rFilterNames, const ::com::sun::star::uno::Sequence< ::rtl::OUString>& rMasks )
-{
- ::vos::OGuard aGuard( GetMutex() );
-
- FileDialog* pDlg = (FileDialog*)GetWindow();
- if ( pDlg )
- {
- sal_uInt32 nFlts = rFilterNames.getLength();
- for ( sal_uInt32 n = 0; n < nFlts; n++ )
- pDlg->AddFilter(
- ::rtl::OUStringToOString( rFilterNames.getConstArray()[n], CHARSET_SYSTEM ),
- ::rtl::OUStringToOString( rMasks.getConstArray()[n], CHARSET_SYSTEM ) );
- }
-}
-
-void VCLXFileDialog::setCurrentFilter( const ::rtl::OUString& rFilterName )
-{
- ::vos::OGuard aGuard( GetMutex() );
-
- FileDialog* pDlg = (FileDialog*)GetWindow();
- if ( pDlg )
- pDlg->SetCurFilter( ::rtl::OUStringToOString( rFilterName, CHARSET_SYSTEM ) );
-}
-
-::rtl::OUString VCLXFileDialog::getCurrentFilter()
-{
- ::vos::OGuard aGuard( GetMutex() );
-
- ::rtl::OUString aFilter;
- FileDialog* pDlg = (FileDialog*)GetWindow();
- if ( pDlg )
- aFilter = StringToOUString( pDlg->GetCurFilter(), CHARSET_SYSTEM );
- return aFilter;
-}
-*/
-
-// ----------------------------------------------------
// class VCLXFileControl
// ----------------------------------------------------
VCLXFileControl::VCLXFileControl() : maTextListeners( *this )
diff --git a/svtools/util/makefile.mk b/svtools/util/makefile.mk
index 448bc982bbae..e16d6a3708d9 100644
--- a/svtools/util/makefile.mk
+++ b/svtools/util/makefile.mk
@@ -113,6 +113,7 @@ SHL1STDLIBS+= \
$(VCLLIB) \
$(SVLLIB) \
$(SOTLIB) \
+ $(BASEGFXLIB) \
$(UNOTOOLSLIB) \
$(TOOLSLIB) \
$(I18NISOLANGLIB) \