summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <cmc@openoffice.org>2010-08-03 10:25:58 +0100
committerCaolán McNamara <cmc@openoffice.org>2010-08-03 10:25:58 +0100
commit3833427a35230616627fe633d34edcd314581e6a (patch)
tree530222e2d51a940322dc4bab65444e555bfe667b
parent6b16723121bffd8ebf9b8e688af5457235f687ef (diff)
parentdeee1f03fb16af83c642121a5682af3398d90ece (diff)
cmcfixes77: merge with DEV300 m86
-rw-r--r--canvas/source/tools/pagemanager.cxx42
-rwxr-xr-xcanvas/source/vcl/canvashelper_texturefill.cxx2
-rwxr-xr-x[-rw-r--r--]dtrans/source/win32/dtobj/DOTransferable.cxx9
-rwxr-xr-x[-rw-r--r--]dtrans/source/win32/dtobj/FmtFilter.cxx43
-rwxr-xr-x[-rw-r--r--]dtrans/source/win32/dtobj/FmtFilter.hxx6
-rwxr-xr-x[-rw-r--r--]dtrans/source/win32/ftransl/ftransl.cxx1
-rw-r--r--l10ntools/scripts/localize.pl2
-rw-r--r--padmin/source/padialog.cxx14
-rw-r--r--padmin/source/padialog.src5
-rwxr-xr-x[-rw-r--r--]rsc/source/parser/rsclex.cxx11
-rw-r--r--svtools/inc/svtools/svlbitm.hxx2
-rw-r--r--svtools/source/contnr/svimpbox.cxx14
-rw-r--r--svtools/source/contnr/svlbitm.cxx51
-rw-r--r--svtools/source/contnr/svtreebx.cxx2
-rw-r--r--svtools/source/control/toolbarmenu.cxx23
-rw-r--r--svtools/source/filter.vcl/wmf/winmtf.cxx2
-rw-r--r--svtools/source/inc/unoiface.hxx5
-rwxr-xr-xsvtools/source/toolpanel/paneltabbar.cxx10
-rw-r--r--svtools/source/uno/toolboxcontroller.cxx2
-rw-r--r--svtools/source/uno/unoiface.cxx2
-rw-r--r--svtools/source/uno/unoimap.cxx4
-rw-r--r--toolkit/inc/pch/precompiled_toolkit.hxx3
-rw-r--r--toolkit/inc/toolkit/awt/vclxwindow.hxx9
-rw-r--r--toolkit/inc/toolkit/awt/vclxwindows.hxx31
-rw-r--r--toolkit/inc/toolkit/controls/roadmapcontrol.hxx31
-rw-r--r--toolkit/inc/toolkit/controls/unocontrol.hxx9
-rw-r--r--toolkit/inc/toolkit/controls/unocontrolbase.hxx2
-rw-r--r--toolkit/inc/toolkit/controls/unocontrolmodel.hxx20
-rw-r--r--toolkit/inc/toolkit/controls/unocontrols.hxx99
-rw-r--r--toolkit/inc/toolkit/helper/listenermultiplexer.hxx2
-rw-r--r--toolkit/inc/toolkit/helper/property.hxx2
-rw-r--r--toolkit/inc/toolkit/helper/servicenames.hxx5
-rw-r--r--toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx1
-rw-r--r--toolkit/source/awt/makefile.mk1
-rw-r--r--toolkit/source/awt/stylesettings.cxx987
-rw-r--r--toolkit/source/awt/stylesettings.hxx188
-rw-r--r--toolkit/source/awt/vclxwindow.cxx41
-rw-r--r--toolkit/source/awt/vclxwindows.cxx142
-rw-r--r--toolkit/source/controls/dialogcontrol.cxx11
-rw-r--r--toolkit/source/controls/roadmapcontrol.cxx94
-rw-r--r--toolkit/source/controls/unocontrol.cxx14
-rw-r--r--toolkit/source/controls/unocontrols.cxx173
-rw-r--r--toolkit/source/helper/servicenames.cxx1
-rw-r--r--toolkit/source/layout/core/import.cxx11
-rw-r--r--tools/source/misc/extendapplicationenvironment.cxx19
-rw-r--r--tools/source/string/strucvt.cxx2
-rw-r--r--unotools/source/config/fontcfg.cxx11
-rw-r--r--vcl/aqua/inc/salgdi.h12
-rw-r--r--vcl/aqua/source/app/salinst.cxx1
-rw-r--r--vcl/aqua/source/gdi/salgdi.cxx4
-rw-r--r--vcl/aqua/source/gdi/salnativewidgets.cxx40
-rw-r--r--vcl/inc/vcl/button.hxx2
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/edit.hxx4
-rw-r--r--vcl/inc/vcl/gfxlink.hxx7
-rw-r--r--vcl/inc/vcl/graphite_adaptors.hxx4
-rw-r--r--vcl/inc/vcl/graphite_cache.hxx34
-rw-r--r--vcl/inc/vcl/graphite_layout.hxx15
-rw-r--r--vcl/inc/vcl/imgcons.hxx105
-rw-r--r--vcl/inc/vcl/javachild.hxx2
-rw-r--r--vcl/inc/vcl/outdev.hxx12
-rw-r--r--vcl/inc/vcl/print.hxx2
-rw-r--r--vcl/inc/vcl/salgdi.hxx24
-rw-r--r--vcl/inc/vcl/salnativewidgets.hxx168
-rw-r--r--vcl/inc/vcl/svdata.hxx3
-rw-r--r--vcl/inc/vcl/syschild.hxx6
-rw-r--r--vcl/prj/d.lst3
-rw-r--r--vcl/source/app/help.cxx2
-rw-r--r--vcl/source/control/button.cxx96
-rw-r--r--vcl/source/control/combobox.cxx17
-rwxr-xr-x[-rw-r--r--]vcl/source/control/edit.cxx17
-rw-r--r--vcl/source/control/field.cxx48
-rw-r--r--vcl/source/control/ilstbox.cxx5
-rw-r--r--vcl/source/control/lstbox.cxx39
-rw-r--r--vcl/source/control/menubtn.cxx23
-rw-r--r--vcl/source/control/scrbar.cxx69
-rw-r--r--vcl/source/control/slider.cxx24
-rw-r--r--vcl/source/control/spinfld.cxx45
-rw-r--r--vcl/source/control/tabctrl.cxx23
-rw-r--r--vcl/source/fontsubset/sft.cxx7
-rw-r--r--vcl/source/gdi/gfxlink.cxx59
-rw-r--r--vcl/source/gdi/imgcons.cxx574
-rw-r--r--vcl/source/gdi/makefile.mk3
-rw-r--r--vcl/source/gdi/metric.cxx46
-rw-r--r--vcl/source/gdi/outdev2.cxx71
-rw-r--r--vcl/source/gdi/outdev3.cxx49
-rw-r--r--vcl/source/gdi/outdev6.cxx42
-rw-r--r--vcl/source/gdi/outdevnative.cxx214
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx1
-rw-r--r--vcl/source/gdi/print3.cxx31
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/salgdilayout.cxx77
-rw-r--r--vcl/source/gdi/salnativewidgets-none.cxx12
-rw-r--r--vcl/source/glyphs/gcach_ftyp.cxx3
-rw-r--r--vcl/source/glyphs/graphite_adaptors.cxx56
-rw-r--r--vcl/source/glyphs/graphite_cache.cxx2
-rw-r--r--vcl/source/glyphs/graphite_layout.cxx81
-rw-r--r--vcl/source/glyphs/graphite_textsrc.hxx1
-rw-r--r--vcl/source/helper/strhelper.cxx8
-rw-r--r--vcl/source/window/brdwin.cxx21
-rw-r--r--vcl/source/window/decoview.cxx12
-rw-r--r--vcl/source/window/dockingarea.cxx10
-rw-r--r--vcl/source/window/javachild.cxx154
-rw-r--r--vcl/source/window/menu.cxx55
-rw-r--r--vcl/source/window/printdlg.cxx23
-rw-r--r--vcl/source/window/status.cxx25
-rw-r--r--vcl/source/window/syschild.cxx164
-rw-r--r--vcl/source/window/tabpage.cxx4
-rw-r--r--vcl/source/window/toolbox.cxx31
-rw-r--r--vcl/source/window/window.cxx11
-rw-r--r--vcl/unx/gtk/app/gtkdata.cxx7
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx75
-rw-r--r--vcl/unx/headless/svpgdi.hxx2
-rw-r--r--vcl/unx/headless/svppspgraphics.cxx2
-rw-r--r--vcl/unx/headless/svppspgraphics.hxx2
-rw-r--r--vcl/unx/headless/svptext.cxx9
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkgdi.hxx12
-rw-r--r--vcl/unx/inc/pspgraphics.h2
-rw-r--r--vcl/unx/inc/salframe.h2
-rw-r--r--vcl/unx/inc/salgdi.h2
-rw-r--r--vcl/unx/kde/salnativewidgets-kde.cxx108
-rw-r--r--vcl/unx/kde4/KDESalGraphics.cxx82
-rw-r--r--vcl/unx/kde4/KDESalGraphics.hxx12
-rw-r--r--vcl/unx/source/app/i18n_im.cxx30
-rw-r--r--vcl/unx/source/app/saldata.cxx6
-rw-r--r--vcl/unx/source/app/saldisp.cxx6
-rw-r--r--vcl/unx/source/fontmanager/fontconfig.cxx21
-rw-r--r--vcl/unx/source/gdi/pspgraphics.cxx2
-rw-r--r--vcl/unx/source/gdi/salgdi3.cxx13
-rw-r--r--vcl/unx/source/gdi/salprnpsp.cxx1
-rw-r--r--vcl/unx/source/window/salframe.cxx26
-rw-r--r--vcl/util/makefile.mk8
-rwxr-xr-x[-rw-r--r--]vcl/win/inc/salgdi.h12
-rw-r--r--vcl/win/source/gdi/salgdi3.cxx15
-rwxr-xr-x[-rw-r--r--]vcl/win/source/gdi/salnativewidgets-luna.cxx106
-rwxr-xr-x[-rw-r--r--]vcl/win/source/gdi/winlayout.cxx2
134 files changed, 3045 insertions, 2384 deletions
diff --git a/canvas/source/tools/pagemanager.cxx b/canvas/source/tools/pagemanager.cxx
index b867b432857c..b2a71bf86cd3 100644
--- a/canvas/source/tools/pagemanager.cxx
+++ b/canvas/source/tools/pagemanager.cxx
@@ -70,7 +70,8 @@ namespace canvas
{
maPages.push_back(pPage);
FragmentSharedPtr pFragment(pPage->allocateSpace(rSize));
- maFragments.push_back(pFragment);
+ if (pFragment)
+ maFragments.push_back(pFragment);
return pFragment;
}
@@ -124,34 +125,39 @@ namespace canvas
FragmentContainer_t::const_iterator candidate(maFragments.begin());
while(candidate != aEnd)
{
- if(!((*candidate)->isNaked()))
+ if(*candidate && !((*candidate)->isNaked()))
break;
++candidate;
}
- const ::basegfx::B2ISize& rSize((*candidate)->getSize());
- sal_uInt32 nMaxArea(rSize.getX()*rSize.getY());
-
- FragmentContainer_t::const_iterator it(candidate);
- while(it != aEnd)
+ if (candidate != aEnd)
{
- if(!((*it)->isNaked()))
+ const ::basegfx::B2ISize& rSize((*candidate)->getSize());
+ sal_uInt32 nMaxArea(rSize.getX()*rSize.getY());
+
+ FragmentContainer_t::const_iterator it(candidate);
+ while(it != aEnd)
{
- const ::basegfx::B2ISize& rCandidateSize((*it)->getSize());
- const sal_uInt32 nArea(rCandidateSize.getX()*rCandidateSize.getY());
- if(nArea > nMaxArea)
+ if (*it && !((*it)->isNaked()))
{
- candidate=it;
- nMaxArea=nArea;
+ const ::basegfx::B2ISize& rCandidateSize((*it)->getSize());
+ const sal_uInt32 nArea(rCandidateSize.getX()*rCandidateSize.getY());
+ if(nArea > nMaxArea)
+ {
+ candidate=it;
+ nMaxArea=nArea;
+ }
}
+
+ ++it;
}
- ++it;
+ // this does not erase the candidate,
+ // but makes it 'naked'...
+ (*candidate)->free(*candidate);
}
-
- // this does not erase the candidate,
- // but makes it 'naked'...
- (*candidate)->free(*candidate);
+ else
+ break;
}
}
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index 023ceb2b5005..637b3af3315e 100755
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -700,7 +700,7 @@ namespace vclcanvas
}
#endif // complex-clipping vs. XOR-trick
-#if defined(VERBOSE) && OSL_DEBUG_LEVEL > 0
+#if 0 //defined(VERBOSE) && OSL_DEBUG_LEVEL > 0
{
::basegfx::B2DRectangle aRect(0.0, 0.0, 1.0, 1.0);
::basegfx::B2DRectangle aTextureDeviceRect;
diff --git a/dtrans/source/win32/dtobj/DOTransferable.cxx b/dtrans/source/win32/dtobj/DOTransferable.cxx
index 951c3a69d291..c590bf0e6a80 100644..100755
--- a/dtrans/source/win32/dtobj/DOTransferable.cxx
+++ b/dtrans/source/win32/dtobj/DOTransferable.cxx
@@ -348,6 +348,15 @@ CDOTransferable::ByteSequence_t SAL_CALL CDOTransferable::getClipboardData( CFor
byteStream = WinENHMFPictToOOMFPict( stgmedium.hEnhMetaFile );
else if (CF_HDROP == aFormatEtc.getClipformat())
byteStream = CF_HDROPToFileList(stgmedium.hGlobal);
+ else if ( CF_BITMAP == aFormatEtc.getClipformat() )
+ {
+ byteStream = WinBITMAPToOOBMP(stgmedium.hBitmap);
+ if( aFormatEtc.getTymed() == TYMED_GDI &&
+ ! stgmedium.pUnkForRelease )
+ {
+ DeleteObject(stgmedium.hBitmap);
+ }
+ }
else
{
clipDataToByteStream( aFormatEtc.getClipformat( ), stgmedium, byteStream );
diff --git a/dtrans/source/win32/dtobj/FmtFilter.cxx b/dtrans/source/win32/dtobj/FmtFilter.cxx
index c8a8743647a9..c4f73977d92d 100644..100755
--- a/dtrans/source/win32/dtobj/FmtFilter.cxx
+++ b/dtrans/source/win32/dtobj/FmtFilter.cxx
@@ -534,3 +534,46 @@ ByteSequence_t CF_HDROPToFileList(HGLOBAL hGlobal)
return FileListToByteSequence(files);
}
+//------------------------------------------------------------------------
+// convert a windows bitmap handle into a openoffice bitmap
+//------------------------------------------------------------------------
+
+Sequence< sal_Int8 > SAL_CALL WinBITMAPToOOBMP( HBITMAP aHBMP )
+{
+ Sequence< sal_Int8 > ooBmpStream;
+
+ SIZE aBmpSize;
+ if( GetBitmapDimensionEx( aHBMP, &aBmpSize ) )
+ {
+ // fill bitmap info header
+ size_t nDataBytes = 4 * aBmpSize.cy * aBmpSize.cy;
+ Sequence< sal_Int8 > aBitmapStream(
+ sizeof(BITMAPINFO) +
+ nDataBytes
+ );
+ PBITMAPINFOHEADER pBmp = (PBITMAPINFOHEADER)aBitmapStream.getArray();
+ pBmp->biSize = sizeof( BITMAPINFOHEADER );
+ pBmp->biWidth = aBmpSize.cx;
+ pBmp->biHeight = aBmpSize.cy;
+ pBmp->biPlanes = 1;
+ pBmp->biBitCount = 32;
+ pBmp->biCompression = BI_RGB;
+ pBmp->biSizeImage = (DWORD)nDataBytes;
+ pBmp->biXPelsPerMeter = 1000;
+ pBmp->biYPelsPerMeter = 1000;
+ pBmp->biClrUsed = 0;
+ pBmp->biClrImportant = 0;
+ if( GetDIBits( 0, // DC, 0 is a default GC, basically that of the desktop
+ aHBMP,
+ 0, aBmpSize.cy,
+ aBitmapStream.getArray() + sizeof(BITMAPINFO),
+ (LPBITMAPINFO)pBmp,
+ DIB_RGB_COLORS ) )
+ {
+ ooBmpStream = WinDIBToOOBMP( aBitmapStream );
+ }
+ }
+
+ return ooBmpStream;
+}
+
diff --git a/dtrans/source/win32/dtobj/FmtFilter.hxx b/dtrans/source/win32/dtobj/FmtFilter.hxx
index 3f433561a3b1..84f764c9769b 100644..100755
--- a/dtrans/source/win32/dtobj/FmtFilter.hxx
+++ b/dtrans/source/win32/dtobj/FmtFilter.hxx
@@ -67,6 +67,12 @@ com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL WinDIBToOOBMP( const com::sun
/*------------------------------------------------------------------------
input:
+ aWinDIB - sequence of bytes containing a windows bitmap handle
+------------------------------------------------------------------------*/
+com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL WinBITMAPToOOBMP( HBITMAP );
+
+/*------------------------------------------------------------------------
+ input:
aOOBmp - sequence of bytes containing a openoffice bitmap
------------------------------------------------------------------------*/
com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL OOBmpToWinDIB( com::sun::star::uno::Sequence< sal_Int8 >& aOOBmp );
diff --git a/dtrans/source/win32/ftransl/ftransl.cxx b/dtrans/source/win32/ftransl/ftransl.cxx
index c0a8264a71b8..98c6625bb33e 100644..100755
--- a/dtrans/source/win32/ftransl/ftransl.cxx
+++ b/dtrans/source/win32/ftransl/ftransl.cxx
@@ -281,6 +281,7 @@ void SAL_CALL CDataFormatTranslator::initTranslationTable()
m_TranslTable.push_back(FormatEntry("application/x-openoffice-dif;windows_formatname=\"DIF\"", "DIF", "DIF", CF_DIF, CPPUTYPE_DEFAULT));
// SOT_FORMAT_BITMAP
m_TranslTable.push_back(FormatEntry("application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"", "Bitmap", "Bitmap", CF_DIB, CPPUTYPE_DEFAULT));
+ m_TranslTable.push_back(FormatEntry("application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"", "Bitmap", "Bitmap", CF_BITMAP, CPPUTYPE_DEFAULT));
// SOT_FORMAT_STRING
m_TranslTable.push_back(FormatEntry("text/plain;charset=utf-16", "Unicode-Text", "", CF_UNICODETEXT, CppuType_String));
// Format Locale - for internal use
diff --git a/l10ntools/scripts/localize.pl b/l10ntools/scripts/localize.pl
index 4aea1d933992..4b7040d6583d 100644
--- a/l10ntools/scripts/localize.pl
+++ b/l10ntools/scripts/localize.pl
@@ -461,6 +461,7 @@ sub collectfiles{
### Search sdf particles
#print STDOUT "### Searching sdf particles\n";
my $working_path = getcwd();
+ chdir $ENV{SOURCE_ROOT_DIR}, if defined $ENV{SOURCE_ROOT_DIR};
#chdir $srcpath;
#find ( { wanted => \&wanted , follow => 1 }, getcwd() );
#chdir $working_path;
@@ -701,6 +702,7 @@ sub collectfiles{
close DESTFILE;
close LOCALIZEPARTICLE;
close ALLPARTICLES_MERGED;
+ chdir $working_path;
#print STDOUT "DBG: \$localizeSDF $localizeSDF \$particleSDF_merged $particleSDF_merged\n";
unlink $localizeSDF , $particleSDF_merged , $my_localize_log;
diff --git a/padmin/source/padialog.cxx b/padmin/source/padialog.cxx
index 583e14c06caa..d91ebea0c73d 100644
--- a/padmin/source/padialog.cxx
+++ b/padmin/source/padialog.cxx
@@ -152,6 +152,20 @@ void PADialog::Init()
m_aFontsPB.Enable( FALSE );
m_aFontsPB.Show( FALSE );
}
+
+ // at this point no actual changes will be written
+ // but the write will have checked whether any writeable config exists
+ if( ! m_rPIManager.writePrinterConfig() )
+ {
+ m_aAddPB.Enable( FALSE );
+ m_aRemPB.Enable( FALSE );
+ m_aConfPB.Enable( FALSE );
+ m_aRenamePB.Enable( FALSE );
+ m_aStdPB.Enable( FALSE );
+ m_aCUPSCB.Enable( FALSE );
+ ErrorBox aBox( GetParent(), WB_OK | WB_DEF_OK, String( PaResId( RID_ERR_NOWRITE ) ) );
+ aBox.Execute();
+ }
}
PADialog::~PADialog()
diff --git a/padmin/source/padialog.src b/padmin/source/padialog.src
index 8834bba3226c..ab09d9155d1b 100644
--- a/padmin/source/padialog.src
+++ b/padmin/source/padialog.src
@@ -340,6 +340,11 @@ String RID_PA_TXT_TESTPAGE_PRINTED
Text [ en-US ] = "The test page was printed succesfully. Please check the result.";
};
+String RID_ERR_NOWRITE
+{
+ Text [en-US] = "No printers can be installed, because the file system is read-only.\nPlease contact your system administrator.";
+};
+
String RID_QRY_PRTNAME
{
Text [ en-US ] = "~New printer name";
diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx
index e0df5de254f9..76ec4c551d52 100644..100755
--- a/rsc/source/parser/rsclex.cxx
+++ b/rsc/source/parser/rsclex.cxx
@@ -175,11 +175,16 @@ int MakeToken( YYSTYPE * pTokenVal ){
c = pFI->GetFastChar();
if( c == '"' )
{
- c = pFI->GetFastChar();
+ do
+ {
+ c = pFI->GetFastChar();
+ }
+ while( c == ' ' || c == '\t' );
if( c == '"' )
{
- aBuf.append( '"' );
- aBuf.append( '"' );
+ // this is a continued string
+ // note: multiline string continuations are handled by the parser
+ // see rscyacc.y
}
else
bDone = TRUE;
diff --git a/svtools/inc/svtools/svlbitm.hxx b/svtools/inc/svtools/svlbitm.hxx
index c28b8d5db10c..5158c38fbd87 100644
--- a/svtools/inc/svtools/svlbitm.hxx
+++ b/svtools/inc/svtools/svlbitm.hxx
@@ -176,6 +176,8 @@ class SVT_DLLPUBLIC SvLBoxButton : public SvLBoxItem
USHORT nItemFlags;
USHORT nImgArrOffs;
USHORT nBaseOffs;
+
+ void ImplAdjustBoxSize( Size& io_rCtrlSize, ControlType i_eType, Window* pParent );
public:
// An SvLBoxButton can be of three different kinds: an
// enabled checkbox (the normal kind), a disabled checkbox
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 7111a29a6a8a..484584828b9f 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -1067,14 +1067,14 @@ void SvImpLBox::DrawNet()
//so that SvImpLBox::DrawNet() doesn't draw anything too
if(pView->IsNativeControlSupported( CTRL_LISTNET, PART_ENTIRE_CONTROL)) {
ImplControlValue aControlValue;
- Point aTemp(0,0); // temporary needed for g++ 3.3.5
- Region aCtrlRegion( Rectangle(aTemp, Size( 0, 0 )) );
+ Point aTemp(0,0); // temporary needed for g++ 3.3.5
+ Rectangle aCtrlRegion( aTemp, Size( 0, 0 ) );
ControlState nState = CTRL_STATE_ENABLED;
- if( pView->DrawNativeControl( CTRL_LISTNET, PART_ENTIRE_CONTROL,
- aCtrlRegion, nState, aControlValue, rtl::OUString() ) )
- {
- return;
- }
+ if( pView->DrawNativeControl( CTRL_LISTNET, PART_ENTIRE_CONTROL,
+ aCtrlRegion, nState, aControlValue, rtl::OUString() ) )
+ {
+ return;
+ }
}
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index 82321b53259e..d260f984c2b0 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -406,7 +406,7 @@ BOOL SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry )
}
void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
- SvLBoxEntry* )
+ SvLBoxEntry* /*pEntry*/ )
{
DBG_CHKTHIS(SvLBoxButton,0);
USHORT nIndex = eKind == SvLBoxButtonKind_staticImage
@@ -418,14 +418,13 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
//Native drawing
///
BOOL bNativeOK = FALSE;
- Window *pWin = NULL;
- if( rDev.GetOutDevType() == OUTDEV_WINDOW )
- pWin = (Window*) &rDev;
-
- if ( nIndex != SV_BMP_STATICIMAGE && pWin && pWin->IsNativeControlSupported( (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX, PART_ENTIRE_CONTROL) )
+ ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX;
+ if ( nIndex != SV_BMP_STATICIMAGE && rDev.IsNativeControlSupported( eCtrlType, PART_ENTIRE_CONTROL) )
{
+ Size aSize(pData->Width(), pData->Height());
+ ImplAdjustBoxSize( aSize, eCtrlType, &rDev );
ImplControlValue aControlValue;
- Region aCtrlRegion( Rectangle(rPos, Size(pData->Width(), pData->Height())) );
+ Rectangle aCtrlRegion( rPos, aSize );
ControlState nState = 0;
//states CTRL_STATE_DEFAULT, CTRL_STATE_PRESSED and CTRL_STATE_ROLLOVER are not implemented
@@ -439,7 +438,7 @@ void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
else if ( IsStateTristate() )
aControlValue.setTristateVal( BUTTONVALUE_MIXED );
- bNativeOK = pWin->DrawNativeControl( (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX, PART_ENTIRE_CONTROL,
+ bNativeOK = rDev.DrawNativeControl( eCtrlType, PART_ENTIRE_CONTROL,
aCtrlRegion, nState, aControlValue, rtl::OUString() );
}
@@ -459,13 +458,47 @@ void SvLBoxButton::Clone( SvLBoxItem* pSource )
pData = ((SvLBoxButton*)pSource)->pData;
}
+void SvLBoxButton::ImplAdjustBoxSize( Size& io_rSize, ControlType i_eType, Window* i_pParent )
+{
+ if ( i_pParent->IsNativeControlSupported( i_eType, PART_ENTIRE_CONTROL) )
+ {
+ ImplControlValue aControlValue;
+ Rectangle aCtrlRegion( Point( 0, 0 ), io_rSize );
+ ControlState nState = CTRL_STATE_ENABLED;
+
+ aControlValue.setTristateVal( BUTTONVALUE_ON );
+
+ Rectangle aNativeBounds, aNativeContent;
+ bool bNativeOK = i_pParent->GetNativeControlRegion( i_eType,
+ PART_ENTIRE_CONTROL,
+ aCtrlRegion,
+ nState,
+ aControlValue,
+ rtl::OUString(),
+ aNativeBounds,
+ aNativeContent );
+ if( bNativeOK )
+ {
+ Size aContentSize( aNativeContent.GetSize() );
+ // leave a little space around the box image (looks better
+ if( aContentSize.Height() + 2 > io_rSize.Height() )
+ io_rSize.Height() = aContentSize.Height() + 2;
+ }
+ }
+}
+
void SvLBoxButton::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
SvViewDataItem* pViewData )
{
DBG_CHKTHIS(SvLBoxButton,0);
if( !pViewData )
pViewData = pView->GetViewDataItem( pEntry, this );
- pViewData->aSize = Size( pData->Width(), pData->Height() );
+ Size aSize( pData->Width(), pData->Height() );
+
+ ControlType eCtrlType = (pData->IsRadio())? CTRL_RADIOBUTTON : CTRL_CHECKBOX;
+ if ( eKind != SvLBoxButtonKind_staticImage && pView )
+ ImplAdjustBoxSize( aSize, eCtrlType, pView );
+ pViewData->aSize = aSize;
}
bool SvLBoxButton::CheckModification() const
diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx
index bf6e41f93f36..b11a3f12ddf3 100644
--- a/svtools/source/contnr/svtreebx.cxx
+++ b/svtools/source/contnr/svtreebx.cxx
@@ -1814,7 +1814,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
if ( IsNativeControlSupported( CTRL_LISTNODE, PART_ENTIRE_CONTROL) )
{
ImplControlValue aControlValue;
- Region aCtrlRegion( Rectangle(aPos, pImg->GetSizePixel() ) );
+ Rectangle aCtrlRegion( aPos, pImg->GetSizePixel() );
ControlState nState = 0;
if ( IsEnabled() ) nState |= CTRL_STATE_ENABLED;
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index fa393da3d5a8..f0bd192fc02c 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -920,7 +920,7 @@ void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight )
IntersectClipRegion( Rectangle( Point( nX, nY ), Size( aSz.Width(), pEntry->maSize.Height() ) ) );
Rectangle aCtrlRect( Point( nX, 0 ), Size( aPxSize.Width()-nX, aPxSize.Height() ) );
DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL,
- Region( aCtrlRect ),
+ aCtrlRect,
CTRL_STATE_ENABLED,
ImplControlValue(),
OUString() );
@@ -928,7 +928,7 @@ void ToolbarMenu::implHighlightEntry( int nHighlightEntry, bool bHighlight )
{
bDrawItemRect = false;
if( FALSE == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM,
- Region( aItemRect ),
+ aItemRect,
CTRL_STATE_SELECTED | ( pEntry->mbEnabled? CTRL_STATE_ENABLED: 0 ),
ImplControlValue(),
OUString() ) )
@@ -1312,13 +1312,12 @@ static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRec
if( i_pWindow->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) )
{
ImplControlValue aControlValue;
- Region aCtrlRegion( i_rRect );
ControlState nState = CTRL_STATE_PRESSED | CTRL_STATE_ENABLED;
aControlValue.setTristateVal( BUTTONVALUE_ON );
bNativeOk = i_pWindow->DrawNativeControl( CTRL_TOOLBAR, PART_BUTTON,
- aCtrlRegion, nState, aControlValue,
+ i_rRect, nState, aControlValue,
rtl::OUString() );
}
@@ -1335,10 +1334,10 @@ static long ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lo
rMaxWidth = rCheckHeight = rRadioHeight = 0;
ImplControlValue aVal;
- Region aNativeBounds;
- Region aNativeContent;
+ Rectangle aNativeBounds;
+ Rectangle aNativeContent;
Point tmp( 0, 0 );
- Region aCtrlRegion( Rectangle( tmp, Size( 100, 15 ) ) );
+ Rectangle aCtrlRegion( tmp, Size( 100, 15 ) );
if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM_CHECK_MARK ) )
{
if( pWin->GetNativeControlRegion( ControlType(CTRL_MENU_POPUP),
@@ -1351,8 +1350,8 @@ static long ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lo
aNativeContent )
)
{
- rCheckHeight = aNativeBounds.GetBoundRect().GetHeight();
- rMaxWidth = aNativeContent.GetBoundRect().GetWidth();
+ rCheckHeight = aNativeBounds.GetHeight();
+ rMaxWidth = aNativeContent.GetWidth();
}
}
if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM_RADIO_MARK ) )
@@ -1367,8 +1366,8 @@ static long ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lo
aNativeContent )
)
{
- rRadioHeight = aNativeBounds.GetBoundRect().GetHeight();
- rMaxWidth = Max (rMaxWidth, aNativeContent.GetBoundRect().GetWidth());
+ rRadioHeight = aNativeBounds.GetHeight();
+ rMaxWidth = Max (rMaxWidth, aNativeContent.GetWidth());
}
}
return (rCheckHeight > rRadioHeight) ? rCheckHeight : rRadioHeight;
@@ -1492,7 +1491,7 @@ void ToolbarMenu::implPaint( ToolbarMenuEntry* pThisOnly, bool bHighlighted )
aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight)/2;
Rectangle aCheckRect( aTmpPos, Size( nCtrlHeight, nCtrlHeight ) );
- DrawNativeControl( CTRL_MENU_POPUP, nPart, Region( aCheckRect ), nState, ImplControlValue(), OUString() );
+ DrawNativeControl( CTRL_MENU_POPUP, nPart, aCheckRect, nState, ImplControlValue(), OUString() );
}
else if ( pEntry->mbChecked ) // by default do nothing for unchecked items
{
diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx
index bf176015fd77..787e6522b890 100644
--- a/svtools/source/filter.vcl/wmf/winmtf.cxx
+++ b/svtools/source/filter.vcl/wmf/winmtf.cxx
@@ -2043,7 +2043,7 @@ void WinMtfOutput::ModifyWorldTransform( const XForm& rXForm, UINT32 nMode )
case MWT_IDENTITY :
{
maXForm.eM11 = maXForm.eM12 = maXForm.eM21 = maXForm.eM22 = 1.0f;
- maXForm.eDx = maXForm.eDx = 0.0f;
+ maXForm.eDx = maXForm.eDy = 0.0f;
}
break;
diff --git a/svtools/source/inc/unoiface.hxx b/svtools/source/inc/unoiface.hxx
index 5d34ea6f47ed..f15cb7c10d4c 100644
--- a/svtools/source/inc/unoiface.hxx
+++ b/svtools/source/inc/unoiface.hxx
@@ -39,7 +39,6 @@
#include <com/sun/star/awt/XTextLayoutConstrains.hpp>
#include <svtools/svmedit.hxx>
#include <svtools/fmtfield.hxx>
-#include <com/sun/star/awt/XImageConsumer.hpp>
#include <comphelper/uno3.hxx>
@@ -243,7 +242,7 @@ struct RMItemData
::rtl::OUString Label;
};
-typedef ::cppu::ImplInheritanceHelper3 < VCLXImageConsumer
+typedef ::cppu::ImplInheritanceHelper3 < VCLXGraphicControl
, ::com::sun::star::container::XContainerListener
, ::com::sun::star::beans::XPropertyChangeListener
, ::com::sun::star::awt::XItemEventBroadcaster
@@ -288,7 +287,7 @@ public:
protected:
- // VCLXImageConsumer overridables
+ // VCLXGraphicControl overridables
virtual void ImplSetNewImage();
static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx
index 38aee00c8f55..23067d3ee5d0 100755
--- a/svtools/source/toolpanel/paneltabbar.cxx
+++ b/svtools/source/toolpanel/paneltabbar.cxx
@@ -296,19 +296,18 @@ namespace svt
const ControlState nState( lcl_ItemToControlState( i_nItemFlags ) );
TabitemValue tiValue;
- ImplControlValue aControlValue( (void*)(&tiValue) );
- Region aBoundingRegion, aContentRegion;
+ Rectangle aBoundingRegion, aContentRegion;
bool bNativeOK = getTargetDevice().GetNativeControlRegion(
CTRL_TAB_ITEM, PART_ENTIRE_CONTROL,
i_rContentArea, nState,
- aControlValue, ::rtl::OUString(),
+ tiValue, ::rtl::OUString(),
aBoundingRegion, aContentRegion
);
(void)bNativeOK;
OSL_ENSURE( bNativeOK, "NWFTabItemRenderer::calculateDecorations: GetNativeControlRegion not implemented for CTRL_TAB_ITEM?!" );
- return aBoundingRegion.GetBoundRect();
+ return aBoundingRegion;
}
//------------------------------------------------------------------------------------------------------------------
@@ -322,9 +321,8 @@ namespace svt
if ( i_nItemFlags & ITEM_POSITION_LAST )
tiValue.mnAlignment |= TABITEM_LAST_IN_GROUP;
- ImplControlValue aControlValue( (void *)(&tiValue) );
- bool bNativeOK = getTargetDevice().DrawNativeControl( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL, i_rContentRect, nState, aControlValue, rtl::OUString() );
+ bool bNativeOK = getTargetDevice().DrawNativeControl( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL, i_rContentRect, nState, tiValue, rtl::OUString() );
(void)bNativeOK;
OSL_ENSURE( bNativeOK, "NWFTabItemRenderer::preRenderItem: inconsistent NWF implementation!" );
// IsNativeControlSupported returned true, previously, otherwise we would not be here ...
diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx
index 92ae93f5080d..bdb2256a07e8 100644
--- a/svtools/source/uno/toolboxcontroller.cxx
+++ b/svtools/source/uno/toolboxcontroller.cxx
@@ -806,7 +806,7 @@ sal_Bool SAL_CALL ToolboxController::convertFastPropertyValue( com::sun::star::u
{
case TOOLBARCONTROLLER_PROPHANDLE_SUPPORTSVISIABLE:
{
- sal_Bool aNewValue;
+ sal_Bool aNewValue(sal_False);
aValue >>= aNewValue;
if (aNewValue != m_bSupportVisiable)
{
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index f2090be1655f..2d22d9cedb33 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -1664,7 +1664,7 @@ void SVTXRoadmap::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_TEXT,
0);
VCLXWindow::ImplGetPropertyIds( rIds, true );
- VCLXImageConsumer::ImplGetPropertyIds( rIds );
+ VCLXGraphicControl::ImplGetPropertyIds( rIds );
}
// ----------------------------------------------------
diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index 6b6e35482ae9..88f22f0c8402 100644
--- a/svtools/source/uno/unoimap.cxx
+++ b/svtools/source/uno/unoimap.cxx
@@ -210,6 +210,8 @@ PropertySetInfo* SvUnoImageMapObject::createPropertySetInfo( UINT16 nType )
SvUnoImageMapObject::SvUnoImageMapObject( UINT16 nType, const SvEventDescription* pSupportedMacroItems )
: PropertySetHelper( createPropertySetInfo( nType ) ),
mnType( nType )
+, mbIsActive( true )
+, mnRadius( 0 )
{
mpEvents = new SvMacroTableEventDescriptor( pSupportedMacroItems );
mpEvents->acquire();
@@ -218,6 +220,8 @@ SvUnoImageMapObject::SvUnoImageMapObject( UINT16 nType, const SvEventDescription
SvUnoImageMapObject::SvUnoImageMapObject( const IMapObject& rMapObject, const SvEventDescription* pSupportedMacroItems )
: PropertySetHelper( createPropertySetInfo( rMapObject.GetType() ) ),
mnType( rMapObject.GetType() )
+, mbIsActive( true )
+, mnRadius( 0 )
{
maURL = rMapObject.GetURL();
maAltText = rMapObject.GetAltText();
diff --git a/toolkit/inc/pch/precompiled_toolkit.hxx b/toolkit/inc/pch/precompiled_toolkit.hxx
index 386bd6803ca4..d0baff3b8343 100644
--- a/toolkit/inc/pch/precompiled_toolkit.hxx
+++ b/toolkit/inc/pch/precompiled_toolkit.hxx
@@ -107,8 +107,6 @@
#include "com/sun/star/awt/XFont.hpp"
#include "com/sun/star/awt/XGraphics.hpp"
#include "com/sun/star/awt/XImageButton.hpp"
-#include "com/sun/star/awt/XImageConsumer.hpp"
-#include "com/sun/star/awt/XImageProducer.hpp"
#include "com/sun/star/awt/XInfoPrinter.hpp"
#include "com/sun/star/awt/XItemEventBroadcaster.hpp"
#include "com/sun/star/awt/XItemListener.hpp"
@@ -328,7 +326,6 @@
#include "vcl/font.hxx"
#include "vcl/gradient.hxx"
#include "vcl/image.hxx"
-#include "vcl/imgcons.hxx"
#include "vcl/jobset.hxx"
#include "vcl/mapunit.hxx"
#include "vcl/menu.hxx"
diff --git a/toolkit/inc/toolkit/awt/vclxwindow.hxx b/toolkit/inc/toolkit/awt/vclxwindow.hxx
index 6ad3c3ab6076..565691b97f09 100644
--- a/toolkit/inc/toolkit/awt/vclxwindow.hxx
+++ b/toolkit/inc/toolkit/awt/vclxwindow.hxx
@@ -41,9 +41,10 @@
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
#include <com/sun/star/awt/XDockableWindow.hpp>
+#include <com/sun/star/awt/XStyleSettingsSupplier.hpp>
#include <cppuhelper/weak.hxx>
-#include <cppuhelper/implbase8.hxx>
+#include <cppuhelper/implbase9.hxx>
#include <osl/mutex.hxx>
#include <tools/gen.hxx> // Size
@@ -71,7 +72,7 @@ namespace toolkit
class UnoPropertyArrayHelper;
class VCLXWindowImpl;
-typedef ::cppu::ImplInheritanceHelper8 < VCLXDevice
+typedef ::cppu::ImplInheritanceHelper9 < VCLXDevice
, ::com::sun::star::awt::XWindow2
, ::com::sun::star::awt::XVclWindowPeer
, ::com::sun::star::awt::XLayoutConstrains
@@ -80,6 +81,7 @@ typedef ::cppu::ImplInheritanceHelper8 < VCLXDevice
, ::com::sun::star::accessibility::XAccessible
, ::com::sun::star::lang::XEventListener
, ::com::sun::star::beans::XPropertySetInfo
+ , ::com::sun::star::awt::XStyleSettingsSupplier
> VCLXWindow_Base;
class TOOLKIT_DLLPUBLIC VCLXWindow : public VCLXWindow_Base
@@ -232,6 +234,9 @@ public:
::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getProperties( ) throw (::com::sun::star::uno::RuntimeException);
::com::sun::star::beans::Property SAL_CALL getPropertyByName( const ::rtl::OUString& aName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
::sal_Bool SAL_CALL hasPropertyByName( const ::rtl::OUString& Name ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XStyleSettingsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XStyleSettings > SAL_CALL getStyleSettings() throw (::com::sun::star::uno::RuntimeException);
};
#endif // _TOOLKIT_AWT_VCLXWINDOW_HXX_
diff --git a/toolkit/inc/toolkit/awt/vclxwindows.hxx b/toolkit/inc/toolkit/awt/vclxwindows.hxx
index ca3267bffb5e..80e3a37279d3 100644
--- a/toolkit/inc/toolkit/awt/vclxwindows.hxx
+++ b/toolkit/inc/toolkit/awt/vclxwindows.hxx
@@ -82,7 +82,6 @@
#include <com/sun/star/awt/XDateField.hpp>
#include <com/sun/star/awt/XComboBox.hpp>
#include <com/sun/star/awt/XCheckBox.hpp>
-#include <com/sun/star/awt/XImageConsumer.hpp>
#include <com/sun/star/awt/XItemListListener.hpp>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/implbase3.hxx>
@@ -93,7 +92,6 @@
#include <cppuhelper/implbase1.hxx>
#include <vcl/pointr.hxx>
-#include <vcl/imgcons.hxx>
#include <vcl/image.hxx>
class Button;
@@ -111,17 +109,14 @@ class VclSimpleEvent;
class VclMenuEvent;
// ----------------------------------------------------
-// class VCLXImageConsumer
-// deriving from VCLXWindow and XImageConsumer
+// class VCLXGraphicControl
+// deriving from VCLXWindow, drawing the graphic which exists as "Graphic" at the model
// ----------------------------------------------------
-typedef ::cppu::ImplInheritanceHelper1< VCLXWindow, ::com::sun::star::awt::XImageConsumer > VCLXImageConsumer_Base;
-class TOOLKIT_DLLPUBLIC VCLXImageConsumer : public VCLXImageConsumer_Base
+class TOOLKIT_DLLPUBLIC VCLXGraphicControl : public VCLXWindow
{
private:
- /// implements our XImageConsumer functionality
- ImageConsumer maImageConsumer;
/// the image we currently display
Image maImage;
@@ -132,21 +127,11 @@ protected:
// ::com::sun::star::awt::XWindow
void SAL_CALL setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw(::com::sun::star::uno::RuntimeException);
- // ::com::sun::star::awt::XImageConsumer
- void SAL_CALL init( sal_Int32 Width, sal_Int32 Height ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setColorModel( sal_Int16 BitCount, const ::com::sun::star::uno::Sequence< sal_Int32 >& RGBAPal, sal_Int32 RedMask, sal_Int32 GreenMask, sal_Int32 BlueMask, sal_Int32 AlphaMask ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setPixelsByBytes( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, const ::com::sun::star::uno::Sequence< sal_Int8 >& aProducerData, sal_Int32 nOffset, sal_Int32 nScanSize ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL setPixelsByLongs( sal_Int32 nX, sal_Int32 nY, sal_Int32 nWidth, sal_Int32 nHeight, const ::com::sun::star::uno::Sequence< sal_Int32 >& aProducerData, sal_Int32 nOffset, sal_Int32 nScanSize ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL complete( sal_Int32 Status, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageProducer >& xProducer ) throw(::com::sun::star::uno::RuntimeException);
-
// ::com::sun::star::awt::VclWindowPeer
void SAL_CALL setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
protected:
- void ImplUpdateImage( sal_Bool bGetNewImage );
-
-protected:
/** forward our bitmap to our window
@precond
our mutex is locked
@@ -155,6 +140,7 @@ protected:
@see GetBitmap
*/
virtual void ImplSetNewImage();
+
public:
static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
@@ -164,7 +150,7 @@ public:
// ----------------------------------------------------
// class VCLXButton
// ----------------------------------------------------
-typedef ::cppu::ImplInheritanceHelper2 < VCLXImageConsumer
+typedef ::cppu::ImplInheritanceHelper2 < VCLXGraphicControl
, ::com::sun::star::awt::XButton
, ::com::sun::star::awt::XToggleButton
> VCLXButton_Base;
@@ -213,7 +199,7 @@ public:
// ----------------------------------------------------
// class VCLXImageControl
// ----------------------------------------------------
-class VCLXImageControl : public VCLXImageConsumer
+class VCLXImageControl : public VCLXGraphicControl
{
public:
VCLXImageControl();
@@ -230,6 +216,7 @@ public:
static void ImplGetPropertyIds( std::list< sal_uInt16 > &aIds );
virtual void GetPropertyIds( std::list< sal_uInt16 > &aIds ) { return ImplGetPropertyIds( aIds ); }
+
protected:
virtual void ImplSetNewImage();
};
@@ -239,7 +226,7 @@ protected:
// ----------------------------------------------------
class VCLXCheckBox : public ::com::sun::star::awt::XCheckBox,
public ::com::sun::star::awt::XButton,
- public VCLXImageConsumer
+ public VCLXGraphicControl
{
private:
ActionListenerMultiplexer maActionListeners;
@@ -297,7 +284,7 @@ public:
// ----------------------------------------------------
class VCLXRadioButton : public ::com::sun::star::awt::XRadioButton,
public ::com::sun::star::awt::XButton,
- public VCLXImageConsumer
+ public VCLXGraphicControl
{
private:
ItemListenerMultiplexer maItemListeners;
diff --git a/toolkit/inc/toolkit/controls/roadmapcontrol.hxx b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx
index 46f31947b276..1b86d277fde2 100644
--- a/toolkit/inc/toolkit/controls/roadmapcontrol.hxx
+++ b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx
@@ -40,25 +40,20 @@
#include <com/sun/star/container/XContainerListener.hpp>
#include <com/sun/star/awt/XItemListener.hpp>
#include <com/sun/star/awt/XItemEventBroadcaster.hpp>
-#include <com/sun/star/awt/XImageConsumer.hpp>
-#include <com/sun/star/awt/XImageProducer.hpp>
#include <cppuhelper/implbase2.hxx>
-
-#ifndef _CPPUHELPER_IMPLBASE5_HXX_
+#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/implbase4.hxx>
-#endif
#include <comphelper/uno3.hxx>
-typedef UnoControlModel UnoControlRoadmapModel_Base;
+typedef GraphicControlModel UnoControlRoadmapModel_Base;
-typedef ::cppu::ImplHelper4 < ::com::sun::star::lang::XSingleServiceFactory
+typedef ::cppu::ImplHelper3 < ::com::sun::star::lang::XSingleServiceFactory
, ::com::sun::star::container::XContainer
, ::com::sun::star::container::XIndexContainer
- , ::com::sun::star::awt::XImageProducer
> UnoControlRoadmapModel_IBase;
@@ -100,8 +95,6 @@ namespace toolkit{
typedef ::std::vector< Reference< XInterface > > RoadmapItemHolderList;
- std::list< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer > > maImageListeners;
-
ContainerListenerMultiplexer maContainerListeners;
RoadmapItemHolderList maRoadmapItems;
@@ -133,7 +126,7 @@ namespace toolkit{
::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::lang::XServiceInfo
- DECLIMPL_SERVICEINFO_DERIVED( UnoControlRoadmapModel, UnoControlModel, szServiceName2_UnoControlRoadmapModel )
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlRoadmapModel, UnoControlRoadmapModel_Base, szServiceName2_UnoControlRoadmapModel )
sal_Int32 SAL_CALL getCount() throw (RuntimeException);
virtual Any SAL_CALL getByIndex( sal_Int32 Index ) throw (IndexOutOfBoundsException, WrappedTargetException, RuntimeException );
@@ -145,16 +138,10 @@ namespace toolkit{
virtual void SAL_CALL addContainerListener( const Reference< XContainerListener >& xListener ) throw (RuntimeException);
virtual void SAL_CALL removeContainerListener( const Reference< XContainerListener >& xListener ) throw (RuntimeException);
- ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlModel::queryInterface(rType); }
+ ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlRoadmapModel_Base::queryInterface(rType); }
::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL acquire() throw() { UnoControlModel::acquire(); }
- void SAL_CALL release() throw() { UnoControlModel::release(); }
-
-
- // ::com::sun::star::awt::XImageProducer
- void SAL_CALL addConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException);
- void SAL_CALL removeConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException);
- void SAL_CALL startProduction( ) throw (::com::sun::star::uno::RuntimeException);
+ void SAL_CALL acquire() throw() { UnoControlRoadmapModel_Base::acquire(); }
+ void SAL_CALL release() throw() { UnoControlRoadmapModel_Base::release(); }
// ::com::sun::star::beans::XPropertySet
@@ -190,8 +177,6 @@ namespace toolkit{
sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException );
- void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
-
void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& rEvent )throw(::com::sun::star::uno::RuntimeException);
void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& rEvent )throw(::com::sun::star::uno::RuntimeException);
void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& rEvent )throw(::com::sun::star::uno::RuntimeException);
@@ -204,8 +189,6 @@ namespace toolkit{
virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException);
- void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal );
-
// XTypeProvider
DECLARE_XTYPEPROVIDER( )
DECLARE_XINTERFACE()
diff --git a/toolkit/inc/toolkit/controls/unocontrol.hxx b/toolkit/inc/toolkit/controls/unocontrol.hxx
index 0515abe27128..6bcfa519ed3d 100644
--- a/toolkit/inc/toolkit/controls/unocontrol.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrol.hxx
@@ -39,6 +39,7 @@
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/awt/XUnitConversion.hpp>
+#include <com/sun/star/awt/XStyleSettingsSupplier.hpp>
#include <com/sun/star/accessibility/XAccessible.hpp>
#include <cppuhelper/weakagg.hxx>
#include <osl/mutex.hxx>
@@ -47,7 +48,7 @@
#include <cppuhelper/propshlp.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <cppuhelper/weakref.hxx>
-#include <cppuhelper/implbase8.hxx>
+#include <cppuhelper/implbase9.hxx>
#include <com/sun/star/util/XModeChangeBroadcaster.hpp>
#include <com/sun/star/awt/XVclWindowPeer.hpp>
@@ -74,7 +75,7 @@ struct UnoControl_Data;
// ----------------------------------------------------
// class UnoControl
// ----------------------------------------------------
-typedef ::cppu::WeakAggImplHelper8 < ::com::sun::star::awt::XControl
+typedef ::cppu::WeakAggImplHelper9 < ::com::sun::star::awt::XControl
, ::com::sun::star::awt::XWindow2
, ::com::sun::star::awt::XView
, ::com::sun::star::beans::XPropertiesChangeListener
@@ -82,6 +83,7 @@ typedef ::cppu::WeakAggImplHelper8 < ::com::sun::star::awt::XControl
, ::com::sun::star::accessibility::XAccessible
, ::com::sun::star::util::XModeChangeBroadcaster
, ::com::sun::star::awt::XUnitConversion
+ , ::com::sun::star::awt::XStyleSettingsSupplier
> UnoControl_Base;
class TOOLKIT_DLLPUBLIC UnoControl : public UnoControl_Base
@@ -228,6 +230,9 @@ public:
virtual ::com::sun::star::awt::Size SAL_CALL convertSizeToLogic( const ::com::sun::star::awt::Size& aSize, ::sal_Int16 TargetUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::awt::Size SAL_CALL convertSizeToPixel( const ::com::sun::star::awt::Size& aSize, ::sal_Int16 SourceUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+ // XStyleSettingsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XStyleSettings > SAL_CALL getStyleSettings() throw (::com::sun::star::uno::RuntimeException);
+
private:
// ::com::sun::star::beans::XPropertiesChangeListener
void SAL_CALL propertiesChange( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& evt ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/toolkit/inc/toolkit/controls/unocontrolbase.hxx b/toolkit/inc/toolkit/controls/unocontrolbase.hxx
index 60dcc040e0e7..f12dd23a5c67 100644
--- a/toolkit/inc/toolkit/controls/unocontrolbase.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrolbase.hxx
@@ -36,7 +36,7 @@
// class UnoControlBase
// ----------------------------------------------------
-class UnoControlBase : public UnoControl
+class TOOLKIT_DLLPUBLIC UnoControlBase : public UnoControl
{
protected:
sal_Bool ImplHasProperty( sal_uInt16 nProp );
diff --git a/toolkit/inc/toolkit/controls/unocontrolmodel.hxx b/toolkit/inc/toolkit/controls/unocontrolmodel.hxx
index 71decdfcb2c9..5ac3c33aa1c9 100644
--- a/toolkit/inc/toolkit/controls/unocontrolmodel.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrolmodel.hxx
@@ -54,16 +54,16 @@ class ImplPropertyTable;
// ----------------------------------------------------
class TOOLKIT_DLLPUBLIC UnoControlModel : public ::com::sun::star::awt::XControlModel,
- public ::com::sun::star::beans::XPropertyState,
- public ::com::sun::star::io::XPersistObject,
- public ::com::sun::star::lang::XComponent,
- public ::com::sun::star::lang::XServiceInfo,
- public ::com::sun::star::lang::XTypeProvider,
- public ::com::sun::star::lang::XUnoTunnel,
- public ::com::sun::star::util::XCloneable,
- public MutexAndBroadcastHelper,
- public ::cppu::OPropertySetHelper,
- public ::cppu::OWeakAggObject
+ public ::com::sun::star::beans::XPropertyState,
+ public ::com::sun::star::io::XPersistObject,
+ public ::com::sun::star::lang::XComponent,
+ public ::com::sun::star::lang::XServiceInfo,
+ public ::com::sun::star::lang::XTypeProvider,
+ public ::com::sun::star::lang::XUnoTunnel,
+ public ::com::sun::star::util::XCloneable,
+ public MutexAndBroadcastHelper,
+ public ::cppu::OPropertySetHelper,
+ public ::cppu::OWeakAggObject
{
private:
ImplPropertyTable* mpData;
diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx
index 88449418c70a..6223e47a6871 100644
--- a/toolkit/inc/toolkit/controls/unocontrols.hxx
+++ b/toolkit/inc/toolkit/controls/unocontrols.hxx
@@ -35,8 +35,6 @@
#include <com/sun/star/awt/XTextLayoutConstrains.hpp>
#include <com/sun/star/awt/XButton.hpp>
#include <com/sun/star/awt/XToggleButton.hpp>
-#include <com/sun/star/awt/XImageConsumer.hpp>
-#include <com/sun/star/awt/XImageProducer.hpp>
#include <com/sun/star/awt/XRadioButton.hpp>
#include <com/sun/star/awt/XItemListener.hpp>
#include <com/sun/star/awt/XCheckBox.hpp>
@@ -57,7 +55,6 @@
#include <toolkit/controls/unocontrolbase.hxx>
#include <toolkit/helper/macros.hxx>
#include <toolkit/helper/servicenames.hxx>
-#include <vcl/imgcons.hxx>
#include <vcl/bitmapex.hxx>
#include <cppuhelper/implbase5.hxx>
#include <cppuhelper/implbase4.hxx>
@@ -217,31 +214,20 @@ public:
};
// ----------------------------------------------------
-// class ImageProducerControlModel
+// class GraphicControlModel
// ----------------------------------------------------
-class ImageProducerControlModel : public ::com::sun::star::awt::XImageProducer,
- public UnoControlModel
+class GraphicControlModel : public UnoControlModel
{
private:
- std::list< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer > > maListeners;
bool mbAdjustingImagePosition;
bool mbAdjustingGraphic;
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > mxGrfObj;
::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL );
-protected:
- ImageProducerControlModel() : mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { }
- ImageProducerControlModel( const ImageProducerControlModel& _rSource ) : com::sun::star::awt::XImageProducer(), UnoControlModel( _rSource ), mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { }
-
- ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL acquire() throw();
- void SAL_CALL release() throw();
- // ::com::sun::star::awt::XImageProducer
- void SAL_CALL addConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException);
- void SAL_CALL removeConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException);
- void SAL_CALL startProduction( ) throw (::com::sun::star::uno::RuntimeException);
+protected:
+ GraphicControlModel() : mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { }
+ GraphicControlModel( const GraphicControlModel& _rSource ) : UnoControlModel( _rSource ), mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { }
// ::cppu::OPropertySetHelper
void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
@@ -250,35 +236,13 @@ protected:
::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
private:
- ImageProducerControlModel& operator=( const ImageProducerControlModel& ); // never implemented
-};
-
-// ----------------------------------------------------
-// class ImageConsumerControl
-// ----------------------------------------------------
-class ImageConsumerControl : public UnoControlBase
-{
-protected:
- ImageConsumerControl() { }
-
- void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal );
-
- // XControl
- sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException );
-
- void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
-
- void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
-
-private:
- ImageConsumerControl( const ImageConsumerControl& ); // never implemented
- ImageConsumerControl& operator=( const ImageConsumerControl& ); // never implemented
+ GraphicControlModel& operator=( const GraphicControlModel& ); // never implemented
};
// ----------------------------------------------------
// class UnoControlButtonModel
// ----------------------------------------------------
-class UnoControlButtonModel : public ImageProducerControlModel
+class UnoControlButtonModel : public GraphicControlModel
{
protected:
::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
@@ -286,7 +250,7 @@ protected:
public:
UnoControlButtonModel();
- UnoControlButtonModel( const UnoControlButtonModel& rModel ) : ImageProducerControlModel( rModel ) {;}
+ UnoControlButtonModel( const UnoControlButtonModel& rModel ) : GraphicControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlButtonModel( *this ); }
@@ -297,13 +261,13 @@ public:
::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::lang::XServiceInfo
- DECLIMPL_SERVICEINFO_DERIVED( UnoControlButtonModel, ImageProducerControlModel, szServiceName2_UnoControlButtonModel )
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlButtonModel, GraphicControlModel, szServiceName2_UnoControlButtonModel )
};
// ----------------------------------------------------
// class UnoButtonControl
// ----------------------------------------------------
-typedef ::cppu::AggImplInheritanceHelper4 < ImageConsumerControl
+typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase
, ::com::sun::star::awt::XButton
, ::com::sun::star::awt::XToggleButton
, ::com::sun::star::awt::XLayoutConstrains
@@ -347,13 +311,13 @@ public:
::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::lang::XServiceInfo
- DECLIMPL_SERVICEINFO_DERIVED( UnoButtonControl, ImageConsumerControl, szServiceName2_UnoControlButton )
+ DECLIMPL_SERVICEINFO_DERIVED( UnoButtonControl, UnoControlBase, szServiceName2_UnoControlButton )
};
// ----------------------------------------------------
// class UnoControlImageControlModel
// ----------------------------------------------------
-class UnoControlImageControlModel : public ImageProducerControlModel
+class UnoControlImageControlModel : public GraphicControlModel
{
private:
bool mbAdjustingImageScaleMode;
@@ -364,7 +328,7 @@ protected:
public:
UnoControlImageControlModel();
- UnoControlImageControlModel( const UnoControlImageControlModel& rModel ) : ImageProducerControlModel( rModel ), mbAdjustingImageScaleMode( false ) { }
+ UnoControlImageControlModel( const UnoControlImageControlModel& rModel ) : GraphicControlModel( rModel ), mbAdjustingImageScaleMode( false ) { }
UnoControlModel* Clone() const { return new UnoControlImageControlModel( *this ); }
@@ -375,7 +339,7 @@ public:
::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::lang::XServiceInfo
- DECLIMPL_SERVICEINFO_DERIVED( UnoControlImageControlModel, ImageProducerControlModel, szServiceName2_UnoControlImageControlModel )
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlImageControlModel, GraphicControlModel, szServiceName2_UnoControlImageControlModel )
// ::cppu::OPropertySetHelper
void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
@@ -384,7 +348,7 @@ public:
// ----------------------------------------------------
// class UnoImageControlControl
// ----------------------------------------------------
-typedef ::cppu::AggImplInheritanceHelper1 < ImageConsumerControl
+typedef ::cppu::AggImplInheritanceHelper1 < UnoControlBase
, ::com::sun::star::awt::XLayoutConstrains
> UnoImageControlControl_Base;
class UnoImageControlControl : public UnoImageControlControl_Base
@@ -409,13 +373,13 @@ public:
::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::lang::XServiceInfo
- DECLIMPL_SERVICEINFO_DERIVED( UnoImageControlControl, ImageConsumerControl, szServiceName2_UnoControlImageControl )
+ DECLIMPL_SERVICEINFO_DERIVED( UnoImageControlControl, UnoControlBase, szServiceName2_UnoControlImageControl )
};
// ----------------------------------------------------
// class UnoControlRadioButtonModel
// ----------------------------------------------------
-class UnoControlRadioButtonModel : public ImageProducerControlModel
+class UnoControlRadioButtonModel : public GraphicControlModel
{
protected:
@@ -424,7 +388,7 @@ protected:
public:
UnoControlRadioButtonModel();
- UnoControlRadioButtonModel( const UnoControlRadioButtonModel& rModel ) : ImageProducerControlModel( rModel ) {;}
+ UnoControlRadioButtonModel( const UnoControlRadioButtonModel& rModel ) : GraphicControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlRadioButtonModel( *this ); }
@@ -435,14 +399,14 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::lang::XServiceInfo
- DECLIMPL_SERVICEINFO_DERIVED( UnoControlRadioButtonModel, ImageProducerControlModel, szServiceName2_UnoControlRadioButtonModel )
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlRadioButtonModel, GraphicControlModel, szServiceName2_UnoControlRadioButtonModel )
};
// ----------------------------------------------------
// class UnoRadioButtonControl
// ----------------------------------------------------
-typedef ::cppu::AggImplInheritanceHelper4 < ImageConsumerControl
+typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase
, ::com::sun::star::awt::XButton
, ::com::sun::star::awt::XRadioButton
, ::com::sun::star::awt::XItemListener
@@ -462,7 +426,7 @@ public:
void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { ImageConsumerControl::disposing( Source ); }
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); }
// ::com::sun::star::awt::XControl
sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException);
@@ -488,14 +452,14 @@ public:
::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::lang::XServiceInfo
- DECLIMPL_SERVICEINFO_DERIVED( UnoRadioButtonControl, ImageConsumerControl, szServiceName2_UnoControlRadioButton )
+ DECLIMPL_SERVICEINFO_DERIVED( UnoRadioButtonControl, UnoControlBase, szServiceName2_UnoControlRadioButton )
};
// ----------------------------------------------------
// class UnoControlCheckBoxModel
// ----------------------------------------------------
-class UnoControlCheckBoxModel : public ImageProducerControlModel
+class UnoControlCheckBoxModel : public GraphicControlModel
{
protected:
::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const;
@@ -503,7 +467,7 @@ protected:
public:
UnoControlCheckBoxModel();
- UnoControlCheckBoxModel( const UnoControlCheckBoxModel& rModel ) : ImageProducerControlModel( rModel ) {;}
+ UnoControlCheckBoxModel( const UnoControlCheckBoxModel& rModel ) : GraphicControlModel( rModel ) {;}
UnoControlModel* Clone() const { return new UnoControlCheckBoxModel( *this ); }
@@ -514,13 +478,13 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::lang::XServiceInfo
- DECLIMPL_SERVICEINFO_DERIVED( UnoControlCheckBoxModel, ImageProducerControlModel, szServiceName2_UnoControlCheckBoxModel )
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlCheckBoxModel, GraphicControlModel, szServiceName2_UnoControlCheckBoxModel )
};
// ----------------------------------------------------
// class UnoCheckBoxControl
// ----------------------------------------------------
-typedef ::cppu::AggImplInheritanceHelper4 < ImageConsumerControl
+typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase
, ::com::sun::star::awt::XButton
, ::com::sun::star::awt::XCheckBox
, ::com::sun::star::awt::XItemListener
@@ -541,7 +505,7 @@ public:
void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException);
void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException);
- void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { ImageConsumerControl::disposing( Source ); }
+ void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); }
// ::com::sun::star::awt::XControl
sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException);
@@ -569,7 +533,7 @@ public:
::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException);
// ::com::sun::star::lang::XServiceInfo
- DECLIMPL_SERVICEINFO_DERIVED( UnoCheckBoxControl, ImageConsumerControl, szServiceName2_UnoControlCheckBox )
+ DECLIMPL_SERVICEINFO_DERIVED( UnoCheckBoxControl, UnoControlBase, szServiceName2_UnoControlCheckBox )
};
@@ -761,11 +725,12 @@ struct UnoControlListBoxModel_Data;
typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel
, ::com::sun::star::awt::XItemList
> UnoControlListBoxModel_Base;
-class UnoControlListBoxModel :public UnoControlListBoxModel_Base
+class TOOLKIT_DLLPUBLIC UnoControlListBoxModel :public UnoControlListBoxModel_Base
{
public:
UnoControlListBoxModel();
UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource );
+ ~UnoControlListBoxModel();
UnoControlModel* Clone() const { return new UnoControlListBoxModel( *this ); }
@@ -856,7 +821,7 @@ typedef ::cppu::AggImplInheritanceHelper5 < UnoControlBase
, ::com::sun::star::awt::XTextLayoutConstrains
, ::com::sun::star::awt::XItemListListener
> UnoListBoxControl_Base;
-class UnoListBoxControl : public UnoListBoxControl_Base
+class TOOLKIT_DLLPUBLIC UnoListBoxControl : public UnoListBoxControl_Base
{
public:
UnoListBoxControl();
@@ -920,6 +885,8 @@ protected:
virtual void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal );
virtual void updateFromModel();
+ ActionListenerMultiplexer& getActionListeners();
+ ItemListenerMultiplexer& getItemListeners();
private:
ActionListenerMultiplexer maActionListeners;
ItemListenerMultiplexer maItemListeners;
diff --git a/toolkit/inc/toolkit/helper/listenermultiplexer.hxx b/toolkit/inc/toolkit/helper/listenermultiplexer.hxx
index b9fb82c3d4bb..b4151fe0f35e 100644
--- a/toolkit/inc/toolkit/helper/listenermultiplexer.hxx
+++ b/toolkit/inc/toolkit/helper/listenermultiplexer.hxx
@@ -171,7 +171,7 @@ DECL_LISTENERMULTIPLEXER_END
// ----------------------------------------------------
// class ActionListenerMultiplexer
// ----------------------------------------------------
-DECL_LISTENERMULTIPLEXER_START( ActionListenerMultiplexer, ::com::sun::star::awt::XActionListener )
+DECL_LISTENERMULTIPLEXER_START_DLLPUB( ActionListenerMultiplexer, ::com::sun::star::awt::XActionListener )
void SAL_CALL actionPerformed( const ::com::sun::star::awt::ActionEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException);
DECL_LISTENERMULTIPLEXER_END
diff --git a/toolkit/inc/toolkit/helper/property.hxx b/toolkit/inc/toolkit/helper/property.hxx
index f8a1a703799c..837d283f4e8c 100644
--- a/toolkit/inc/toolkit/helper/property.hxx
+++ b/toolkit/inc/toolkit/helper/property.hxx
@@ -234,7 +234,7 @@ namespace rtl {
TOOLKIT_DLLPUBLIC sal_uInt16 GetPropertyId( const ::rtl::OUString& rPropertyName );
const ::com::sun::star::uno::Type* GetPropertyType( sal_uInt16 nPropertyId );
-const ::rtl::OUString& GetPropertyName( sal_uInt16 nPropertyId );
+TOOLKIT_DLLPUBLIC const ::rtl::OUString& GetPropertyName( sal_uInt16 nPropertyId );
sal_Int16 GetPropertyAttribs( sal_uInt16 nPropertyId );
sal_uInt16 GetPropertyOrderNr( sal_uInt16 nPropertyId );
sal_Bool DoesDependOnOthers( sal_uInt16 nPropertyId );
diff --git a/toolkit/inc/toolkit/helper/servicenames.hxx b/toolkit/inc/toolkit/helper/servicenames.hxx
index 96d9d5810cc0..2d1df79b733b 100644
--- a/toolkit/inc/toolkit/helper/servicenames.hxx
+++ b/toolkit/inc/toolkit/helper/servicenames.hxx
@@ -104,10 +104,5 @@ extern const sal_Char __FAR_DATA szServiceName_UnoThrobberControl[], szServiceNa
extern const sal_Char __FAR_DATA szServiceName_UnoThrobberControlModel[], szServiceName2_UnoThrobberControlModel[];
extern const sal_Char __FAR_DATA szServiceName_UnoControlFixedHyperlink[], szServiceName_UnoControlFixedHyperlinkModel[];
-// ExtUnoWrapper:
-extern const char __FAR_DATA szServiceName_ImageProducer[], szServiceName2_ImageProducer[];
-
-
-
#endif // _TOOLKIT_HELPER_SERVICENAMES_HXX_
diff --git a/toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx b/toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx
index 5b5cb3021fc9..99d1763db1e6 100644
--- a/toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx
+++ b/toolkit/inc/toolkit/helper/unopropertyarrayhelper.hxx
@@ -34,6 +34,7 @@
#include <tools/table.hxx>
#include <list>
+#include "toolkit/dllapi.h"
// ----------------------------------------------------
// class UnoPropertyArrayHelper
diff --git a/toolkit/source/awt/makefile.mk b/toolkit/source/awt/makefile.mk
index a53e9e22ba2d..88b40a597410 100644
--- a/toolkit/source/awt/makefile.mk
+++ b/toolkit/source/awt/makefile.mk
@@ -44,6 +44,7 @@ CFLAGSCXX+=$(OBJCXXFLAGS)
.ENDIF # "$(GUIBASE)"=="aqua"
SLOFILES= \
+ $(SLO)$/stylesettings.obj \
$(SLO)$/vclxaccessiblecomponent.obj \
$(SLO)$/vclxbitmap.obj \
$(SLO)$/vclxcontainer.obj \
diff --git a/toolkit/source/awt/stylesettings.cxx b/toolkit/source/awt/stylesettings.cxx
new file mode 100644
index 000000000000..fc3ec241101c
--- /dev/null
+++ b/toolkit/source/awt/stylesettings.cxx
@@ -0,0 +1,987 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_toolkit.hxx"
+
+#include "stylesettings.hxx"
+#include <toolkit/awt/vclxwindow.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
+
+/** === begin UNO includes === **/
+#include <com/sun/star/lang/DisposedException.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/interfacecontainer.hxx>
+#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
+#include <vcl/window.hxx>
+#include <vcl/settings.hxx>
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ /** === begin UNO using === **/
+ using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XInterface;
+ using ::com::sun::star::uno::UNO_QUERY;
+ using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
+ using ::com::sun::star::uno::Exception;
+ using ::com::sun::star::uno::RuntimeException;
+ using ::com::sun::star::uno::Any;
+ using ::com::sun::star::uno::makeAny;
+ using ::com::sun::star::uno::Sequence;
+ using ::com::sun::star::uno::Type;
+ using ::com::sun::star::lang::DisposedException;
+ using ::com::sun::star::lang::EventObject;
+ using ::com::sun::star::awt::FontDescriptor;
+ using ::com::sun::star::awt::XStyleChangeListener;
+ using ::com::sun::star::awt::FontDescriptor;
+ /** === end UNO using === **/
+
+ //==================================================================================================================
+ //= WindowStyleSettings_Data
+ //==================================================================================================================
+ struct WindowStyleSettings_Data
+ {
+ ::vos::IMutex& rMutex;
+ VCLXWindow* pOwningWindow;
+ ::cppu::OInterfaceContainerHelper aStyleChangeListeners;
+
+ WindowStyleSettings_Data( ::vos::IMutex& i_rWindowMutex, ::osl::Mutex& i_rListenerMutex, VCLXWindow& i_rOwningWindow )
+ :rMutex( i_rWindowMutex )
+ ,pOwningWindow( &i_rOwningWindow )
+ ,aStyleChangeListeners( i_rListenerMutex )
+ {
+ }
+
+ DECL_LINK( OnWindowEvent, const VclWindowEvent* );
+ };
+
+ //------------------------------------------------------------------------------------------------------------------
+ IMPL_LINK( WindowStyleSettings_Data, OnWindowEvent, const VclWindowEvent*, i_pEvent )
+ {
+ if ( !i_pEvent || ( i_pEvent->GetId() != VCLEVENT_WINDOW_DATACHANGED ) )
+ return 0L;
+ const DataChangedEvent* pDataChangedEvent = static_cast< const DataChangedEvent* >( i_pEvent->GetData() );
+ if ( !pDataChangedEvent || ( pDataChangedEvent->GetType() != DATACHANGED_SETTINGS ) )
+ return 0L;
+ if ( ( pDataChangedEvent->GetFlags() & SETTINGS_STYLE ) == 0 )
+ return 0L;
+
+ EventObject aEvent( *pOwningWindow );
+ aStyleChangeListeners.notifyEach( &XStyleChangeListener::styleSettingsChanged, aEvent );
+ return 1L;
+ }
+
+ //==================================================================================================================
+ //= StyleMethodGuard
+ //==================================================================================================================
+ class StyleMethodGuard
+ {
+ public:
+ StyleMethodGuard( WindowStyleSettings_Data& i_rData )
+ :m_aGuard( i_rData.rMutex )
+ {
+ if ( i_rData.pOwningWindow == NULL )
+ throw DisposedException();
+ }
+
+ ~StyleMethodGuard()
+ {
+ }
+
+ private:
+ ::vos::OGuard m_aGuard;
+ };
+
+ //==================================================================================================================
+ //= WindowStyleSettings
+ //==================================================================================================================
+ //------------------------------------------------------------------------------------------------------------------
+ WindowStyleSettings::WindowStyleSettings( ::vos::IMutex& i_rWindowMutex, ::osl::Mutex& i_rListenerMutex, VCLXWindow& i_rOwningWindow )
+ :m_pData( new WindowStyleSettings_Data( i_rWindowMutex, i_rListenerMutex, i_rOwningWindow ) )
+ {
+ Window* pWindow = i_rOwningWindow.GetWindow();
+ if ( !pWindow )
+ throw new RuntimeException();
+ pWindow->AddEventListener( LINK( m_pData.get(), WindowStyleSettings_Data, OnWindowEvent ) );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ WindowStyleSettings::~WindowStyleSettings()
+ {
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void WindowStyleSettings::dispose()
+ {
+ StyleMethodGuard aGuard( *m_pData );
+
+ Window* pWindow = m_pData->pOwningWindow->GetWindow();
+ OSL_ENSURE( pWindow, "WindowStyleSettings::dispose: window has been reset before we could revoke the listener!" );
+ if ( pWindow )
+ pWindow->RemoveEventListener( LINK( m_pData.get(), WindowStyleSettings_Data, OnWindowEvent ) );
+
+ EventObject aEvent( *this );
+ m_pData->aStyleChangeListeners.disposeAndClear( aEvent );
+
+ m_pData->pOwningWindow = NULL;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ namespace
+ {
+ sal_Int32 lcl_getStyleColor( WindowStyleSettings_Data& i_rData, Color const & (StyleSettings::*i_pGetter)() const )
+ {
+ const Window* pWindow = i_rData.pOwningWindow->GetWindow();
+ const AllSettings aAllSettings = pWindow->GetSettings();
+ const StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
+ return (aStyleSettings.*i_pGetter)().GetColor();
+ }
+
+ void lcl_setStyleColor( WindowStyleSettings_Data& i_rData, void (StyleSettings::*i_pSetter)( Color const & ), const sal_Int32 i_nColor )
+ {
+ Window* pWindow = i_rData.pOwningWindow->GetWindow();
+ AllSettings aAllSettings = pWindow->GetSettings();
+ StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
+ (aStyleSettings.*i_pSetter)( Color( i_nColor ) );
+ aAllSettings.SetStyleSettings( aStyleSettings );
+ pWindow->SetSettings( aAllSettings );
+ }
+
+ FontDescriptor lcl_getStyleFont( WindowStyleSettings_Data& i_rData, Font const & (StyleSettings::*i_pGetter)() const )
+ {
+ const Window* pWindow = i_rData.pOwningWindow->GetWindow();
+ const AllSettings aAllSettings = pWindow->GetSettings();
+ const StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
+ return VCLUnoHelper::CreateFontDescriptor( (aStyleSettings.*i_pGetter)() );
+ }
+
+ void lcl_setStyleFont( WindowStyleSettings_Data& i_rData, void (StyleSettings::*i_pSetter)( Font const &),
+ Font const & (StyleSettings::*i_pGetter)() const, const FontDescriptor& i_rFont )
+ {
+ Window* pWindow = i_rData.pOwningWindow->GetWindow();
+ AllSettings aAllSettings = pWindow->GetSettings();
+ StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
+ const Font aNewFont = VCLUnoHelper::CreateFont( i_rFont, (aStyleSettings.*i_pGetter)() );
+ (aStyleSettings.*i_pSetter)( aNewFont );
+ aAllSettings.SetStyleSettings( aStyleSettings );
+ pWindow->SetSettings( aAllSettings );
+ }
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getActiveBorderColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetActiveBorderColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setActiveBorderColor( ::sal_Int32 _activebordercolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetActiveBorderColor, _activebordercolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getActiveColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetActiveColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setActiveColor( ::sal_Int32 _activecolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetActiveColor, _activecolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getActiveTabColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetActiveTabColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setActiveTabColor( ::sal_Int32 _activetabcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetActiveTabColor, _activetabcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getActiveTextColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetActiveTextColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setActiveTextColor( ::sal_Int32 _activetextcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetActiveTextColor, _activetextcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getButtonRolloverTextColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetButtonRolloverTextColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setButtonRolloverTextColor( ::sal_Int32 _buttonrollovertextcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetButtonRolloverTextColor, _buttonrollovertextcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getButtonTextColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetButtonTextColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setButtonTextColor( ::sal_Int32 _buttontextcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetButtonTextColor, _buttontextcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getCheckedColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetCheckedColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setCheckedColor( ::sal_Int32 _checkedcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetCheckedColor, _checkedcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getDarkShadowColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetDarkShadowColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setDarkShadowColor( ::sal_Int32 _darkshadowcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetDarkShadowColor, _darkshadowcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getDeactiveBorderColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetDeactiveBorderColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setDeactiveBorderColor( ::sal_Int32 _deactivebordercolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetDeactiveBorderColor, _deactivebordercolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getDeactiveColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetDeactiveColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setDeactiveColor( ::sal_Int32 _deactivecolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetDeactiveColor, _deactivecolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getDeactiveTextColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetDeactiveTextColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setDeactiveTextColor( ::sal_Int32 _deactivetextcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetDeactiveTextColor, _deactivetextcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getDialogColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetDialogColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setDialogColor( ::sal_Int32 _dialogcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetDialogColor, _dialogcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getDialogTextColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetDialogTextColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setDialogTextColor( ::sal_Int32 _dialogtextcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetDialogTextColor, _dialogtextcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getDisableColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetDisableColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setDisableColor( ::sal_Int32 _disablecolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetDisableColor, _disablecolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getFaceColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetFaceColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setFaceColor( ::sal_Int32 _facecolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetFaceColor, _facecolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getFaceGradientColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ const Window* pWindow = m_pData->pOwningWindow->GetWindow();
+ const AllSettings aAllSettings = pWindow->GetSettings();
+ const StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
+ return aStyleSettings.GetFaceGradientColor().GetColor();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getFieldColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetFieldColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setFieldColor( ::sal_Int32 _fieldcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetFieldColor, _fieldcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getFieldRolloverTextColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetFieldRolloverTextColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setFieldRolloverTextColor( ::sal_Int32 _fieldrollovertextcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetFieldRolloverTextColor, _fieldrollovertextcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getFieldTextColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetFieldTextColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setFieldTextColor( ::sal_Int32 _fieldtextcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetFieldTextColor, _fieldtextcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getGroupTextColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetGroupTextColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setGroupTextColor( ::sal_Int32 _grouptextcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetGroupTextColor, _grouptextcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getHelpColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetHelpColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setHelpColor( ::sal_Int32 _helpcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetHelpColor, _helpcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getHelpTextColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetHelpTextColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setHelpTextColor( ::sal_Int32 _helptextcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetHelpTextColor, _helptextcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getHighlightColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetHighlightColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setHighlightColor( ::sal_Int32 _highlightcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetHighlightColor, _highlightcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getHighlightTextColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetHighlightTextColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setHighlightTextColor( ::sal_Int32 _highlighttextcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetHighlightTextColor, _highlighttextcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getInactiveTabColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetInactiveTabColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setInactiveTabColor( ::sal_Int32 _inactivetabcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetInactiveTabColor, _inactivetabcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getInfoTextColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetInfoTextColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setInfoTextColor( ::sal_Int32 _infotextcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetInfoTextColor, _infotextcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getLabelTextColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetLabelTextColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setLabelTextColor( ::sal_Int32 _labeltextcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetLabelTextColor, _labeltextcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getLightColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetLightColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setLightColor( ::sal_Int32 _lightcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetLightColor, _lightcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getMenuBarColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetMenuBarColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setMenuBarColor( ::sal_Int32 _menubarcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetMenuBarColor, _menubarcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getMenuBarTextColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetMenuBarTextColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setMenuBarTextColor( ::sal_Int32 _menubartextcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetMenuBarTextColor, _menubartextcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getMenuBorderColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetMenuBorderColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setMenuBorderColor( ::sal_Int32 _menubordercolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetMenuBorderColor, _menubordercolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getMenuColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetMenuColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setMenuColor( ::sal_Int32 _menucolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetMenuColor, _menucolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getMenuHighlightColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetMenuHighlightColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setMenuHighlightColor( ::sal_Int32 _menuhighlightcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetMenuHighlightColor, _menuhighlightcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getMenuHighlightTextColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetMenuHighlightTextColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setMenuHighlightTextColor( ::sal_Int32 _menuhighlighttextcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetMenuHighlightTextColor, _menuhighlighttextcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getMenuTextColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetMenuTextColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setMenuTextColor( ::sal_Int32 _menutextcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetMenuTextColor, _menutextcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getMonoColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetMonoColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setMonoColor( ::sal_Int32 _monocolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetMonoColor, _monocolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getRadioCheckTextColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetRadioCheckTextColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setRadioCheckTextColor( ::sal_Int32 _radiochecktextcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetRadioCheckTextColor, _radiochecktextcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getSeparatorColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ const Window* pWindow = m_pData->pOwningWindow->GetWindow();
+ const AllSettings aAllSettings = pWindow->GetSettings();
+ const StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
+ return aStyleSettings.GetSeparatorColor().GetColor();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getShadowColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetShadowColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setShadowColor( ::sal_Int32 _shadowcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetShadowColor, _shadowcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getWindowColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetWindowColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setWindowColor( ::sal_Int32 _windowcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetWindowColor, _windowcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getWindowTextColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetWindowTextColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setWindowTextColor( ::sal_Int32 _windowtextcolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetWindowTextColor, _windowtextcolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Int32 SAL_CALL WindowStyleSettings::getWorkspaceColor() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleColor( *m_pData, &StyleSettings::GetWorkspaceColor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setWorkspaceColor( ::sal_Int32 _workspacecolor ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleColor( *m_pData, &StyleSettings::SetWorkspaceColor, _workspacecolor );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ ::sal_Bool SAL_CALL WindowStyleSettings::getHighContrastMode() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ const Window* pWindow = m_pData->pOwningWindow->GetWindow();
+ const AllSettings aAllSettings = pWindow->GetSettings();
+ const StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
+ return aStyleSettings.GetHighContrastMode();
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setHighContrastMode( ::sal_Bool _highcontrastmode ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ Window* pWindow = m_pData->pOwningWindow->GetWindow();
+ AllSettings aAllSettings = pWindow->GetSettings();
+ StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
+ aStyleSettings.SetHighContrastMode( _highcontrastmode );
+ aAllSettings.SetStyleSettings( aStyleSettings );
+ pWindow->SetSettings( aAllSettings );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FontDescriptor SAL_CALL WindowStyleSettings::getApplicationFont() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleFont( *m_pData, &StyleSettings::GetAppFont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setApplicationFont( const FontDescriptor& _applicationfont ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleFont( *m_pData, &StyleSettings::SetAppFont, &StyleSettings::GetAppFont, _applicationfont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FontDescriptor SAL_CALL WindowStyleSettings::getHelpFont() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleFont( *m_pData, &StyleSettings::GetHelpFont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setHelpFont( const FontDescriptor& _helpfont ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleFont( *m_pData, &StyleSettings::SetHelpFont, &StyleSettings::GetHelpFont, _helpfont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FontDescriptor SAL_CALL WindowStyleSettings::getTitleFont() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleFont( *m_pData, &StyleSettings::GetTitleFont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setTitleFont( const FontDescriptor& _titlefont ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleFont( *m_pData, &StyleSettings::SetTitleFont, &StyleSettings::GetTitleFont, _titlefont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FontDescriptor SAL_CALL WindowStyleSettings::getFloatTitleFont() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleFont( *m_pData, &StyleSettings::GetFloatTitleFont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setFloatTitleFont( const FontDescriptor& _floattitlefont ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleFont( *m_pData, &StyleSettings::SetFloatTitleFont, &StyleSettings::GetFloatTitleFont, _floattitlefont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FontDescriptor SAL_CALL WindowStyleSettings::getMenuFont() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleFont( *m_pData, &StyleSettings::GetMenuFont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setMenuFont( const FontDescriptor& _menufont ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleFont( *m_pData, &StyleSettings::SetMenuFont, &StyleSettings::GetMenuFont, _menufont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FontDescriptor SAL_CALL WindowStyleSettings::getToolFont() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleFont( *m_pData, &StyleSettings::GetToolFont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setToolFont( const FontDescriptor& _toolfont ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleFont( *m_pData, &StyleSettings::SetToolFont, &StyleSettings::GetToolFont, _toolfont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FontDescriptor SAL_CALL WindowStyleSettings::getGroupFont() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleFont( *m_pData, &StyleSettings::GetGroupFont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setGroupFont( const FontDescriptor& _groupfont ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleFont( *m_pData, &StyleSettings::SetGroupFont, &StyleSettings::GetGroupFont, _groupfont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FontDescriptor SAL_CALL WindowStyleSettings::getLabelFont() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleFont( *m_pData, &StyleSettings::GetLabelFont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setLabelFont( const FontDescriptor& _labelfont ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleFont( *m_pData, &StyleSettings::SetLabelFont, &StyleSettings::GetLabelFont, _labelfont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FontDescriptor SAL_CALL WindowStyleSettings::getInfoFont() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleFont( *m_pData, &StyleSettings::GetInfoFont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setInfoFont( const FontDescriptor& _infofont ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleFont( *m_pData, &StyleSettings::SetInfoFont, &StyleSettings::GetInfoFont, _infofont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FontDescriptor SAL_CALL WindowStyleSettings::getRadioCheckFont() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleFont( *m_pData, &StyleSettings::GetRadioCheckFont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setRadioCheckFont( const FontDescriptor& _radiocheckfont ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleFont( *m_pData, &StyleSettings::SetRadioCheckFont, &StyleSettings::GetRadioCheckFont, _radiocheckfont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FontDescriptor SAL_CALL WindowStyleSettings::getPushButtonFont() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleFont( *m_pData, &StyleSettings::GetPushButtonFont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setPushButtonFont( const FontDescriptor& _pushbuttonfont ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleFont( *m_pData, &StyleSettings::SetPushButtonFont, &StyleSettings::GetPushButtonFont, _pushbuttonfont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ FontDescriptor SAL_CALL WindowStyleSettings::getFieldFont() throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ return lcl_getStyleFont( *m_pData, &StyleSettings::GetFieldFont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::setFieldFont( const FontDescriptor& _fieldfont ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ lcl_setStyleFont( *m_pData, &StyleSettings::SetFieldFont, &StyleSettings::GetFieldFont, _fieldfont );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::addStyleChangeListener( const Reference< XStyleChangeListener >& i_rListener ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ if ( i_rListener.is() )
+ m_pData->aStyleChangeListeners.addInterface( i_rListener );
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
+ void SAL_CALL WindowStyleSettings::removeStyleChangeListener( const Reference< XStyleChangeListener >& i_rListener ) throw (RuntimeException)
+ {
+ StyleMethodGuard aGuard( *m_pData );
+ if ( i_rListener.is() )
+ m_pData->aStyleChangeListeners.removeInterface( i_rListener );
+ }
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
diff --git a/toolkit/source/awt/stylesettings.hxx b/toolkit/source/awt/stylesettings.hxx
new file mode 100644
index 000000000000..466e50bad1f1
--- /dev/null
+++ b/toolkit/source/awt/stylesettings.hxx
@@ -0,0 +1,188 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef TOOLKIT_STYLESETTINGS_HXX
+#define TOOLKIT_STYLESETTINGS_HXX
+
+/** === begin UNO includes === **/
+#include <com/sun/star/awt/XStyleSettings.hpp>
+/** === end UNO includes === **/
+
+#include <cppuhelper/implbase1.hxx>
+
+#include <boost/scoped_ptr.hpp>
+
+namespace vos
+{
+ class IMutex;
+}
+namespace osl
+{
+ class Mutex;
+}
+
+class VCLXWindow;
+
+//......................................................................................................................
+namespace toolkit
+{
+//......................................................................................................................
+
+ //==================================================================================================================
+ //= WindowStyleSettings
+ //==================================================================================================================
+ struct WindowStyleSettings_Data;
+ typedef ::cppu::WeakImplHelper1 < ::com::sun::star::awt::XStyleSettings
+ > WindowStyleSettings_Base;
+ class WindowStyleSettings : public WindowStyleSettings_Base
+ {
+ public:
+ WindowStyleSettings( ::vos::IMutex& i_rWindowMutex, ::osl::Mutex& i_rListenerMutex, VCLXWindow& i_rOwningWindow );
+ ~WindowStyleSettings();
+
+ void dispose();
+
+ // XStyleSettings
+ virtual ::sal_Int32 SAL_CALL getActiveBorderColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setActiveBorderColor( ::sal_Int32 _activebordercolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getActiveColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setActiveColor( ::sal_Int32 _activecolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getActiveTabColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setActiveTabColor( ::sal_Int32 _activetabcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getActiveTextColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setActiveTextColor( ::sal_Int32 _activetextcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getButtonRolloverTextColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setButtonRolloverTextColor( ::sal_Int32 _buttonrollovertextcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getButtonTextColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setButtonTextColor( ::sal_Int32 _buttontextcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getCheckedColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setCheckedColor( ::sal_Int32 _checkedcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getDarkShadowColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDarkShadowColor( ::sal_Int32 _darkshadowcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getDeactiveBorderColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDeactiveBorderColor( ::sal_Int32 _deactivebordercolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getDeactiveColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDeactiveColor( ::sal_Int32 _deactivecolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getDeactiveTextColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDeactiveTextColor( ::sal_Int32 _deactivetextcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getDialogColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDialogColor( ::sal_Int32 _dialogcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getDialogTextColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDialogTextColor( ::sal_Int32 _dialogtextcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getDisableColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDisableColor( ::sal_Int32 _disablecolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getFaceColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFaceColor( ::sal_Int32 _facecolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getFaceGradientColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getFieldColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFieldColor( ::sal_Int32 _fieldcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getFieldRolloverTextColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFieldRolloverTextColor( ::sal_Int32 _fieldrollovertextcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getFieldTextColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFieldTextColor( ::sal_Int32 _fieldtextcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getGroupTextColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setGroupTextColor( ::sal_Int32 _grouptextcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getHelpColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHelpColor( ::sal_Int32 _helpcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getHelpTextColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHelpTextColor( ::sal_Int32 _helptextcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getHighlightColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHighlightColor( ::sal_Int32 _highlightcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getHighlightTextColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHighlightTextColor( ::sal_Int32 _highlighttextcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getInactiveTabColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setInactiveTabColor( ::sal_Int32 _inactivetabcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getInfoTextColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setInfoTextColor( ::sal_Int32 _infotextcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getLabelTextColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setLabelTextColor( ::sal_Int32 _labeltextcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getLightColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setLightColor( ::sal_Int32 _lightcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getMenuBarColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMenuBarColor( ::sal_Int32 _menubarcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getMenuBarTextColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMenuBarTextColor( ::sal_Int32 _menubartextcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getMenuBorderColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMenuBorderColor( ::sal_Int32 _menubordercolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getMenuColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMenuColor( ::sal_Int32 _menucolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getMenuHighlightColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMenuHighlightColor( ::sal_Int32 _menuhighlightcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getMenuHighlightTextColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMenuHighlightTextColor( ::sal_Int32 _menuhighlighttextcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getMenuTextColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMenuTextColor( ::sal_Int32 _menutextcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getMonoColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMonoColor( ::sal_Int32 _monocolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getRadioCheckTextColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setRadioCheckTextColor( ::sal_Int32 _radiochecktextcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getSeparatorColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getShadowColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setShadowColor( ::sal_Int32 _shadowcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getWindowColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setWindowColor( ::sal_Int32 _windowcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getWindowTextColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setWindowTextColor( ::sal_Int32 _windowtextcolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int32 SAL_CALL getWorkspaceColor() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setWorkspaceColor( ::sal_Int32 _workspacecolor ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL getHighContrastMode() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHighContrastMode( ::sal_Bool _highcontrastmode ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getApplicationFont() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setApplicationFont( const ::com::sun::star::awt::FontDescriptor& _applicationfont ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getHelpFont() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setHelpFont( const ::com::sun::star::awt::FontDescriptor& _helpfont ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getTitleFont() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setTitleFont( const ::com::sun::star::awt::FontDescriptor& _titlefont ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getFloatTitleFont() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFloatTitleFont( const ::com::sun::star::awt::FontDescriptor& _floattitlefont ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getMenuFont() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setMenuFont( const ::com::sun::star::awt::FontDescriptor& _menufont ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getToolFont() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setToolFont( const ::com::sun::star::awt::FontDescriptor& _toolfont ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getGroupFont() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setGroupFont( const ::com::sun::star::awt::FontDescriptor& _groupfont ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getLabelFont() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setLabelFont( const ::com::sun::star::awt::FontDescriptor& _labelfont ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getInfoFont() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setInfoFont( const ::com::sun::star::awt::FontDescriptor& _infofont ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getRadioCheckFont() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setRadioCheckFont( const ::com::sun::star::awt::FontDescriptor& _radiocheckfont ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getPushButtonFont() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPushButtonFont( const ::com::sun::star::awt::FontDescriptor& _pushbuttonfont ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::awt::FontDescriptor SAL_CALL getFieldFont() throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setFieldFont( const ::com::sun::star::awt::FontDescriptor& _fieldfont ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addStyleChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XStyleChangeListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeStyleChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XStyleChangeListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
+
+ private:
+ ::boost::scoped_ptr< WindowStyleSettings_Data > m_pData;
+ };
+
+//......................................................................................................................
+} // namespace toolkit
+//......................................................................................................................
+
+#endif // TOOLKIT_STYLESETTINGS_HXX
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx
index dd4d56586b03..efc2c40c6baa 100644
--- a/toolkit/source/awt/vclxwindow.cxx
+++ b/toolkit/source/awt/vclxwindow.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_toolkit.hxx"
+
#include <com/sun/star/awt/WindowEvent.hpp>
#include <com/sun/star/awt/KeyEvent.hpp>
#include <com/sun/star/awt/KeyModifier.hpp>
@@ -41,6 +42,7 @@
#include <com/sun/star/awt/EndPopupModeEvent.hpp>
#include <com/sun/star/awt/XWindowListener2.hpp>
#include <com/sun/star/style/VerticalAlignment.hpp>
+#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/awt/vclxpointer.hxx>
@@ -64,6 +66,7 @@
#include <vcl/button.hxx>
#include <comphelper/asyncnotification.hxx>
#include <toolkit/helper/solarrelease.hxx>
+#include "stylesettings.hxx"
#include <toolkit/helper/unopropertyarrayhelper.hxx>
@@ -73,10 +76,13 @@ using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::lang::EventObject;
using ::com::sun::star::awt::XWindowListener2;
using ::com::sun::star::awt::XDockableWindowListener;
using ::com::sun::star::awt::XDevice;
+using ::com::sun::star::awt::XStyleSettings;
+using ::com::sun::star::lang::DisposedException;
using ::com::sun::star::style::VerticalAlignment;
using ::com::sun::star::style::VerticalAlignment_TOP;
using ::com::sun::star::style::VerticalAlignment_MIDDLE;
@@ -164,6 +170,8 @@ public:
mxAccessibleContext;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >
mxViewGraphics;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XStyleSettings >
+ mxWindowStyleSettings;
public:
bool& getDrawingOntoParent_ref() { return mbDrawingOntoParent; }
@@ -198,6 +206,8 @@ public:
return maAccFactory;
}
+ Reference< XStyleSettings > getStyleSettings();
+
/** returns the container of registered XWindowListener2 listeners
*/
inline ::cppu::OInterfaceContainerHelper& getWindow2Listeners() { return maWindow2Listeners; }
@@ -222,17 +232,6 @@ private:
DECL_LINK( OnProcessCallbacks, void* );
private:
-private:
- /** determines whether the instance is already disposed
- @precond
- m_aMutex must be acquired
- */
- inline bool impl_isDisposed()
- {
- return mbDisposed;
- }
-
-private:
VCLXWindowImpl(); // never implemented
VCLXWindowImpl( const VCLXWindowImpl& ); // never implemented
VCLXWindowImpl& operator=( const VCLXWindowImpl& ); // never implemented
@@ -298,6 +297,10 @@ void VCLXWindowImpl::disposing()
maContainerListeners.disposeAndClear( aEvent );
maTopWindowListeners.disposeAndClear( aEvent );
+ ::toolkit::WindowStyleSettings* pStyleSettings = static_cast< ::toolkit::WindowStyleSettings* >( mxWindowStyleSettings.get() );
+ if ( pStyleSettings != NULL )
+ pStyleSettings->dispose();
+ mxWindowStyleSettings.clear();
}
//--------------------------------------------------------------------
@@ -361,6 +364,17 @@ void SAL_CALL VCLXWindowImpl::release()
mrAntiImpl.release();
}
+//--------------------------------------------------------------------
+Reference< XStyleSettings > VCLXWindowImpl::getStyleSettings()
+{
+ ::vos::OGuard aGuard( mrMutex );
+ if ( mbDisposed )
+ throw DisposedException( ::rtl::OUString(), mrAntiImpl );
+ if ( !mxWindowStyleSettings.is() )
+ mxWindowStyleSettings = new ::toolkit::WindowStyleSettings( mrMutex, maListenerContainerMutex, mrAntiImpl );
+ return mxWindowStyleSettings;
+}
+
//====================================================================
//====================================================================
@@ -2651,3 +2665,8 @@ VCLXWindow::hasPropertyByName( const ::rtl::OUString& rName ) throw (::com::sun:
{
return GetPropHelper()->hasPropertyByName( rName );
}
+
+Reference< XStyleSettings > SAL_CALL VCLXWindow::getStyleSettings() throw (RuntimeException)
+{
+ return mpImpl->getStyleSettings();
+}
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 26e84905ee01..4a68b4c80e3f 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -42,6 +42,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/system/XSystemShellExecute.hpp>
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
+#include <com/sun/star/resource/XStringResourceResolver.hpp>
#include <com/sun/star/awt/ImageScaleMode.hpp>
#include <com/sun/star/awt/XItemList.hpp>
#include <comphelper/componentcontext.hxx>
@@ -206,33 +207,22 @@ namespace toolkit
}
// ----------------------------------------------------
-// class VCLXImageConsumer
+// class VCLXGraphicControl
// ----------------------------------------------------
-void VCLXImageConsumer::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
+void VCLXGraphicControl::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
{
VCLXWindow::ImplGetPropertyIds( rIds );
}
-void VCLXImageConsumer::ImplSetNewImage()
+void VCLXGraphicControl::ImplSetNewImage()
{
- OSL_PRECOND( GetWindow(), "VCLXImageConsumer::ImplSetNewImage: window is required to be not-NULL!" );
+ OSL_PRECOND( GetWindow(), "VCLXGraphicControl::ImplSetNewImage: window is required to be not-NULL!" );
Button* pButton = static_cast< Button* >( GetWindow() );
pButton->SetModeBitmap( GetBitmap() );
}
-void VCLXImageConsumer::ImplUpdateImage( sal_Bool bGetNewImage )
-{
- if ( !GetWindow() )
- return;
-
- if ( bGetNewImage && !maImageConsumer.GetData( maImage ) )
- return;
-
- ImplSetNewImage();
-}
-
-void VCLXImageConsumer::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, short Flags ) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphicControl::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, short Flags ) throw(::com::sun::star::uno::RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
@@ -241,49 +231,11 @@ void VCLXImageConsumer::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, s
Size aOldSize = GetWindow()->GetSizePixel();
VCLXWindow::setPosSize( X, Y, Width, Height, Flags );
if ( ( aOldSize.Width() != Width ) || ( aOldSize.Height() != Height ) )
- ImplUpdateImage( sal_False );
+ ImplSetNewImage();
}
}
-void VCLXImageConsumer::init( sal_Int32 Width, sal_Int32 Height ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::vos::OGuard aGuard( GetMutex() );
-
- maImageConsumer.Init( Width, Height );
-}
-
-void VCLXImageConsumer::setColorModel( sal_Int16 BitCount, const ::com::sun::star::uno::Sequence< sal_Int32 >& RGBAPal, sal_Int32 RedMask, sal_Int32 GreenMask, sal_Int32 BlueMask, sal_Int32 AlphaMask ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::vos::OGuard aGuard( GetMutex() );
-
- maImageConsumer.SetColorModel( BitCount, RGBAPal.getLength(), (const sal_uInt32*) RGBAPal.getConstArray(), RedMask, GreenMask, BlueMask, AlphaMask );
-}
-
-void VCLXImageConsumer::setPixelsByBytes( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, const ::com::sun::star::uno::Sequence< sal_Int8 >& ProducerData, sal_Int32 Offset, sal_Int32 Scansize ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::vos::OGuard aGuard( GetMutex() );
-
- maImageConsumer.SetPixelsByBytes( X, Y, Width, Height, (sal_uInt8*)ProducerData.getConstArray(), Offset, Scansize );
- ImplUpdateImage( sal_True );
-}
-
-void VCLXImageConsumer::setPixelsByLongs( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, const ::com::sun::star::uno::Sequence< sal_Int32 >& ProducerData, sal_Int32 Offset, sal_Int32 Scansize ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::vos::OGuard aGuard( GetMutex() );
-
- maImageConsumer.SetPixelsByLongs( X, Y, Width, Height, (const sal_uInt32*) ProducerData.getConstArray(), Offset, Scansize );
- ImplUpdateImage( sal_True );
-}
-
-void VCLXImageConsumer::complete( sal_Int32 Status, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageProducer > & ) throw(::com::sun::star::uno::RuntimeException)
-{
- ::vos::OGuard aGuard( GetMutex() );
-
- maImageConsumer.Completed( Status );
- ImplUpdateImage( sal_True );
-}
-
-void VCLXImageConsumer::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value) throw(::com::sun::star::uno::RuntimeException)
+void VCLXGraphicControl::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value) throw(::com::sun::star::uno::RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
@@ -336,7 +288,7 @@ void VCLXImageConsumer::setProperty( const ::rtl::OUString& PropertyName, const
}
}
-::com::sun::star::uno::Any VCLXImageConsumer::getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException)
+::com::sun::star::uno::Any VCLXGraphicControl::getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
@@ -418,7 +370,7 @@ void VCLXButton::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_CONTEXT_WRITING_MODE,
BASEPROPERTY_REFERENCE_DEVICE,
0);
- VCLXImageConsumer::ImplGetPropertyIds( rIds );
+ VCLXGraphicControl::ImplGetPropertyIds( rIds );
}
VCLXButton::VCLXButton()
@@ -444,7 +396,7 @@ void VCLXButton::dispose() throw(::com::sun::star::uno::RuntimeException)
aObj.Source = (::cppu::OWeakObject*)this;
maActionListeners.disposeAndClear( aObj );
maItemListeners.disposeAndClear( aObj );
- VCLXImageConsumer::dispose();
+ VCLXGraphicControl::dispose();
}
void VCLXButton::addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener > & l )throw(::com::sun::star::uno::RuntimeException)
@@ -573,7 +525,7 @@ void VCLXButton::setProperty( const ::rtl::OUString& PropertyName, const ::com::
break;
default:
{
- VCLXImageConsumer::setProperty( PropertyName, Value );
+ VCLXGraphicControl::setProperty( PropertyName, Value );
}
}
}
@@ -613,7 +565,7 @@ void VCLXButton::setProperty( const ::rtl::OUString& PropertyName, const ::com::
break;
default:
{
- aProp <<= VCLXImageConsumer::getProperty( PropertyName );
+ aProp <<= VCLXGraphicControl::getProperty( PropertyName );
}
}
}
@@ -664,7 +616,7 @@ void VCLXButton::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
break;
default:
- VCLXImageConsumer::ProcessWindowEvent( rVclWindowEvent );
+ VCLXGraphicControl::ProcessWindowEvent( rVclWindowEvent );
break;
}
}
@@ -693,7 +645,7 @@ void VCLXImageControl::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_WRITING_MODE,
BASEPROPERTY_CONTEXT_WRITING_MODE,
0);
- VCLXImageConsumer::ImplGetPropertyIds( rIds );
+ VCLXGraphicControl::ImplGetPropertyIds( rIds );
}
VCLXImageControl::VCLXImageControl()
@@ -770,7 +722,7 @@ void VCLXImageControl::setProperty( const ::rtl::OUString& PropertyName, const :
break;
default:
- VCLXImageConsumer::setProperty( PropertyName, Value );
+ VCLXGraphicControl::setProperty( PropertyName, Value );
break;
}
}
@@ -794,7 +746,7 @@ void VCLXImageControl::setProperty( const ::rtl::OUString& PropertyName, const :
break;
default:
- aProp = VCLXImageConsumer::getProperty( PropertyName );
+ aProp = VCLXGraphicControl::getProperty( PropertyName );
break;
}
return aProp;
@@ -831,7 +783,7 @@ void VCLXCheckBox::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_CONTEXT_WRITING_MODE,
BASEPROPERTY_REFERENCE_DEVICE,
0);
- VCLXImageConsumer::ImplGetPropertyIds( rIds );
+ VCLXGraphicControl::ImplGetPropertyIds( rIds );
}
VCLXCheckBox::VCLXCheckBox() : maActionListeners( *this ), maItemListeners( *this )
@@ -844,14 +796,14 @@ VCLXCheckBox::VCLXCheckBox() : maActionListeners( *this ), maItemListeners( *th
::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
SAL_STATIC_CAST( ::com::sun::star::awt::XButton*, this ),
SAL_STATIC_CAST( ::com::sun::star::awt::XCheckBox*, this ) );
- return (aRet.hasValue() ? aRet : VCLXImageConsumer::queryInterface( rType ));
+ return (aRet.hasValue() ? aRet : VCLXGraphicControl::queryInterface( rType ));
}
// ::com::sun::star::lang::XTypeProvider
IMPL_XTYPEPROVIDER_START( VCLXCheckBox )
getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XButton>* ) NULL ),
getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XCheckBox>* ) NULL ),
- VCLXImageConsumer::getTypes()
+ VCLXGraphicControl::getTypes()
IMPL_XTYPEPROVIDER_END
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > VCLXCheckBox::CreateAccessibleContext()
@@ -866,7 +818,7 @@ void VCLXCheckBox::dispose() throw(::com::sun::star::uno::RuntimeException)
::com::sun::star::lang::EventObject aObj;
aObj.Source = (::cppu::OWeakObject*)this;
maItemListeners.disposeAndClear( aObj );
- VCLXImageConsumer::dispose();
+ VCLXGraphicControl::dispose();
}
void VCLXCheckBox::addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener > & l ) throw(::com::sun::star::uno::RuntimeException)
@@ -1028,7 +980,7 @@ void VCLXCheckBox::setProperty( const ::rtl::OUString& PropertyName, const ::com
break;
default:
{
- VCLXImageConsumer::setProperty( PropertyName, Value );
+ VCLXGraphicControl::setProperty( PropertyName, Value );
}
}
}
@@ -1056,7 +1008,7 @@ void VCLXCheckBox::setProperty( const ::rtl::OUString& PropertyName, const ::com
break;
default:
{
- aProp <<= VCLXImageConsumer::getProperty( PropertyName );
+ aProp <<= VCLXGraphicControl::getProperty( PropertyName );
}
}
}
@@ -1098,7 +1050,7 @@ void VCLXCheckBox::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
break;
default:
- VCLXImageConsumer::ProcessWindowEvent( rVclWindowEvent );
+ VCLXGraphicControl::ProcessWindowEvent( rVclWindowEvent );
break;
}
}
@@ -1131,7 +1083,7 @@ void VCLXRadioButton::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_CONTEXT_WRITING_MODE,
BASEPROPERTY_REFERENCE_DEVICE,
0);
- VCLXImageConsumer::ImplGetPropertyIds( rIds );
+ VCLXGraphicControl::ImplGetPropertyIds( rIds );
}
@@ -1145,14 +1097,14 @@ VCLXRadioButton::VCLXRadioButton() : maItemListeners( *this ), maActionListeners
::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
SAL_STATIC_CAST( ::com::sun::star::awt::XRadioButton*, this ),
SAL_STATIC_CAST( ::com::sun::star::awt::XButton*, this ) );
- return (aRet.hasValue() ? aRet : VCLXImageConsumer::queryInterface( rType ));
+ return (aRet.hasValue() ? aRet : VCLXGraphicControl::queryInterface( rType ));
}
// ::com::sun::star::lang::XTypeProvider
IMPL_XTYPEPROVIDER_START( VCLXRadioButton )
getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XRadioButton>* ) NULL ),
getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XButton>* ) NULL ),
- VCLXImageConsumer::getTypes()
+ VCLXGraphicControl::getTypes()
IMPL_XTYPEPROVIDER_END
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > VCLXRadioButton::CreateAccessibleContext()
@@ -1167,7 +1119,7 @@ void VCLXRadioButton::dispose() throw(::com::sun::star::uno::RuntimeException)
::com::sun::star::lang::EventObject aObj;
aObj.Source = (::cppu::OWeakObject*)this;
maItemListeners.disposeAndClear( aObj );
- VCLXImageConsumer::dispose();
+ VCLXGraphicControl::dispose();
}
void VCLXRadioButton::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value) throw(::com::sun::star::uno::RuntimeException)
@@ -1206,7 +1158,7 @@ void VCLXRadioButton::setProperty( const ::rtl::OUString& PropertyName, const ::
break;
default:
{
- VCLXImageConsumer::setProperty( PropertyName, Value );
+ VCLXGraphicControl::setProperty( PropertyName, Value );
}
}
}
@@ -1234,7 +1186,7 @@ void VCLXRadioButton::setProperty( const ::rtl::OUString& PropertyName, const ::
break;
default:
{
- aProp <<= VCLXImageConsumer::getProperty( PropertyName );
+ aProp <<= VCLXGraphicControl::getProperty( PropertyName );
}
}
}
@@ -1366,7 +1318,7 @@ void VCLXRadioButton::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent
break;
default:
- VCLXImageConsumer::ProcessWindowEvent( rVclWindowEvent );
+ VCLXGraphicControl::ProcessWindowEvent( rVclWindowEvent );
break;
}
}
@@ -2212,11 +2164,28 @@ void SAL_CALL VCLXListBox::itemListChanged( const EventObject& i_rEvent ) throw
pListBox->Clear();
+ uno::Reference< beans::XPropertySet > xPropSet( i_rEvent.Source, uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySetInfo > xPSI( xPropSet->getPropertySetInfo(), uno::UNO_QUERY_THROW );
+ uno::Reference< resource::XStringResourceResolver > xStringResourceResolver;
+ if ( xPSI->hasPropertyByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) ) )
+ {
+ xStringResourceResolver.set(
+ xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" ) ) ),
+ uno::UNO_QUERY
+ );
+ }
+
+
Reference< XItemList > xItemList( i_rEvent.Source, uno::UNO_QUERY_THROW );
uno::Sequence< beans::Pair< ::rtl::OUString, ::rtl::OUString > > aItems = xItemList->getAllItems();
for ( sal_Int32 i=0; i<aItems.getLength(); ++i )
{
- pListBox->InsertEntry( aItems[i].First, lcl_getImageFromURL( aItems[i].Second ) );
+ ::rtl::OUString aLocalizationKey( aItems[i].First );
+ if ( xStringResourceResolver.is() && aLocalizationKey.getLength() != 0 && aLocalizationKey[0] == '&' )
+ {
+ aLocalizationKey = xStringResourceResolver->resolveString(aLocalizationKey.copy( 1 ));
+ }
+ pListBox->InsertEntry( aLocalizationKey, lcl_getImageFromURL( aItems[i].Second ) );
}
}
@@ -3010,16 +2979,15 @@ short VCLXFixedText::getAlignment() throw(::com::sun::star::uno::RuntimeExceptio
return getMinimumSize();
}
-::com::sun::star::awt::Size VCLXFixedText::calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException)
+::com::sun::star::awt::Size VCLXFixedText::calcAdjustedSize( const ::com::sun::star::awt::Size& rMaxSize ) throw(::com::sun::star::uno::RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );
- ::com::sun::star::awt::Size aSz = rNewSize;
- ::com::sun::star::awt::Size aMinSz = getMinimumSize();
- if ( aSz.Height != aMinSz.Height )
- aSz.Height = aMinSz.Height;
-
- return aSz;
+ Size aAdjustedSize( VCLUnoHelper::ConvertToVCLSize( rMaxSize ) );
+ FixedText* pFixedText = (FixedText*)GetWindow();
+ if ( pFixedText )
+ aAdjustedSize = pFixedText->CalcMinimumSize( rMaxSize.Width );
+ return VCLUnoHelper::ConvertToAWTSize( aAdjustedSize );
}
// ----------------------------------------------------
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index 405356c2b7ac..c54549baed5e 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -2116,9 +2116,14 @@ throw (RuntimeException)
urlObj.removeSegment();
baseLocation = urlObj.GetMainURL( INetURLObject::NO_DECODE );
- ::rtl::OUString testAbsoluteURL;
- if ( ::osl::FileBase::E_None == ::osl::FileBase::getAbsoluteFileURL( baseLocation, url, testAbsoluteURL ) )
- absoluteURL = testAbsoluteURL;
+ const INetURLObject protocolCheck( url );
+ const INetProtocol protocol = protocolCheck.GetProtocol();
+ if ( protocol == INET_PROT_NOT_VALID )
+ {
+ ::rtl::OUString testAbsoluteURL;
+ if ( ::osl::FileBase::E_None == ::osl::FileBase::getAbsoluteFileURL( baseLocation, url, testAbsoluteURL ) )
+ absoluteURL = testAbsoluteURL;
+ }
}
return absoluteURL;
diff --git a/toolkit/source/controls/roadmapcontrol.cxx b/toolkit/source/controls/roadmapcontrol.cxx
index acfbee0c5bb6..96f51b39dc72 100644
--- a/toolkit/source/controls/roadmapcontrol.cxx
+++ b/toolkit/source/controls/roadmapcontrol.cxx
@@ -52,27 +52,6 @@ namespace toolkit
// helper
// ----------------------------------------------------
- static void lcl_knitImageComponents( const Reference< XControlModel >& _rxModel,
- const Reference< XWindowPeer >& _rxPeer,
- bool _bAdd )
- {
- Reference< XImageProducer > xProducer( _rxModel, UNO_QUERY );
- if ( xProducer.is() )
- {
- Reference< XImageConsumer > xConsumer( _rxPeer, UNO_QUERY );
- if ( xConsumer.is() )
- {
- if ( _bAdd )
- {
- xProducer->addConsumer( xConsumer );
- xProducer->startProduction();
- }
- else
- xProducer->removeConsumer( xConsumer );
- }
- }
- }
-
static void lcl_throwIllegalArgumentException( )
{ // throwing is expensive (in terms of code size), thus we hope the compiler does not inline this ....
throw IllegalArgumentException();
@@ -97,6 +76,7 @@ static void lcl_throwIndexOutOfBoundsException( )
ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
ImplRegisterProperty( BASEPROPERTY_HELPURL );
ImplRegisterProperty( BASEPROPERTY_IMAGEURL );
+ ImplRegisterProperty( BASEPROPERTY_GRAPHIC );
ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
ImplRegisterProperty( BASEPROPERTY_COMPLETE );
ImplRegisterProperty( BASEPROPERTY_ACTIVATED );
@@ -135,7 +115,7 @@ static void lcl_throwIndexOutOfBoundsException( )
case BASEPROPERTY_DEFAULTCONTROL:
aReturn <<= ::rtl::OUString( ::rtl::OUString::createFromAscii( szServiceName_UnoControlRoadmap ) );
break;
- default : aReturn = UnoControlModel::ImplGetDefaultValue( nPropId ); break;
+ default : aReturn = UnoControlRoadmapModel_Base::ImplGetDefaultValue( nPropId ); break;
}
return aReturn;
@@ -384,40 +364,6 @@ static void lcl_throwIndexOutOfBoundsException( )
maContainerListeners.removeInterface( xListener );
}
-
- void UnoControlRoadmapModel::addConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException)
- {
- maImageListeners.push_back( xConsumer );
- }
-
-
- void UnoControlRoadmapModel::removeConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException)
- {
- maImageListeners.remove( xConsumer );
- }
-
-
- void UnoControlRoadmapModel::startProduction( ) throw (::com::sun::star::uno::RuntimeException)
- {
- Sequence<Any> aArgs(1);
- aArgs.getArray()[0] = getPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ) );
- Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- Reference< XImageProducer > xImageProducer( xMSF->createInstanceWithArguments( ::rtl::OUString::createFromAscii( "com.sun.star.awt.ImageProducer" ), aArgs ), UNO_QUERY );
- if ( xImageProducer.is() )
- {
- std::list< Reference< XImageConsumer > >::iterator aIter( maImageListeners.begin() );
- while ( aIter != maImageListeners.end() )
- {
- xImageProducer->addConsumer( *aIter );
- aIter++;
- }
- xImageProducer->startProduction();
- }
- }
-
-
-
-
// ===================================================================
// = UnoRoadmapControl
// ===================================================================
@@ -434,9 +380,6 @@ sal_Bool SAL_CALL UnoRoadmapControl::setModel(const Reference< XControlModel >&
{
- // remove the peer as image consumer from the model
- lcl_knitImageComponents( getModel(), getPeer(), false );
-
Reference< XContainer > xC( getModel(), UNO_QUERY );
if ( xC.is() )
xC->removeContainerListener( this );
@@ -447,9 +390,6 @@ sal_Bool SAL_CALL UnoRoadmapControl::setModel(const Reference< XControlModel >&
if ( xC.is() )
xC->addContainerListener( this );
- // add the peer as image consumer to the model
- lcl_knitImageComponents( getModel(), getPeer(), true );
-
return bReturn;
}
@@ -462,18 +402,6 @@ sal_Bool SAL_CALL UnoRoadmapControl::setModel(const Reference< XControlModel >&
- void SAL_CALL UnoRoadmapControl::createPeer( const Reference<XToolkit > & rxToolkit, const Reference< XWindowPeer > & rParentPeer ) throw(RuntimeException)
- {
- // remove the peer as image consumer from the model
- lcl_knitImageComponents( getModel(), getPeer(), false );
-
- UnoControl::createPeer( rxToolkit, rParentPeer );
-
- lcl_knitImageComponents( getModel(), getPeer(), true );
-
- }
-
-
void UnoRoadmapControl::dispose() throw(RuntimeException)
{
EventObject aEvt;
@@ -484,24 +412,6 @@ sal_Bool SAL_CALL UnoRoadmapControl::setModel(const Reference< XControlModel >&
-void UnoRoadmapControl::ImplSetPeerProperty( const ::rtl::OUString& rPropName, const Any& rVal )
-{
- sal_uInt16 nType = GetPropertyId( rPropName );
- if ( getPeer().is() && ( nType == BASEPROPERTY_IMAGEURL ) )
- {
- Reference < XImageProducer > xImgProd( getModel(), UNO_QUERY );
- Reference < XImageConsumer > xImgCons( getPeer(), UNO_QUERY );
-
- if ( xImgProd.is() && xImgCons.is() )
- {
- xImgProd->startProduction();
- }
- }
- else
- UnoControlBase::ImplSetPeerProperty( rPropName, rVal );
-}
-
-
void UnoRoadmapControl::elementInserted( const ContainerEvent& rEvent )throw(RuntimeException)
{
Reference< XInterface > xRoadmapItem;
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx
index d91077823495..eb45dd521d9a 100644
--- a/toolkit/source/controls/unocontrol.cxx
+++ b/toolkit/source/controls/unocontrol.cxx
@@ -1463,7 +1463,7 @@ sal_Bool UnoControl::supportsService( const ::rtl::OUString& rServiceName ) thro
Sequence< ::rtl::OUString > aSNL = getSupportedServiceNames();
const ::rtl::OUString* pArray = aSNL.getConstArray();
- const ::rtl::OUString* pArrayEnd = aSNL.getConstArray();
+ const ::rtl::OUString* pArrayEnd = aSNL.getConstArray() + aSNL.getLength();
for (; pArray != pArrayEnd; ++pArray )
if( *pArray == rServiceName )
break;
@@ -1587,3 +1587,15 @@ awt::Size SAL_CALL UnoControl::convertSizeToPixel( const awt::Size& i_Size, ::sa
return awt::Size( );
}
+//----------------------------------------------------------------------------------------------------------------------
+uno::Reference< awt::XStyleSettings > SAL_CALL UnoControl::getStyleSettings() throw (RuntimeException)
+{
+ Reference< awt::XStyleSettingsSupplier > xPeerSupplier;
+ {
+ ::osl::MutexGuard aGuard( GetMutex() );
+ xPeerSupplier = xPeerSupplier.query( getPeer() );
+ }
+ if ( xPeerSupplier.is() )
+ return xPeerSupplier->getStyleSettings();
+ return NULL;
+}
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx
index cfb71111e3dc..6599b039600f 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -80,32 +80,6 @@ using ::com::sun::star::graphic::XGraphic;
using ::com::sun::star::uno::Reference;
using namespace ::toolkit;
-
-// ----------------------------------------------------
-// helper
-// ----------------------------------------------------
-
-static void lcl_knitImageComponents( const uno::Reference< awt::XControlModel >& _rxModel,
- const uno::Reference< awt::XWindowPeer >& _rxPeer,
- bool _bAdd )
-{
- uno::Reference< awt::XImageProducer > xProducer( _rxModel, uno::UNO_QUERY );
- if ( xProducer.is() )
- {
- uno::Reference< awt::XImageConsumer > xConsumer( _rxPeer, uno::UNO_QUERY );
- if ( xConsumer.is() )
- {
- if ( _bAdd )
- {
- xProducer->addConsumer( xConsumer );
- xProducer->startProduction();
- }
- else
- xProducer->removeConsumer( xConsumer );
- }
- }
-}
-
// ----------------------------------------------------
// class UnoControlEditModel
// ----------------------------------------------------
@@ -543,37 +517,16 @@ UnoFileControl::UnoFileControl()
}
// ----------------------------------------------------
-// class ImageProducerControlModel
+// class GraphicControlModel
// ----------------------------------------------------
-uno::Any SAL_CALL ImageProducerControlModel::queryInterface( const uno::Type & rType ) throw(uno::RuntimeException)
-{
- return UnoControlModel::queryInterface( rType );
-}
-
-uno::Any SAL_CALL ImageProducerControlModel::queryAggregation( const uno::Type & rType ) throw(uno::RuntimeException)
-{
- uno::Any aRet = ::cppu::queryInterface( rType, SAL_STATIC_CAST( awt::XImageProducer*, this ) );
- return (aRet.hasValue() ? aRet : UnoControlModel::queryAggregation( rType ));
-}
-
-void SAL_CALL ImageProducerControlModel::acquire() throw()
-{
- UnoControlModel::acquire();
-}
-
-void SAL_CALL ImageProducerControlModel::release() throw()
-{
- UnoControlModel::release();
-}
-
-uno::Any ImageProducerControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
+uno::Any GraphicControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
{
if ( nPropId == BASEPROPERTY_GRAPHIC )
return uno::makeAny( uno::Reference< graphic::XGraphic >() );
return UnoControlModel::ImplGetDefaultValue( nPropId );
}
- uno::Reference< graphic::XGraphic > ImageProducerControlModel::getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL )
+ uno::Reference< graphic::XGraphic > GraphicControlModel::getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL )
{
uno::Reference< graphic::XGraphic > xGraphic;
@@ -611,7 +564,7 @@ uno::Any ImageProducerControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) co
return xGraphic;
}
-void SAL_CALL ImageProducerControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception)
+void SAL_CALL GraphicControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception)
{
UnoControlModel::setFastPropertyValue_NoBroadcast( nHandle, rValue );
@@ -665,90 +618,11 @@ void SAL_CALL ImageProducerControlModel::setFastPropertyValue_NoBroadcast( sal_I
}
catch( const ::com::sun::star::uno::Exception& )
{
- OSL_ENSURE( sal_False, "ImageProducerControlModel::setFastPropertyValue_NoBroadcast: caught an exception while aligning the ImagePosition/ImageAlign properties!" );
+ OSL_ENSURE( sal_False, "GraphicControlModel::setFastPropertyValue_NoBroadcast: caught an exception while aligning the ImagePosition/ImageAlign properties!" );
mbAdjustingImagePosition = sal_False;
}
}
-void ImageProducerControlModel::addConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException)
-{
- maListeners.push_back( xConsumer );
-}
-
-void ImageProducerControlModel::removeConsumer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XImageConsumer >& xConsumer ) throw (::com::sun::star::uno::RuntimeException)
-{
- maListeners.remove( xConsumer );
-}
-
-void ImageProducerControlModel::startProduction( ) throw (::com::sun::star::uno::RuntimeException)
-{
- uno::Sequence<uno::Any> aArgs(1);
- aArgs.getArray()[0] = getPropertyValue( GetPropertyName( BASEPROPERTY_IMAGEURL ) );
- uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- uno::Reference< awt::XImageProducer > xImageProducer( xMSF->createInstanceWithArguments( ::rtl::OUString::createFromAscii( "com.sun.star.awt.ImageProducer" ), aArgs ), uno::UNO_QUERY );
- if ( xImageProducer.is() )
- {
- std::list< uno::Reference< awt::XImageConsumer > >::iterator aIter( maListeners.begin() );
- while ( aIter != maListeners.end() )
- {
- xImageProducer->addConsumer( *aIter );
- aIter++;
- }
- xImageProducer->startProduction();
- }
-}
-
-// ----------------------------------------------------
-// class ImageConsumerControl
-// ----------------------------------------------------
-
-sal_Bool SAL_CALL ImageConsumerControl::setModel(const uno::Reference< awt::XControlModel >& _rModel) throw ( uno::RuntimeException )
-{
- // remove the peer as image consumer from the model
- lcl_knitImageComponents( getModel(), getPeer(), false );
-
- sal_Bool bReturn = UnoControlBase::setModel( _rModel );
-
- // add the peer as image consumer to the model
- lcl_knitImageComponents( getModel(), getPeer(), true );
-
- return bReturn;
-}
-
-void SAL_CALL ImageConsumerControl::createPeer( const uno::Reference< awt::XToolkit >& rxToolkit, const uno::Reference< awt::XWindowPeer >& rParentPeer ) throw(uno::RuntimeException)
-{
- // remove the peer as image consumer from the model
- lcl_knitImageComponents( getModel(), getPeer(), false );
-
- UnoControlBase::createPeer( rxToolkit, rParentPeer );
-
- // add the peer as image consumer to the model
- lcl_knitImageComponents( getModel(), getPeer(), true );
-}
-
-void SAL_CALL ImageConsumerControl::dispose( ) throw(::com::sun::star::uno::RuntimeException)
-{
- // remove the peer as image consumer from the model
- lcl_knitImageComponents( getModel(), getPeer(), false );
-
- UnoControlBase::dispose();
-}
-
-void ImageConsumerControl::ImplSetPeerProperty( const ::rtl::OUString& rPropName, const uno::Any& rVal )
-{
- sal_uInt16 nType = GetPropertyId( rPropName );
- if ( nType == BASEPROPERTY_IMAGEURL )
- {
- uno::Reference < awt::XImageProducer > xImgProd( getModel(), uno::UNO_QUERY );
- uno::Reference < awt::XImageConsumer > xImgCons( getPeer(), uno::UNO_QUERY );
-
- if ( xImgProd.is() && xImgCons.is() )
- xImgProd->startProduction();
- }
- else
- UnoControlBase::ImplSetPeerProperty( rPropName, rVal );
-}
-
// ----------------------------------------------------
// class UnoControlButtonModel
// ----------------------------------------------------
@@ -784,7 +658,7 @@ uno::Any UnoControlButtonModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
return uno::makeAny( (sal_Bool)sal_True );
}
- return ImageProducerControlModel::ImplGetDefaultValue( nPropId );
+ return GraphicControlModel::ImplGetDefaultValue( nPropId );
}
::cppu::IPropertyArrayHelper& UnoControlButtonModel::getInfoHelper()
@@ -847,12 +721,12 @@ void UnoButtonControl::dispose() throw(uno::RuntimeException)
aEvt.Source = (::cppu::OWeakObject*)this;
maActionListeners.disposeAndClear( aEvt );
maItemListeners.disposeAndClear( aEvt );
- ImageConsumerControl::dispose();
+ UnoControlBase::dispose();
}
void UnoButtonControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer ) throw(uno::RuntimeException)
{
- ImageConsumerControl::createPeer( rxToolkit, rParentPeer );
+ UnoControlBase::createPeer( rxToolkit, rParentPeer );
uno::Reference < awt::XButton > xButton( getPeer(), uno::UNO_QUERY );
xButton->setActionCommand( maActionCommand );
@@ -896,7 +770,7 @@ void UnoButtonControl::removeItemListener(const uno::Reference< awt::XItemListen
void SAL_CALL UnoButtonControl::disposing( const lang::EventObject& Source ) throw (uno::RuntimeException)
{
- ImageConsumerControl::disposing( Source );
+ UnoControlBase::disposing( Source );
}
void SAL_CALL UnoButtonControl::itemStateChanged( const awt::ItemEvent& rEvent ) throw (uno::RuntimeException)
@@ -966,7 +840,7 @@ uno::Any UnoControlImageControlModel::ImplGetDefaultValue( sal_uInt16 nPropId )
if ( nPropId == BASEPROPERTY_IMAGE_SCALE_MODE )
return makeAny( awt::ImageScaleMode::Anisotropic );
- return ImageProducerControlModel::ImplGetDefaultValue( nPropId );
+ return GraphicControlModel::ImplGetDefaultValue( nPropId );
}
::cppu::IPropertyArrayHelper& UnoControlImageControlModel::getInfoHelper()
@@ -989,7 +863,7 @@ uno::Reference< beans::XPropertySetInfo > UnoControlImageControlModel::getProper
void SAL_CALL UnoControlImageControlModel::setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) throw (::com::sun::star::uno::Exception)
{
- ImageProducerControlModel::setFastPropertyValue_NoBroadcast( _nHandle, _rValue );
+ GraphicControlModel::setFastPropertyValue_NoBroadcast( _nHandle, _rValue );
// ScaleImage is an older (and less powerful) version of ScaleMode, but keep both in sync as far as possible
try
@@ -1093,7 +967,7 @@ uno::Any UnoControlRadioButtonModel::ImplGetDefaultValue( sal_uInt16 nPropId ) c
return uno::makeAny( (sal_Int16)awt::VisualEffect::LOOK3D );
}
- return ImageProducerControlModel::ImplGetDefaultValue( nPropId );
+ return GraphicControlModel::ImplGetDefaultValue( nPropId );
}
::cppu::IPropertyArrayHelper& UnoControlRadioButtonModel::getInfoHelper()
@@ -1136,7 +1010,7 @@ void UnoRadioButtonControl::dispose() throw(uno::RuntimeException)
lang::EventObject aEvt;
aEvt.Source = (::cppu::OWeakObject*)this;
maItemListeners.disposeAndClear( aEvt );
- ImageConsumerControl::dispose();
+ UnoControlBase::dispose();
}
@@ -1147,7 +1021,7 @@ sal_Bool UnoRadioButtonControl::isTransparent() throw(uno::RuntimeException)
void UnoRadioButtonControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer ) throw(uno::RuntimeException)
{
- ImageConsumerControl::createPeer( rxToolkit, rParentPeer );
+ UnoControlBase::createPeer( rxToolkit, rParentPeer );
uno::Reference < awt::XRadioButton > xRadioButton( getPeer(), uno::UNO_QUERY );
xRadioButton->addItemListener( this );
@@ -1300,7 +1174,7 @@ uno::Any UnoControlCheckBoxModel::ImplGetDefaultValue( sal_uInt16 nPropId ) cons
return uno::makeAny( (sal_Int16)awt::VisualEffect::LOOK3D );
}
- return ImageProducerControlModel::ImplGetDefaultValue( nPropId );
+ return GraphicControlModel::ImplGetDefaultValue( nPropId );
}
::cppu::IPropertyArrayHelper& UnoControlCheckBoxModel::getInfoHelper()
@@ -1343,7 +1217,7 @@ void UnoCheckBoxControl::dispose() throw(uno::RuntimeException)
lang::EventObject aEvt;
aEvt.Source = (::cppu::OWeakObject*)this;
maItemListeners.disposeAndClear( aEvt );
- ImageConsumerControl::dispose();
+ UnoControlBase::dispose();
}
sal_Bool UnoCheckBoxControl::isTransparent() throw(uno::RuntimeException)
@@ -1353,7 +1227,7 @@ sal_Bool UnoCheckBoxControl::isTransparent() throw(uno::RuntimeException)
void UnoCheckBoxControl::createPeer( const uno::Reference< awt::XToolkit > & rxToolkit, const uno::Reference< awt::XWindowPeer > & rParentPeer ) throw(uno::RuntimeException)
{
- ImageConsumerControl::createPeer( rxToolkit, rParentPeer );
+ UnoControlBase::createPeer( rxToolkit, rParentPeer );
uno::Reference < awt::XCheckBox > xCheckBox( getPeer(), uno::UNO_QUERY );
xCheckBox->addItemListener( this );
@@ -1960,7 +1834,9 @@ UnoControlListBoxModel::UnoControlListBoxModel( const UnoControlListBoxModel& i_
,m_aItemListListeners( GetMutex() )
{
}
-
+UnoControlListBoxModel::~UnoControlListBoxModel()
+{
+}
// ---------------------------------------------------------------------------------------------------------------------
::rtl::OUString UnoControlListBoxModel::getServiceName() throw(::com::sun::star::uno::RuntimeException)
{
@@ -2800,7 +2676,14 @@ void SAL_CALL UnoListBoxControl::itemListChanged( const lang::EventObject& i_rEv
if ( xPeerListener.is() )
xPeerListener->itemListChanged( i_rEvent );
}
-
+ActionListenerMultiplexer& UnoListBoxControl::getActionListeners()
+{
+ return maActionListeners;
+}
+ItemListenerMultiplexer& UnoListBoxControl::getItemListeners()
+{
+ return maItemListeners;
+}
// ----------------------------------------------------
// class UnoControlComboBoxModel
// ----------------------------------------------------
diff --git a/toolkit/source/helper/servicenames.cxx b/toolkit/source/helper/servicenames.cxx
index 6a376391f46d..f57f52f13e57 100644
--- a/toolkit/source/helper/servicenames.cxx
+++ b/toolkit/source/helper/servicenames.cxx
@@ -77,7 +77,6 @@ const sal_Char __FAR_DATA szServiceName_UnoControlPatternFieldModel[] = "stardiv
const sal_Char __FAR_DATA szServiceName_UnoControlFormattedField[] = "stardiv.vcl.control.FormattedField", szServiceName2_UnoControlFormattedField[] = "com.sun.star.awt.UnoControlFormattedField";
const sal_Char __FAR_DATA szServiceName_UnoControlFormattedFieldModel[] = "stardiv.vcl.controlmodel.FormattedField", szServiceName2_UnoControlFormattedFieldModel[] = "com.sun.star.awt.UnoControlFormattedFieldModel";
const sal_Char __FAR_DATA szServiceName_MVCIntrospection[] = "stardiv.vcl.MVCIntrospection", szServiceName2_MVCIntrospection[] = "com.sun.star.awt.MVCIntrospection";
-const sal_Char __FAR_DATA szServiceName_ImageProducer[] = "stardiv.vcl.ImageProducer", szServiceName2_ImageProducer[] = "com.sun.star.awt.ImageProducer";
const sal_Char __FAR_DATA szServiceName_PrinterServer[] = "stardiv.vcl.PrinterServer", szServiceName2_PrinterServer[] = "com.sun.star.awt.PrinterServer";
const sal_Char __FAR_DATA szServiceName_UnoControlProgressBar[] = "stardiv.vcl.control.ProgressBar", szServiceName2_UnoControlProgressBar[] = "com.sun.star.awt.UnoControlProgressBar";
const sal_Char __FAR_DATA szServiceName_UnoControlProgressBarModel[] = "stardiv.vcl.controlmodel.ProgressBar", szServiceName2_UnoControlProgressBarModel[] = "com.sun.star.awt.UnoControlProgressBarModel";
diff --git a/toolkit/source/layout/core/import.cxx b/toolkit/source/layout/core/import.cxx
index daaa8c239f50..6d161cf1b07e 100644
--- a/toolkit/source/layout/core/import.cxx
+++ b/toolkit/source/layout/core/import.cxx
@@ -109,17 +109,6 @@ SAL_THROW (())
DBG_ERROR( "Fatal error: top node isn't a dialog" );
}
-#if 0
- // Hack moved to proplist.cxx
- OUString aGraphic;
- if ( findAndRemove( "graphic", aProps, aGraphic ) )
- //if ( layout::FixedImage *i = dynamic_cast<layout::FixedImage *> ( mpWidget->getPeer().get() ) )
- // FIXME: huh? XImageProducer::complete( XImageConsumer )
- //i->setImage( Image( loadGraphic( OUSTRING_CSTR( aGraphic ) ) ) );
- mpWidget->setProperty( OUString::createFromAscii( "graphic" ),
- loadGraphic( OUSTRING_CSTR( aGraphic ) ) );
-#endif
-
OUString aOrdering;
if ( findAndRemove( "ordering", aProps, aOrdering ) )
if ( DialogButtonHBox *b = dynamic_cast<DialogButtonHBox *> ( mpWidget->getPeer().get() ) )
diff --git a/tools/source/misc/extendapplicationenvironment.cxx b/tools/source/misc/extendapplicationenvironment.cxx
index fe76e5329cbb..440f5a5cb207 100644
--- a/tools/source/misc/extendapplicationenvironment.cxx
+++ b/tools/source/misc/extendapplicationenvironment.cxx
@@ -29,8 +29,6 @@
#include "sal/config.h"
#include <stdlib.h>
- // not <cstdlib> as putenv is POSIX-only; setenv instead of putenv would be
- // better but is not supported by Solaris 9 and earlier
#if defined UNX
#include <sys/resource.h>
@@ -63,10 +61,9 @@ void extendApplicationEnvironment() {
// Make sure URE_BOOTSTRAP environment variable is set (failure is fatal):
rtl::OUStringBuffer env;
- env.appendAscii(RTL_CONSTASCII_STRINGPARAM("URE_BOOTSTRAP="));
+ rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("URE_BOOTSTRAP"));
rtl::OUString uri;
- if (rtl::Bootstrap::get(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URE_BOOTSTRAP")), uri))
+ if (rtl::Bootstrap::get(envVar, uri))
{
if (!uri.matchIgnoreAsciiCaseAsciiL(
RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.pathname:")))
@@ -86,16 +83,8 @@ void extendApplicationEnvironment() {
env.appendAscii(
RTL_CONSTASCII_STRINGPARAM(SAL_CONFIGFILE("fundamental")));
}
- rtl::OString s;
- if (!env.makeStringAndClear().convertToString(
- &s, osl_getThreadTextEncoding(),
- RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
- | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))
- {
- abort();
- }
- rtl_string_acquire(s.pData); // argument to putenv must leak
- if (putenv(const_cast< char * >(s.getStr())) != 0) {
+ rtl::OUString envValue(env.makeStringAndClear());
+ if (osl_setEnvironment(envVar.pData, envValue.pData) != osl_Process_E_None) {
abort();
}
}
diff --git a/tools/source/string/strucvt.cxx b/tools/source/string/strucvt.cxx
index 7198d0e8f98c..9c9ef1dc4b5a 100644
--- a/tools/source/string/strucvt.cxx
+++ b/tools/source/string/strucvt.cxx
@@ -201,6 +201,8 @@ UniString::UniString( const ResId& rResId )
Append( UniString::CreateFromInt32( rResId.GetId() ) );
AppendAscii( " not found>" );
#endif
+ if( pResMgr )
+ pResMgr->PopContext();
}
diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx
index a1d287337bea..e8ae78d0aed2 100644
--- a/unotools/source/config/fontcfg.cxx
+++ b/unotools/source/config/fontcfg.cxx
@@ -1199,8 +1199,15 @@ const FontNameAttr* FontSubstConfiguration::getSubstInfo( const String& rFontNam
// try to find an exact match
// because the list is sorted this will also find fontnames of the form searchfontname*
std::vector< FontNameAttr >::const_iterator it = ::std::lower_bound( lang->second.aSubstAttributes.begin(), lang->second.aSubstAttributes.end(), aSearchAttr, StrictStringSort() );
- if( it != lang->second.aSubstAttributes.end() && aSearchFont.CompareTo( it->Name, aSearchFont.Len() ) == COMPARE_EQUAL )
- return &(*it);
+ if( it != lang->second.aSubstAttributes.end())
+ {
+ const FontNameAttr& rFoundAttr = *it;
+ // a search for "abcblack" may match with an entry for "abc"
+ // the reverse is not a good idea (e.g. #i112731# alba->albani)
+ if( rFoundAttr.Name.Len() <= aSearchFont.Len() )
+ if( aSearchFont.CompareTo( rFoundAttr.Name, rFoundAttr.Name.Len() ) == COMPARE_EQUAL )
+ return &rFoundAttr;
+ }
}
// gradually become more unspecific
if( aLocale.Variant.getLength() )
diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h
index 1948018806e1..a3d6c2793aae 100644
--- a/vcl/aqua/inc/salgdi.h
+++ b/vcl/aqua/inc/salgdi.h
@@ -229,17 +229,17 @@ public:
CGPoint* makeCGptArray(ULONG nPoints, const SalPoint* pPtAry);
// native widget rendering methods that require mirroring
- virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+ virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
const Point& aPos, BOOL& rIsInside );
- virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+ virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+ virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState,
+ virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& aCaption,
- Region &rNativeBoundingRegion, Region &rNativeContentRegion );
+ Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
// get device resolution
virtual void GetResolution( long& rDPIX, long& rDPIY );
@@ -276,7 +276,7 @@ public:
// set the font
virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
// get the current font's etrics
- virtual void GetFontMetric( ImplFontMetricData* );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
// get kernign pairs of the current font
// return only PairCount if (pKernPairs == NULL)
virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index b8a2261ed9db..a90488b98b46 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -449,6 +449,7 @@ SalInstance* CreateSalInstance()
ImplGetSVData()->maNWFData.mbCenteredTabs = true;
ImplGetSVData()->maNWFData.mbProgressNeedsErase = true;
ImplGetSVData()->maNWFData.mbCheckBoxNeedsErase = true;
+ ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset = 10;
ImplGetSVData()->maGDIData.mbPrinterPullModel = true;
ImplGetSVData()->maGDIData.mbNoXORClipping = true;
ImplGetSVData()->maWinData.mbNoSaveBackground = true;
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index 8a4744d1efcd..96569aa80120 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -1547,8 +1547,10 @@ void AquaSalGraphics::SetTextColor( SalColor nSalColor )
// -----------------------------------------------------------------------
-void AquaSalGraphics::GetFontMetric( ImplFontMetricData* pMetric )
+void AquaSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel )
{
+ (void)nFallbackLevel; // glyph-fallback on ATSU is done differently -> no fallback level
+
// get the ATSU font metrics (in point units)
// of the font that has eventually been size-limited
diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx
index 5eccf88dc523..6e206977b5c4 100644
--- a/vcl/aqua/source/gdi/salnativewidgets.cxx
+++ b/vcl/aqua/source/gdi/salnativewidgets.cxx
@@ -379,13 +379,13 @@ BOOL AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n
* aPos was or was not inside the native widget specified by the
* nType/nPart combination.
*/
-BOOL AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+BOOL AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
const Point& rPos, BOOL& rIsInside )
{
if ( nType == CTRL_SCROLLBAR )
{
Rectangle aRect;
- bool bValid = AquaGetScrollRect( /* TODO: m_nScreen */ nPart, rControlRegion.GetBoundRect(), aRect );
+ bool bValid = AquaGetScrollRect( /* TODO: m_nScreen */ nPart, rControlRegion, aRect );
rIsInside = bValid ? aRect.IsInside( rPos ) : FALSE;
if( GetSalData()->mbIsScrollbarDoubleMax )
{
@@ -472,7 +472,7 @@ UInt32 AquaSalGraphics::getTrackState( ControlState nState )
*/
BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const rtl::OUString& aCaption )
@@ -484,7 +484,7 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
CGContextSaveGState( mrContext );
- Rectangle buttonRect = rControlRegion.GetBoundRect();
+ Rectangle buttonRect = rControlRegion;
HIRect rc = ImplGetHIRectFromRectangle(buttonRect);
/** Scrollbar parts code equivalent **
@@ -621,7 +621,7 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
// no animation
aPushInfo.animation.time.start = 0;
aPushInfo.animation.time.current = 0;
- PushButtonValue* pPBVal = (PushButtonValue*)aValue.getOptionalVal();
+ PushButtonValue* pPBVal = aValue.getType() == CTRL_PUSHBUTTON ? (PushButtonValue*)&aValue : NULL;
int nPaintHeight = static_cast<int>(rc.size.height);
if( pPBVal && pPBVal->mbBevelButton )
@@ -790,7 +790,7 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
case CTRL_SLIDER:
{
- SliderValue* pSLVal = (SliderValue*)aValue.getOptionalVal();
+ SliderValue* pSLVal = (SliderValue*)&aValue;
HIThemeTrackDrawInfo aTrackDraw;
aTrackDraw.kind = kThemeSliderMedium;
@@ -820,7 +820,7 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
case CTRL_SCROLLBAR:
{
- ScrollbarValue* pScrollbarVal = (ScrollbarValue *)(aValue.getOptionalVal());
+ ScrollbarValue* pScrollbarVal = (ScrollbarValue *)&aValue;
if( nPart == PART_DRAW_BACKGROUND_VERT ||
nPart == PART_DRAW_BACKGROUND_HORZ )
@@ -962,17 +962,19 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
//first, last or middle tab
aTabItemDrawInfo.position=kHIThemeTabPositionMiddle;
- TabitemValue *aTabValue=(TabitemValue *) aValue.getOptionalVal();
- unsigned int nAlignement=aTabValue->mnAlignment;
+ TabitemValue* pTabValue = (TabitemValue *) &aValue;
+ unsigned int nAlignment = pTabValue->mnAlignment;
//TABITEM_LEFTALIGNED (and TABITEM_RIGHTALIGNED) for the leftmost (or rightmost) tab
//when there are several lines of tabs because there is only one first tab and one
//last tab and TABITEM_FIRST_IN_GROUP (and TABITEM_LAST_IN_GROUP) because when the
//line width is different from window width, there may not be TABITEM_RIGHTALIGNED
- if((nAlignement & TABITEM_LEFTALIGNED)&&(nAlignement & TABITEM_RIGHTALIGNED)) //tab alone
+ if( ( (nAlignment & TABITEM_LEFTALIGNED)&&(nAlignment & TABITEM_RIGHTALIGNED) ) ||
+ ( (nAlignment & TABITEM_FIRST_IN_GROUP)&&(nAlignment & TABITEM_LAST_IN_GROUP) )
+ ) //tab alone
aTabItemDrawInfo.position=kHIThemeTabPositionOnly;
- else if((nAlignement & TABITEM_LEFTALIGNED)||(nAlignement & TABITEM_FIRST_IN_GROUP))
+ else if((nAlignment & TABITEM_LEFTALIGNED)||(nAlignment & TABITEM_FIRST_IN_GROUP))
aTabItemDrawInfo.position=kHIThemeTabPositionFirst;
- else if((nAlignement & TABITEM_RIGHTALIGNED)||(nAlignement & TABITEM_LAST_IN_GROUP))
+ else if((nAlignment & TABITEM_RIGHTALIGNED)||(nAlignment & TABITEM_LAST_IN_GROUP))
aTabItemDrawInfo.position=kHIThemeTabPositionLast;
//support for RTL
@@ -1087,7 +1089,7 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
if(nState & CTRL_STATE_FOCUSED) HIThemeDrawFocusRect(&rc, true, mrContext, kHIThemeOrientationNormal);
//buttons:
- SpinbuttonValue* pSpinButtonVal = (SpinbuttonValue *)(aValue.getOptionalVal());
+ SpinbuttonValue* pSpinButtonVal = (SpinbuttonValue *)&aValue;
ControlState nUpperState = CTRL_STATE_ENABLED;//state of the upper button
ControlState nLowerState = CTRL_STATE_ENABLED;//and of the lower button
if(pSpinButtonVal) {//pSpinButtonVal is sometimes null
@@ -1226,7 +1228,7 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL AquaSalGraphics::drawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+BOOL AquaSalGraphics::drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption )
{
@@ -1247,14 +1249,14 @@ BOOL AquaSalGraphics::drawNativeControlText( ControlType nType, ControlPart nPar
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState,
+BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& aCaption,
- Region &rNativeBoundingRegion, Region &rNativeContentRegion )
+ Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion )
{
BOOL toReturn = FALSE;
- Rectangle aCtrlBoundRect( rControlRegion.GetBoundRect() );
+ Rectangle aCtrlBoundRect( rControlRegion );
short x = aCtrlBoundRect.Left();
short y = aCtrlBoundRect.Top();
short w, h;
@@ -1269,14 +1271,14 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa
{
w = 19; // taken from HIG
h = aCtrlBoundRect.GetHeight();
- rNativeBoundingRegion = rNativeContentRegion = Region( Rectangle( Point( x, y ), Size( w, h ) ) );
+ rNativeBoundingRegion = rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
toReturn = true;
}
else if( nPart == PART_THUMB_VERT )
{
w = aCtrlBoundRect.GetWidth();
h = 18; // taken from HIG
- rNativeBoundingRegion = rNativeContentRegion = Region( Rectangle( Point( x, y ), Size( w, h ) ) );
+ rNativeBoundingRegion = rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) );
toReturn = true;
}
}
diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx
index 8f4b94bf7b18..fa185c32dcda 100644
--- a/vcl/inc/vcl/button.hxx
+++ b/vcl/inc/vcl/button.hxx
@@ -66,6 +66,8 @@ public:
SAL_DLLPRIVATE void ImplSetSymbolAlign( SymbolAlign eAlign );
SAL_DLLPRIVATE SymbolAlign ImplGetSymbolAlign() const;
SAL_DLLPRIVATE void ImplSetSmallSymbol( BOOL bSmall = TRUE );
+ SAL_DLLPRIVATE const Rectangle& ImplGetSymbolRect() const;
+ SAL_DLLPRIVATE void ImplSetSymbolRect(const Rectangle&);
protected:
Button( WindowType nType );
diff --git a/vcl/inc/vcl/edit.hxx b/vcl/inc/vcl/edit.hxx
index a40de9503367..9dc427d83943 100644..100755
--- a/vcl/inc/vcl/edit.hxx
+++ b/vcl/inc/vcl/edit.hxx
@@ -247,6 +247,10 @@ public:
virtual XubString GetSurroundingText() const;
virtual Selection GetSurroundingTextSelection() const;
+
+ // returns the minimum size a bordered Edit should have given the current
+ // global style settings (needed by sc's inputwin.cxx)
+ static Size GetMinimumEditSize();
};
inline ULONG Edit::IsUpdateDataEnabled() const
diff --git a/vcl/inc/vcl/gfxlink.hxx b/vcl/inc/vcl/gfxlink.hxx
index 3b3938ec848b..dced5a19c461 100644
--- a/vcl/inc/vcl/gfxlink.hxx
+++ b/vcl/inc/vcl/gfxlink.hxx
@@ -33,9 +33,6 @@
#include <vcl/mapmod.hxx>
#include <tools/stream.hxx>
-//#if 0 // _SOLAR__PRIVATE
-#include <tools/urlobj.hxx>
-
// -------------
// - ImpBuffer -
// -------------
@@ -62,7 +59,7 @@ struct ImpBuffer
struct ImpSwap
{
- INetURLObject maURL;
+ rtl::OUString maURL;
ULONG mnDataSize;
ULONG mnRefCount;
@@ -71,7 +68,7 @@ struct ImpSwap
BYTE* GetData() const;
- BOOL IsSwapped() const { return maURL.GetMainURL( INetURLObject::NO_DECODE ).getLength() > 0; }
+ BOOL IsSwapped() const { return maURL.getLength() > 0; }
void WriteTo( SvStream& rOStm ) const;
};
diff --git a/vcl/inc/vcl/graphite_adaptors.hxx b/vcl/inc/vcl/graphite_adaptors.hxx
index a6e3d8c3efd1..ae2ff2962adb 100644
--- a/vcl/inc/vcl/graphite_adaptors.hxx
+++ b/vcl/inc/vcl/graphite_adaptors.hxx
@@ -86,8 +86,8 @@ namespace grutils
//
class VCL_DLLPUBLIC GraphiteFontAdaptor : public gr::Font
{
-typedef std::map<const gr::gid16, std::pair<gr::Rect, gr::Point> > GlyphMetricMap;
-
+ typedef std::map<const gr::gid16, std::pair<gr::Rect, gr::Point> > GlyphMetricMap;
+ friend class GrFontHasher;
public:
static bool IsGraphiteEnabledFont(ServerFont &) throw();
diff --git a/vcl/inc/vcl/graphite_cache.hxx b/vcl/inc/vcl/graphite_cache.hxx
index 5472b32dd62f..af1392ed4d4b 100644
--- a/vcl/inc/vcl/graphite_cache.hxx
+++ b/vcl/inc/vcl/graphite_cache.hxx
@@ -105,15 +105,16 @@ typedef std::pair<GraphiteRopeMap::iterator, GraphiteRopeMap::iterator> GrRMEntr
*/
class GraphiteSegmentCache
{
+public:
enum {
// not really sure what good values are here,
// bucket size should be >> cache size
- SEG_BUCKET_SIZE = 4096,
- SEG_CACHE_SIZE = 255
+ SEG_BUCKET_FACTOR = 4,
+ SEG_DEFAULT_CACHE_SIZE = 2047
};
-public:
- GraphiteSegmentCache()
- : m_segMap(SEG_BUCKET_SIZE),
+ GraphiteSegmentCache(sal_uInt32 nSegCacheSize)
+ : m_segMap(nSegCacheSize * SEG_BUCKET_FACTOR),
+ m_nSegCacheSize(nSegCacheSize),
m_oldestKey(NULL) {};
~GraphiteSegmentCache()
{
@@ -224,6 +225,7 @@ public:
private:
GraphiteSegMap m_segMap;
GraphiteRopeMap m_ropeMap;
+ sal_uInt32 m_nSegCacheSize;
const xub_Unicode * m_oldestKey;
const xub_Unicode * m_prevKey;
};
@@ -236,7 +238,24 @@ typedef std::hash_map<int, GraphiteSegmentCache *, std::hash<int> > GraphiteCach
class GraphiteCacheHandler
{
public:
- GraphiteCacheHandler() : m_cacheMap(255) {};
+ GraphiteCacheHandler() : m_cacheMap(255)
+ {
+ const char * pEnvCache = getenv( "SAL_GRAPHITE_CACHE_SIZE" );
+ if (pEnvCache != NULL)
+ {
+ int envCacheSize = atoi(pEnvCache);
+ if (envCacheSize <= 0)
+ m_nSegCacheSize = GraphiteSegmentCache::SEG_DEFAULT_CACHE_SIZE;
+ else
+ {
+ m_nSegCacheSize = envCacheSize;
+ }
+ }
+ else
+ {
+ m_nSegCacheSize = GraphiteSegmentCache::SEG_DEFAULT_CACHE_SIZE;
+ }
+ };
~GraphiteCacheHandler()
{
GraphiteCacheMap::iterator i = m_cacheMap.begin();
@@ -257,12 +276,13 @@ public:
{
return m_cacheMap.find(fontHash)->second;
}
- GraphiteSegmentCache *pCache = new GraphiteSegmentCache();
+ GraphiteSegmentCache *pCache = new GraphiteSegmentCache(m_nSegCacheSize);
m_cacheMap[fontHash] = pCache;
return pCache;
}
private:
GraphiteCacheMap m_cacheMap;
+ sal_uInt32 m_nSegCacheSize;
};
#endif
diff --git a/vcl/inc/vcl/graphite_layout.hxx b/vcl/inc/vcl/graphite_layout.hxx
index eaddd308c05c..cd22abdcdb26 100644
--- a/vcl/inc/vcl/graphite_layout.hxx
+++ b/vcl/inc/vcl/graphite_layout.hxx
@@ -65,6 +65,19 @@ class GraphiteFontAdaptor;
class GrSegRecord;
// SAL/VCL types
class ServerFont;
+
+#ifdef WNT
+// The GraphiteWinFont is just a wrapper to enable GrFontHasher to be a friend
+// so that UniqueCacheInfo can be called.
+#include <graphite/WinFont.h>
+class GraphiteWinFont : public gr::WinFont
+{
+ friend class GrFontHasher;
+public:
+ GraphiteWinFont(HDC hdc) : gr::WinFont(hdc) {};
+ virtual ~GraphiteWinFont() {};
+};
+#endif
// Graphite types
namespace gr { class Segment; class GlyphIterator; }
namespace grutils { class GrFeatureParser; }
@@ -98,7 +111,7 @@ public:
iterator_pair_t neighbour_clusters(const_iterator) const;
private:
std::pair<float,float> appendCluster(gr::Segment & rSeg, ImplLayoutArgs & rArgs,
- bool bRtl, int nFirstCharInCluster, int nNextChar,
+ bool bRtl, float fSegmentAdvance, int nFirstCharInCluster, int nNextChar,
int nFirstGlyphInCluster, int nNextGlyph, float fScaling,
std::vector<int> & rChar2Base, std::vector<int> & rGlyph2Char,
std::vector<int> & rCharDxs, long & rDXOffset);
diff --git a/vcl/inc/vcl/imgcons.hxx b/vcl/inc/vcl/imgcons.hxx
deleted file mode 100644
index 2f582fec15c3..000000000000
--- a/vcl/inc/vcl/imgcons.hxx
+++ /dev/null
@@ -1,105 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _IMGCONS_HXX
-#define _IMGCONS_HXX
-
-#include <vcl/dllapi.h>
-
-#include <vcl/bitmap.hxx>
-
-// -----------------
-// - ImageConsumer -
-// -----------------
-
-class ImageProducer;
-class ImplColorMapper;
-class BitmapEx;
-class Image;
-
-#define IMAGEERROR 1
-#define SINGLEFRAMEDONE 2
-#define STATICIMAGEDONE 3
-#define IMAGEABORTED 4
-
-class VCL_DLLPUBLIC ImageConsumer
-{
-private:
-
- Bitmap maBitmap;
- Bitmap maMask;
- Rectangle maChangedRect;
- Size maSize;
- ImplColorMapper* mpMapper;
- Color* mpPal;
- Link maChgLink;
- Link maDoneLink;
- sal_uInt32 mnFormat;
- sal_uInt32 mnStatus;
- BOOL mbTrans;
-
-protected:
-
- virtual void DataChanged();
-
-public:
-
- ImageConsumer();
- virtual ~ImageConsumer();
-
- BOOL GetData( BitmapEx& rBmpEx ) const;
- BOOL GetData( Image& rImage ) const;
- const Rectangle& GetChangedRect() const { return maChangedRect; }
- sal_uInt32 GetStatus() const;
-
- void SetDataChangedLink( const Link& rLink ) { maChgLink = rLink; }
- const Link& GetDataChangedLink() const { return maChgLink; }
-
- void SetDoneLink( const Link& rLink ) { maDoneLink = rLink; }
- const Link& GetDoneLink() const { return maDoneLink; }
-
-public:
-
- virtual void Init( sal_uInt32 nWidth, sal_uInt32 nHeight );
-
- virtual void SetColorModel( USHORT nBitCount,
- sal_uInt32 nPalEntries, const sal_uInt32* pRGBAPal,
- sal_uInt32 nRMask, sal_uInt32 nGMask, sal_uInt32 nBMask, sal_uInt32 nAMask );
-
- virtual void SetPixelsByBytes( sal_uInt32 nConsX, sal_uInt32 nConsY,
- sal_uInt32 nConsWidth, sal_uInt32 nConsHeight,
- const BYTE* pProducerData, sal_uInt32 nOffset, sal_uInt32 nScanSize );
-
- virtual void SetPixelsByLongs( sal_uInt32 nConsX, sal_uInt32 nConsY,
- sal_uInt32 nConsWidth, sal_uInt32 nConsHeight,
- const sal_uInt32* pProducerData, sal_uInt32 nOffset, sal_uInt32 nScanSize );
-
- virtual void Completed( sal_uInt32 nStatus );
-// virtual void Completed( sal_uInt32 nStatus, ImageProducer& rProducer );
-};
-
-#endif // _IMGCONS_HXX
diff --git a/vcl/inc/vcl/javachild.hxx b/vcl/inc/vcl/javachild.hxx
index 62b447f26571..c5ec3c678900 100644
--- a/vcl/inc/vcl/javachild.hxx
+++ b/vcl/inc/vcl/javachild.hxx
@@ -47,8 +47,6 @@ public:
private:
- SAL_DLLPRIVATE void implTestJavaException( void* pEnv );
-
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE JavaChildWindow (const JavaChildWindow &);
SAL_DLLPRIVATE JavaChildWindow & operator= (const JavaChildWindow &);
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index 9b748f2b5937..f787df3692ce 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -1191,14 +1191,14 @@ public:
// Query the native control to determine if it was acted upon
BOOL HitTestNativeControl( ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
const Point& aPos,
BOOL& rIsInside );
// Request rendering of a particular control and/or part
BOOL DrawNativeControl( ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
::rtl::OUString aCaption );
@@ -1206,7 +1206,7 @@ public:
// Request rendering of a caption string for a control
BOOL DrawNativeControlText( ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
::rtl::OUString aCaption );
@@ -1214,12 +1214,12 @@ public:
// Query the native control's actual drawing region (including adornment)
BOOL GetNativeControlRegion( ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
::rtl::OUString aCaption,
- Region &rNativeBoundingRegion,
- Region &rNativeContentRegion );
+ Rectangle &rNativeBoundingRegion,
+ Rectangle &rNativeContentRegion );
};
diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx
index 96822d9bc756..af83b2db40e1 100644
--- a/vcl/inc/vcl/print.hxx
+++ b/vcl/inc/vcl/print.hxx
@@ -478,6 +478,7 @@ public:
*/
void enableUIOption( const rtl::OUString& rPropName, bool bEnable );
bool isUIOptionEnabled( const rtl::OUString& rPropName ) const;
+ bool isUIChoiceEnabled( const rtl::OUString& rPropName, sal_Int32 nChoice ) const;
/* returns the property name rPropName depends on or an empty string
if no dependency exists.
*/
@@ -649,6 +650,7 @@ class VCL_DLLPUBLIC PrinterOptionsHelper
const com::sun::star::uno::Sequence< rtl::OUString >& i_rChoices,
sal_Int32 i_nValue,
const rtl::OUString& i_rType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Radio" ) ),
+ const com::sun::star::uno::Sequence< sal_Bool >& i_rDisabledChoices = com::sun::star::uno::Sequence< sal_Bool >(),
const UIControlOptions& i_rControlOptions = UIControlOptions()
);
diff --git a/vcl/inc/vcl/salgdi.hxx b/vcl/inc/vcl/salgdi.hxx
index 08c489f7d466..cbe3581bedc4 100644
--- a/vcl/inc/vcl/salgdi.hxx
+++ b/vcl/inc/vcl/salgdi.hxx
@@ -158,17 +158,17 @@ protected:
virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize ) = 0;
// native widget rendering methods that require mirroring
- virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+ virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
const Point& aPos, BOOL& rIsInside );
- virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+ virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+ virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState,
+ virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& aCaption,
- Region &rNativeBoundingRegion, Region &rNativeContentRegion );
+ Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
/** Render bitmap with alpha channel
@@ -233,7 +233,7 @@ public:
// release the fonts
void ReleaseFonts() { SetFont( NULL, 0 ); }
// get the current font's metrics
- virtual void GetFontMetric( ImplFontMetricData* ) = 0;
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel = 0 ) = 0;
// get kernign pairs of the current font
// return only PairCount if (pKernPairs == NULL)
@@ -440,7 +440,7 @@ public:
// Query the native control to determine if it was acted upon
BOOL HitTestNativeControl( ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
const Point& aPos,
BOOL& rIsInside,
const OutputDevice *pOutDev );
@@ -448,7 +448,7 @@ public:
// Request rendering of a particular control and/or part
BOOL DrawNativeControl( ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const rtl::OUString& aCaption,
@@ -457,7 +457,7 @@ public:
// Request rendering of a caption string for a control
BOOL DrawNativeControlText( ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const rtl::OUString& aCaption,
@@ -466,12 +466,12 @@ public:
// Query the native control's actual drawing region (including adornment)
BOOL GetNativeControlRegion( ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const rtl::OUString& aCaption,
- Region &rNativeBoundingRegion,
- Region &rNativeContentRegion,
+ Rectangle &rNativeBoundingRegion,
+ Rectangle &rNativeContentRegion,
const OutputDevice *pOutDev );
static void AddDevFontSubstitute( OutputDevice* pOutDev,
diff --git a/vcl/inc/vcl/salnativewidgets.hxx b/vcl/inc/vcl/salnativewidgets.hxx
index 8e98791d9f78..19c34cbc5e34 100644
--- a/vcl/inc/vcl/salnativewidgets.hxx
+++ b/vcl/inc/vcl/salnativewidgets.hxx
@@ -41,6 +41,9 @@
typedef sal_uInt32 ControlType;
+// for use in general purpose ImplControlValue
+#define CTRL_GENERIC 0
+
// Normal PushButton/Command Button
#define CTRL_PUSHBUTTON 1
@@ -260,13 +263,50 @@ enum ButtonValue {
BUTTONVALUE_MIXED
};
-#ifdef __cplusplus
+/* ImplControlValue:
+ *
+ * Generic value container for all control parts.
+ */
+
+class VCL_DLLPUBLIC ImplControlValue
+{
+ friend class SalFrame;
+
+ private:
+ ControlType mType;
+ ButtonValue mTristate; // Tristate value: on, off, mixed
+ long mNumber; // numeric value
+ protected:
+ ImplControlValue( ControlType i_eType, ButtonValue i_eTriState, long i_nNumber )
+ : mType( i_eType )
+ , mTristate( i_eTriState )
+ , mNumber( i_nNumber )
+ {}
+
+ public:
+ explicit ImplControlValue( ButtonValue nTristate )
+ : mType( CTRL_GENERIC ), mTristate(nTristate), mNumber(0) {}
+ explicit ImplControlValue( long nNumeric )
+ : mType( CTRL_GENERIC ), mTristate(BUTTONVALUE_DONTKNOW), mNumber( nNumeric) {}
+ inline ImplControlValue()
+ : mType( CTRL_GENERIC ), mTristate(BUTTONVALUE_DONTKNOW), mNumber(0) {}
+
+ virtual ~ImplControlValue();
+
+ ControlType getType() const { return mType; }
+
+ inline ButtonValue getTristateVal( void ) const { return mTristate; }
+ inline void setTristateVal( ButtonValue nTristate ) { mTristate = nTristate; }
+
+ inline long getNumericVal( void ) const { return mNumber; }
+ inline void setNumericVal( long nNumeric ) { mNumber = nNumeric; }
+};
/* ScrollbarValue:
*
* Value container for scrollbars.
*/
-class VCL_DLLPUBLIC ScrollbarValue
+ class VCL_DLLPUBLIC ScrollbarValue : public ImplControlValue
{
public:
long mnMin;
@@ -283,15 +323,16 @@ class VCL_DLLPUBLIC ScrollbarValue
ControlState mnPage2State;
inline ScrollbarValue()
- {
- mnMin = 0; mnMax = 0; mnCur = 0; mnVisibleSize = 0;
- mnButton1State = 0; mnButton2State = 0;
- mnThumbState = 0; mnPage1State = 0; mnPage2State = 0;
- };
- inline ~ScrollbarValue() {};
+ : ImplControlValue( CTRL_SCROLLBAR, BUTTONVALUE_DONTKNOW, 0 )
+ {
+ mnMin = 0; mnMax = 0; mnCur = 0; mnVisibleSize = 0;
+ mnButton1State = 0; mnButton2State = 0;
+ mnThumbState = 0; mnPage1State = 0; mnPage2State = 0;
+ };
+ virtual ~ScrollbarValue();
};
-class VCL_DLLPUBLIC SliderValue
+class VCL_DLLPUBLIC SliderValue : public ImplControlValue
{
public:
long mnMin;
@@ -300,9 +341,11 @@ class VCL_DLLPUBLIC SliderValue
Rectangle maThumbRect;
ControlState mnThumbState;
- SliderValue() : mnMin( 0 ), mnMax( 0 ), mnCur( 0 ), mnThumbState( 0 )
+ SliderValue()
+ : ImplControlValue( CTRL_SLIDER, BUTTONVALUE_DONTKNOW, 0 )
+ , mnMin( 0 ), mnMax( 0 ), mnCur( 0 ), mnThumbState( 0 )
{}
- ~SliderValue() {}
+ virtual ~SliderValue();
};
/* TabitemValue:
@@ -317,23 +360,24 @@ class VCL_DLLPUBLIC SliderValue
#define TABITEM_FIRST_IN_GROUP 0x004 // the tabitem is the first in group of tabitems
#define TABITEM_LAST_IN_GROUP 0x008 // the tabitem is the last in group of tabitems
-class VCL_DLLPUBLIC TabitemValue
+class VCL_DLLPUBLIC TabitemValue : public ImplControlValue
{
public:
unsigned int mnAlignment;
inline TabitemValue()
- {
- mnAlignment = 0;
- };
- inline ~TabitemValue() {};
-
- BOOL isLeftAligned() { return (mnAlignment & TABITEM_LEFTALIGNED) != 0; }
- BOOL isRightAligned() { return (mnAlignment & TABITEM_RIGHTALIGNED) != 0; }
- BOOL isBothAligned() { return isLeftAligned() && isRightAligned(); }
- BOOL isNotAligned() { return (mnAlignment & (TABITEM_LEFTALIGNED | TABITEM_RIGHTALIGNED)) == 0; }
- BOOL isFirst() { return (mnAlignment & TABITEM_FIRST_IN_GROUP) != 0; }
- BOOL isLast() { return (mnAlignment & TABITEM_LAST_IN_GROUP) != 0; }
+ : ImplControlValue( CTRL_TAB_ITEM, BUTTONVALUE_DONTKNOW, 0 )
+ {
+ mnAlignment = 0;
+ };
+ virtual ~TabitemValue();
+
+ BOOL isLeftAligned() const { return (mnAlignment & TABITEM_LEFTALIGNED) != 0; }
+ BOOL isRightAligned() const { return (mnAlignment & TABITEM_RIGHTALIGNED) != 0; }
+ BOOL isBothAligned() const { return isLeftAligned() && isRightAligned(); }
+ BOOL isNotAligned() const { return (mnAlignment & (TABITEM_LEFTALIGNED | TABITEM_RIGHTALIGNED)) == 0; }
+ BOOL isFirst() const { return (mnAlignment & TABITEM_FIRST_IN_GROUP) != 0; }
+ BOOL isLast() const { return (mnAlignment & TABITEM_LAST_IN_GROUP) != 0; }
};
/* SpinbuttonValue:
@@ -342,7 +386,7 @@ class VCL_DLLPUBLIC TabitemValue
* Note: the other parameters of DrawNativeControl will have no meaning
* all parameters for spinbuttons are carried here
*/
-class VCL_DLLPUBLIC SpinbuttonValue
+class VCL_DLLPUBLIC SpinbuttonValue : public ImplControlValue
{
public:
Rectangle maUpperRect;
@@ -353,20 +397,23 @@ class VCL_DLLPUBLIC SpinbuttonValue
int mnLowerPart;
inline SpinbuttonValue()
- {
- mnUpperState = mnLowerState = 0;
- };
- inline ~SpinbuttonValue() {};
+ : ImplControlValue( CTRL_SPINBUTTONS, BUTTONVALUE_DONTKNOW, 0 )
+ {
+ mnUpperState = mnLowerState = 0;
+ };
+ virtual ~SpinbuttonValue();
};
/* Toolbarvalue:
*
* Value container for toolbars detailing the grip position
*/
-class ToolbarValue
+class ToolbarValue : public ImplControlValue
{
public:
- ToolbarValue() { mbIsTopDockingArea = FALSE; }
+ ToolbarValue() : ImplControlValue( CTRL_TOOLBAR, BUTTONVALUE_DONTKNOW, 0 )
+ { mbIsTopDockingArea = FALSE; }
+ virtual ~ToolbarValue();
Rectangle maGripRect;
BOOL mbIsTopDockingArea; // indicates that this is the top aligned dockingarea
// adjacent to the menubar
@@ -376,10 +423,12 @@ public:
*
* Value container for menubars specifying height of adjacent docking area
*/
-class MenubarValue
+class MenubarValue : public ImplControlValue
{
public:
- MenubarValue() { maTopDockingAreaHeight=0; }
+ MenubarValue() : ImplControlValue( CTRL_MENUBAR, BUTTONVALUE_DONTKNOW, 0 )
+ { maTopDockingAreaHeight=0; }
+ virtual ~MenubarValue();
int maTopDockingAreaHeight;
};
@@ -387,61 +436,18 @@ public:
*
* Value container for pushbuttons specifying additional drawing hints
*/
-class PushButtonValue
+class PushButtonValue : public ImplControlValue
{
public:
-PushButtonValue() : mbBevelButton( false ), mbSingleLine( true ) {}
+ PushButtonValue()
+ : ImplControlValue( CTRL_PUSHBUTTON, BUTTONVALUE_DONTKNOW, 0 )
+ , mbBevelButton( false ), mbSingleLine( true ) {}
+ virtual ~PushButtonValue();
+
bool mbBevelButton:1;
bool mbSingleLine:1;
};
-/* ImplControlValue:
- *
- * Generic value container for all control parts.
- */
-
-class ImplControlValue
-{
- friend class SalFrame;
-
- private:
- ButtonValue mTristate; // Tristate value: on, off, mixed
- rtl::OUString mString; // string value
- long mNumber; // numeric value
- void * mOptionalVal; // optional control-specific value
-
- public:
- inline ImplControlValue( ButtonValue nTristate, rtl::OUString sString, long nNumeric, void * aOptVal ) \
- { mTristate = nTristate; mString = sString; mNumber = nNumeric; mOptionalVal = aOptVal; };
- inline ImplControlValue( ButtonValue nTristate, rtl::OUString sString, long nNumeric ) \
- { mTristate = nTristate; mString = sString; mNumber = nNumeric; mOptionalVal = NULL; };
- explicit ImplControlValue( ButtonValue nTristate )
- : mTristate(nTristate), mNumber(0), mOptionalVal(NULL) {}
- explicit ImplControlValue( rtl::OUString& rString )
- : mTristate(BUTTONVALUE_DONTKNOW), mString(rString), mNumber(0), mOptionalVal(NULL) {}
- explicit ImplControlValue( long nNumeric )
- : mTristate(BUTTONVALUE_DONTKNOW), mNumber( nNumeric), mOptionalVal(NULL) {}
- explicit ImplControlValue( void* aOptVal )
- : mTristate(BUTTONVALUE_DONTKNOW), mNumber(0), mOptionalVal(aOptVal) {}
- inline ImplControlValue()
- : mTristate(BUTTONVALUE_DONTKNOW), mNumber(0), mOptionalVal(NULL) {}
-
- inline ~ImplControlValue() { mOptionalVal = NULL; };
-
- inline ButtonValue getTristateVal( void ) const { return mTristate; }
- inline void setTristateVal( ButtonValue nTristate ) { mTristate = nTristate; }
-
- inline const rtl::OUString& getStringVal( void ) const { return mString; }
- inline void setStringVal( rtl::OUString sString ) { mString = sString; }
-
- inline long getNumericVal( void ) const { return mNumber; }
- inline void setNumericVal( long nNumeric ) { mNumber = nNumeric; }
-
- inline void * getOptionalVal( void ) const { return mOptionalVal; }
- inline void setOptionalVal( void * aOptVal ) { mOptionalVal = aOptVal; }
-};
-
-#endif /* __cplusplus */
#endif
diff --git a/vcl/inc/vcl/svdata.hxx b/vcl/inc/vcl/svdata.hxx
index 5cc8f32d7ac9..fe69b0c0b4d4 100644
--- a/vcl/inc/vcl/svdata.hxx
+++ b/vcl/inc/vcl/svdata.hxx
@@ -318,6 +318,9 @@ struct ImplSVNWFData
// window background before drawing the native
// checkbox
bool mbScrollbarJumpPage; // true for "jump to here" behavior
+ int mnStatusBarLowerRightOffset; // amount in pixel to avoid in the lower righthand corner
+ // used on the Mac where the system resizer paints over
+ // our window content
};
diff --git a/vcl/inc/vcl/syschild.hxx b/vcl/inc/vcl/syschild.hxx
index da4ffcd51a22..e914adbdffed 100644
--- a/vcl/inc/vcl/syschild.hxx
+++ b/vcl/inc/vcl/syschild.hxx
@@ -44,6 +44,7 @@ class VCL_DLLPUBLIC SystemChildWindow : public Window
private:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, BOOL bShow = FALSE );
+ SAL_DLLPRIVATE void ImplTestJavaException( void* pEnv );
// Copy assignment is forbidden and not implemented.
SAL_DLLPRIVATE SystemChildWindow (const SystemChildWindow &);
@@ -62,6 +63,11 @@ public:
// however, this might not always be required
void EnableEraseBackground( BOOL bEnable = TRUE );
BOOL IsEraseBackgroundEnabled();
+
+ // return the platform specific handle/id of this window;
+ // in case the flag bUseJava is set, a java compatible overlay window
+ // is created on which other java windows can be created (plugin interface)
+ sal_IntPtr GetParentWindowHandle( sal_Bool bUseJava = sal_False );
};
#endif // _SV_SYSCHILD_HXX
diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst
index 8345b155ce58..38c025b5a5af 100644
--- a/vcl/prj/d.lst
+++ b/vcl/prj/d.lst
@@ -56,7 +56,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\help.hxx %_DEST%\inc%_EXT%\vcl\help.hxx
..\inc\vcl\image.hxx %_DEST%\inc%_EXT%\vcl\image.hxx
..\inc\vcl\imagerepository.hxx %_DEST%\inc%_EXT%\vcl\imagerepository.hxx
-..\inc\vcl\imgcons.hxx %_DEST%\inc%_EXT%\vcl\imgcons.hxx
..\inc\vcl\imgctrl.hxx %_DEST%\inc%_EXT%\vcl\imgctrl.hxx
..\inc\vcl\impdel.hxx %_DEST%\inc%_EXT%\vcl\impdel.hxx
..\inc\vcl\inputctx.hxx %_DEST%\inc%_EXT%\vcl\inputctx.hxx
@@ -153,4 +152,4 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\ppdparser.hxx %_DEST%\inc%_EXT%\vcl\ppdparser.hxx
..\inc\vcl\helper.hxx %_DEST%\inc%_EXT%\vcl\helper.hxx
..\inc\vcl\strhelper.hxx %_DEST%\inc%_EXT%\vcl\strhelper.hxx
-..\inc\vcl\lazydelete.hxx %_DEST%\inc%_EXT%\vcl\lazydelete.hxx \ No newline at end of file
+..\inc\vcl\lazydelete.hxx %_DEST%\inc%_EXT%\vcl\lazydelete.hxx
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index ac1da931ba06..1f9efa7b6e65 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -444,7 +444,7 @@ void HelpTextWindow::Paint( const Rectangle& )
if ( IsNativeControlSupported( CTRL_TOOLTIP, PART_ENTIRE_CONTROL ) )
{
// #i46472# workaround gcc3.3 temporary problem
- Region aCtrlRegion = Region( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
+ Rectangle aCtrlRegion( Point( 0, 0 ), GetOutputSizePixel() );
ImplControlValue aControlValue;
bNativeOK = DrawNativeControl( CTRL_TOOLTIP, PART_ENTIRE_CONTROL, aCtrlRegion,
0, aControlValue, rtl::OUString() );
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index d66389eee62d..d4f29e224e7b 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -83,6 +83,7 @@ class ImplCommonButtonData
{
public:
Rectangle maFocusRect;
+ Rectangle maSymbolRect;
USHORT mnButtonState;
BOOL mbSmallSymbol;
@@ -334,6 +335,18 @@ const Rectangle& Button::GetFocusRect() const
// -----------------------------------------------------------------------
+const Rectangle& Button::ImplGetSymbolRect() const
+{
+ return mpButtonData->maSymbolRect;
+}
+
+void Button::ImplSetSymbolRect( const Rectangle& i_rRect )
+{
+ mpButtonData->maSymbolRect = i_rRect;
+}
+
+// -----------------------------------------------------------------------
+
USHORT Button::ImplGetTextStyle( XubString& rText, WinBits nWinStyle,
ULONG nDrawFlags )
{
@@ -1176,6 +1189,9 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags
Size aSize = rRect.GetSize();
Point aPos = rRect.TopLeft();
+ ULONG nImageSep = 1 + (pDev->GetTextHeight()-10)/2;
+ if( nImageSep < 1 )
+ nImageSep = 1;
if ( mnDDStyle == PUSHBUTTON_DROPDOWN_MENUBUTTON )
{
if ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) )
@@ -1186,8 +1202,8 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags
aInRect.Left() = aInRect.Right() - nSymbolSize;
aSize.Width() -= ( 5 + nSymbolSize );
- ImplDrawAlignedImage( pDev, aPos, aSize, bLayout,
- 1, nDrawFlags, nTextStyle, NULL, (GetStyle() & WB_FLATBUTTON) != 0 );
+ ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, nImageSep,
+ nDrawFlags, nTextStyle, NULL, (GetStyle() & WB_FLATBUTTON) != 0 );
}
else
ImplCalcSymbolRect( aInRect );
@@ -1195,15 +1211,19 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags
if( ! bLayout )
{
DecorationView aDecoView( pDev );
+ long nDistance = (aInRect.GetHeight() > 10) ? 2 : 1;
+ long nX = aInRect.Left() - 2*nDistance;;
+ Point aStartPt( nX, aInRect.Top()+nDistance );
+ Point aEndPt( nX, aInRect.Bottom()-nDistance );
+ aDecoView.DrawSeparator( aStartPt, aEndPt );
aDecoView.DrawSymbol( aInRect, SYMBOL_SPIN_DOWN, aColor, nStyle );
+ aInRect.Left() -= 2*nDistance;
+ ImplSetSymbolRect( aInRect );
}
}
else
{
Rectangle aSymbolRect;
- ULONG nImageSep = 1 + (pDev->GetTextHeight()-10)/2;
- if( nImageSep < 1 )
- nImageSep = 1;
// FIXME: (GetStyle() & WB_FLATBUTTON) != 0 is preliminary
// in the next major this should be replaced by "true"
ImplDrawAlignedImage( pDev, aPos, aSize, bLayout, nImageSep, nDrawFlags,
@@ -1213,6 +1233,7 @@ void PushButton::ImplDrawPushButtonContent( OutputDevice* pDev, ULONG nDrawFlags
{
DecorationView aDecoView( pDev );
aDecoView.DrawSymbol( aSymbolRect, meSymbol, aColor, nStyle );
+ ImplSetSymbolRect( aSymbolRect );
}
if ( mnDDStyle == PUSHBUTTON_DROPDOWN_TOOLBOX && !bLayout )
@@ -1314,7 +1335,6 @@ void PushButton::ImplDrawPushButton( bool bLayout )
// for CTRL_LISTBOX/PART_BUTTON_DOWN and CTRL_COMBOBOX/PART_BUTTON_DOWN
ImplControlValue aControlValue;
- Region aCtrlRegion( aInRect );
ControlState nState = 0;
if ( mbPressed ) nState |= CTRL_STATE_PRESSED;
@@ -1326,7 +1346,7 @@ void PushButton::ImplDrawPushButton( bool bLayout )
if ( IsMouseOver() && aInRect.IsInside( GetPointerPosPixel() ) )
nState |= CTRL_STATE_ROLLOVER;
- bNativeOK = DrawNativeControl( aCtrlType, PART_BUTTON_DOWN, aCtrlRegion, nState,
+ bNativeOK = DrawNativeControl( aCtrlType, PART_BUTTON_DOWN, aInRect, nState,
aControlValue, rtl::OUString() );
}
}
@@ -1338,10 +1358,8 @@ void PushButton::ImplDrawPushButton( bool bLayout )
bool bRollOver = (IsMouseOver() && aInRect.IsInside( GetPointerPosPixel() ));
if ( (bNativeOK=IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == TRUE )
{
- PushButtonValue aPBVal;
- ImplControlValue aControlValue;
- aControlValue.setOptionalVal( &aPBVal );
- Region aCtrlRegion( aInRect );
+ PushButtonValue aControlValue;
+ Rectangle aCtrlRegion( aInRect );
ControlState nState = 0;
if ( mbPressed || IsChecked() ) nState |= CTRL_STATE_PRESSED;
@@ -1354,7 +1372,7 @@ void PushButton::ImplDrawPushButton( bool bLayout )
nState |= CTRL_STATE_ROLLOVER;
if( GetStyle() & WB_BEVELBUTTON )
- aPBVal.mbBevelButton = true;
+ aControlValue.mbBevelButton = true;
// draw frame into invisible window to have aInRect modified correctly
// but do not shift the inner rect for pressed buttons (ie remove BUTTON_DRAW_PRESSED)
@@ -1373,7 +1391,7 @@ void PushButton::ImplDrawPushButton( bool bLayout )
Size aFontSize( Application::GetSettings().GetStyleSettings().GetPushButtonFont().GetSize() );
aFontSize = LogicToPixel( aFontSize, MapMode( MAP_POINT ) );
Size aInRectSize( LogicToPixel( Size( aInRect.GetWidth(), aInRect.GetHeight() ) ) );
- aPBVal.mbSingleLine = (aInRectSize.Height() < 2 * aFontSize.Height() );
+ aControlValue.mbSingleLine = (aInRectSize.Height() < 2 * aFontSize.Height() );
if( ((nState & CTRL_STATE_ROLLOVER)) || ! (GetStyle() & WB_FLATBUTTON) )
{
@@ -1434,22 +1452,19 @@ void PushButton::ImplSetDefButton( BOOL bSet )
if ( (IsNativeControlSupported(CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL)) == TRUE )
{
- Region aBoundingRgn, aContentRgn;
+ Rectangle aBound, aCont;
Rectangle aCtrlRect( 0, 0, 80, 20 ); // use a constant size to avoid accumulating
// will not work if the theme has dynamic adornment sizes
ImplControlValue aControlValue;
- Region aCtrlRegion( aCtrlRect );
+ Rectangle aCtrlRegion( aCtrlRect );
ControlState nState = CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED;
// get native size of a 'default' button
// and adjust the VCL button if more space for adornment is required
if( GetNativeControlRegion( CTRL_PUSHBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion,
nState, aControlValue, rtl::OUString(),
- aBoundingRgn, aContentRgn ) )
+ aBound, aCont ) )
{
- Rectangle aCont(aContentRgn.GetBoundRect());
- Rectangle aBound(aBoundingRgn.GetBoundRect());
-
dLeft = aCont.Left() - aBound.Left();
dTop = aCont.Top() - aBound.Top();
dRight = aBound.Right() - aCont.Right();
@@ -2004,6 +2019,8 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const
aSize = Size( 16, 12 );
else
aSize = Size( 26, 24 );
+ if( mnDDStyle == PUSHBUTTON_DROPDOWN_MENUBUTTON )
+ aSize.Width() += 4;
}
else if ( IsImage() && ! (ImplGetButtonState() & BUTTON_DRAW_NOIMAGE) )
aSize = GetModeImage().GetSizePixel();
@@ -2334,9 +2351,8 @@ void RadioButton::ImplDrawRadioButtonState()
// no native drawing for image radio buttons
if ( !maImage && (bNativeOK=IsNativeControlSupported(CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL)) == TRUE )
{
- ImplControlValue aControlValue( mbChecked ? BUTTONVALUE_ON : BUTTONVALUE_OFF, rtl::OUString(), 0 );
+ ImplControlValue aControlValue( mbChecked ? BUTTONVALUE_ON : BUTTONVALUE_OFF );
Rectangle aCtrlRect( maStateRect.TopLeft(), maStateRect.GetSize() );
- Region aCtrlRegion( aCtrlRect );
ControlState nState = 0;
if ( ImplGetButtonState() & BUTTON_DRAW_PRESSED ) nState |= CTRL_STATE_PRESSED;
@@ -2347,7 +2363,7 @@ void RadioButton::ImplDrawRadioButtonState()
if ( IsMouseOver() && maMouseRect.IsInside( GetPointerPosPixel() ) )
nState |= CTRL_STATE_ROLLOVER;
- bNativeOK = DrawNativeControl( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion, nState,
+ bNativeOK = DrawNativeControl( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRect, nState,
aControlValue,rtl::OUString() );
}
@@ -3198,17 +3214,16 @@ Size RadioButton::ImplGetRadioImageSize() const
{
ImplControlValue aControlValue;
// #i45896# workaround gcc3.3 temporary problem
- Region aCtrlRegion = Region( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
+ Rectangle aCtrlRegion( Point( 0, 0 ), GetSizePixel() );
ControlState nState = CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED;
- Region aBoundingRgn, aContentRgn;
+ Rectangle aBoundingRgn, aContentRgn;
// get native size of a radio button
if( pThis->GetNativeControlRegion( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion,
nState, aControlValue, rtl::OUString(),
aBoundingRgn, aContentRgn ) )
{
- Rectangle aCont(aContentRgn.GetBoundRect());
- aSize = aCont.GetSize();
+ aSize = aContentRgn.GetSize();
bDefaultSize = false;
}
}
@@ -3323,16 +3338,15 @@ void RadioButton::ImplSetMinimumNWFSize()
ImplControlValue aControlValue;
Size aCurSize( GetSizePixel() );
- Region aCtrlRegion = Region( Rectangle( Point( 0, 0 ), aCurSize ) );
- Region aBoundingRgn, aContentRgn;
+ Rectangle aCtrlRegion( Point( 0, 0 ), aCurSize );
+ Rectangle aBoundingRgn, aContentRgn;
// get native size of a radiobutton
if( GetNativeControlRegion( CTRL_RADIOBUTTON, PART_ENTIRE_CONTROL, aCtrlRegion,
CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED, aControlValue, rtl::OUString(),
aBoundingRgn, aContentRgn ) )
{
- Rectangle aCont(aContentRgn.GetBoundRect());
- Size aSize = aCont.GetSize();
+ Size aSize = aContentRgn.GetSize();
if( aSize.Height() > aCurSize.Height() )
{
@@ -3509,8 +3523,8 @@ void CheckBox::ImplDrawCheckBoxState()
if ( (bNativeOK=IsNativeControlSupported(CTRL_CHECKBOX, PART_ENTIRE_CONTROL)) == TRUE )
{
- ImplControlValue aControlValue( meState == STATE_CHECK ? BUTTONVALUE_ON : BUTTONVALUE_OFF, rtl::OUString(), 0 );
- Region aCtrlRegion( maStateRect );
+ ImplControlValue aControlValue( meState == STATE_CHECK ? BUTTONVALUE_ON : BUTTONVALUE_OFF );
+ Rectangle aCtrlRegion( maStateRect );
ControlState nState = 0;
if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED;
@@ -4144,17 +4158,16 @@ Size CheckBox::ImplGetCheckImageSize() const
{
ImplControlValue aControlValue;
// #i45896# workaround gcc3.3 temporary problem
- Region aCtrlRegion = Region( Rectangle( Point( 0, 0 ), GetSizePixel() ) );
+ Rectangle aCtrlRegion( Point( 0, 0 ), GetSizePixel() );
ControlState nState = CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED;
- Region aBoundingRgn, aContentRgn;
+ Rectangle aBoundingRgn, aContentRgn;
// get native size of a check box
if( pThis->GetNativeControlRegion( CTRL_CHECKBOX, PART_ENTIRE_CONTROL, aCtrlRegion,
nState, aControlValue, rtl::OUString(),
aBoundingRgn, aContentRgn ) )
{
- Rectangle aCont(aContentRgn.GetBoundRect());
- aSize = aCont.GetSize();
+ aSize = aContentRgn.GetSize();
bDefaultSize = false;
}
}
@@ -4234,16 +4247,15 @@ void CheckBox::ImplSetMinimumNWFSize()
ImplControlValue aControlValue;
Size aCurSize( GetSizePixel() );
- Region aCtrlRegion = Region( Rectangle( Point( 0, 0 ), aCurSize ) );
- Region aBoundingRgn, aContentRgn;
+ Rectangle aCtrlRegion( Point( 0, 0 ), aCurSize );
+ Rectangle aBoundingRgn, aContentRgn;
// get native size of a radiobutton
if( GetNativeControlRegion( CTRL_CHECKBOX, PART_ENTIRE_CONTROL, aCtrlRegion,
CTRL_STATE_DEFAULT|CTRL_STATE_ENABLED, aControlValue, rtl::OUString(),
aBoundingRgn, aContentRgn ) )
{
- Rectangle aCont(aContentRgn.GetBoundRect());
- Size aSize = aCont.GetSize();
+ Size aSize = aContentRgn.GetSize();
if( aSize.Height() > aCurSize.Height() )
{
@@ -4444,8 +4456,8 @@ void DisclosureButton::ImplDrawCheckBoxState()
Rectangle aStateRect( GetStateRect() );
- ImplControlValue aControlValue( GetState() == STATE_CHECK ? BUTTONVALUE_ON : BUTTONVALUE_OFF, rtl::OUString(), 0 );
- Region aCtrlRegion( aStateRect );
+ ImplControlValue aControlValue( GetState() == STATE_CHECK ? BUTTONVALUE_ON : BUTTONVALUE_OFF );
+ Rectangle aCtrlRegion( aStateRect );
ControlState nState = 0;
if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED;
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index f5c04b7c3cfa..8efa3404a44a 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -139,8 +139,8 @@ void ComboBox::ImplCalcEditHeight()
if ( !IsDropDownBox() )
mnDDHeight += 4;
- Region aCtrlRegion( Rectangle( (const Point&)Point(), Size( 10, 10 ) ) );
- Region aBoundRegion, aContentRegion;
+ Rectangle aCtrlRegion( Point( 0, 0 ), Size( 10, 10 ) );
+ Rectangle aBoundRegion, aContentRegion;
ImplControlValue aControlValue;
ControlType aType = IsDropDownBox() ? CTRL_COMBOBOX : CTRL_EDITBOX;
if( GetNativeControlRegion( aType, PART_ENTIRE_CONTROL,
@@ -149,7 +149,7 @@ void ComboBox::ImplCalcEditHeight()
aControlValue, rtl::OUString(),
aBoundRegion, aContentRegion ) )
{
- const long nNCHeight = aBoundRegion.GetBoundRect().GetHeight();
+ const long nNCHeight = aBoundRegion.GetHeight();
if( mnDDHeight < nNCHeight )
mnDDHeight = sal::static_int_cast<USHORT>( nNCHeight );
}
@@ -629,10 +629,10 @@ void ComboBox::Resize()
Window *pBorder = GetWindow( WINDOW_BORDER );
ImplControlValue aControlValue;
Point aPoint;
- Region aContent, aBound;
+ Rectangle aContent, aBound;
// use the full extent of the control
- Region aArea( Rectangle(aPoint, pBorder->GetOutputSizePixel()) );
+ Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );
if ( GetNativeControlRegion(CTRL_COMBOBOX, PART_BUTTON_DOWN,
aArea, 0, aControlValue, rtl::OUString(), aBound, aContent) )
@@ -641,7 +641,7 @@ void ComboBox::Resize()
aPoint = pBorder->ScreenToOutputPixel( OutputToScreenPixel( aPoint ) );
aContent.Move(-aPoint.X(), -aPoint.Y());
- mpBtn->SetPosSizePixel( aContent.GetBoundRect().Left(), nTop, aContent.GetBoundRect().getWidth(), (nBottom-nTop) );
+ mpBtn->SetPosSizePixel( aContent.Left(), nTop, aContent.getWidth(), (nBottom-nTop) );
// adjust the size of the edit field
if ( GetNativeControlRegion(CTRL_COMBOBOX, PART_SUB_EDIT,
@@ -651,13 +651,12 @@ void ComboBox::Resize()
aContent.Move(-aPoint.X(), -aPoint.Y());
// use the themes drop down size
- Rectangle aContentRect = aContent.GetBoundRect();
- mpSubEdit->SetPosSizePixel( aContentRect.TopLeft(), aContentRect.GetSize() );
+ mpSubEdit->SetPosSizePixel( aContent.TopLeft(), aContent.GetSize() );
}
else
{
// use the themes drop down size for the button
- aOutSz.Width() -= aContent.GetBoundRect().getWidth();
+ aOutSz.Width() -= aContent.getWidth();
mpSubEdit->SetSizePixel( aOutSz );
}
}
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 0a29a627b8e3..786b190069c4 100644..100755
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2842,7 +2842,7 @@ Size Edit::CalcMinimumSize() const
Size aMinSize ( CalcSize( 3 ) );
if( aSize.Width() < aMinSize.Width() )
aSize.Width() = aMinSize.Width();
- // add some space between text entry an border
+ // add some space between text entry and border
aSize.Height() += 4;
aSize = CalcWindowSize( aSize );
@@ -2850,18 +2850,25 @@ Size Edit::CalcMinimumSize() const
// ask NWF what if it has an opinion, too
ImplControlValue aControlValue;
Rectangle aRect( Point( 0, 0 ), aSize );
- Region aContent, aBound;
+ Rectangle aContent, aBound;
if( const_cast<Edit*>(this)->GetNativeControlRegion(
CTRL_EDITBOX, PART_ENTIRE_CONTROL,
aRect, 0, aControlValue, rtl::OUString(), aBound, aContent) )
{
- Rectangle aBoundRect( aContent.GetBoundRect() );
- if( aBoundRect.GetHeight() > aSize.Height() )
- aSize.Height() = aBoundRect.GetHeight();
+ if( aBound.GetHeight() > aSize.Height() )
+ aSize.Height() = aBound.GetHeight();
}
return aSize;
}
+Size Edit::GetMinimumEditSize()
+{
+ Window* pDefWin = ImplGetDefaultWindow();
+ Edit aEdit( pDefWin, WB_BORDER );
+ Size aSize( aEdit.CalcMinimumSize() );
+ return aSize;
+}
+
// -----------------------------------------------------------------------
Size Edit::GetOptimalSize(WindowSizeType eType) const
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 090aa2a84163..6c2b06783984 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -224,6 +224,42 @@ static BOOL ImplNumericGetValue( const XubString& rStr, double& rValue,
return TRUE;
}
+static void ImplUpdateSeparatorString( String& io_rText,
+ const String& rOldDecSep, const String& rNewDecSep,
+ const String& rOldThSep, const String& rNewThSep )
+{
+ rtl::OUStringBuffer aBuf( io_rText.Len() );
+ xub_StrLen nIndexDec = 0, nIndexTh = 0, nIndex = 0;
+
+ const sal_Unicode* pBuffer = io_rText.GetBuffer();
+ while( nIndex != STRING_NOTFOUND )
+ {
+ nIndexDec = io_rText.Search( rOldDecSep, nIndex );
+ nIndexTh = io_rText.Search( rOldThSep, nIndex );
+ if( (nIndexTh != STRING_NOTFOUND && nIndexDec != STRING_NOTFOUND && nIndexTh < nIndexDec )
+ || (nIndexTh != STRING_NOTFOUND && nIndexDec == STRING_NOTFOUND)
+ )
+ {
+ aBuf.append( pBuffer + nIndex, nIndexTh - nIndex );
+ aBuf.append( rNewThSep );
+ nIndex = nIndexTh + rOldThSep.Len();
+ }
+ else if( nIndexDec != STRING_NOTFOUND )
+ {
+ aBuf.append( pBuffer + nIndex, nIndexDec - nIndex );
+ aBuf.append( rNewDecSep );
+ nIndex = nIndexDec + rOldDecSep.Len();
+ }
+ else
+ {
+ aBuf.append( pBuffer + nIndex );
+ nIndex = STRING_NOTFOUND;
+ }
+ }
+
+ io_rText = aBuf.makeStringAndClear();
+}
+
static void ImplUpdateSeparators( const String& rOldDecSep, const String& rNewDecSep,
const String& rOldThSep, const String& rNewThSep,
Edit* pEdit )
@@ -236,10 +272,7 @@ static void ImplUpdateSeparators( const String& rOldDecSep, const String& rNewDe
BOOL bUpdateMode = pEdit->IsUpdateMode();
pEdit->SetUpdateMode( FALSE );
String aText = pEdit->GetText();
- if( bChangeDec )
- aText.SearchAndReplaceAll( rNewDecSep, rOldDecSep );
- if( bChangeTh )
- aText.SearchAndReplaceAll( rNewThSep, rOldThSep );
+ ImplUpdateSeparatorString( aText, rOldDecSep, rNewDecSep, rOldThSep, rNewThSep );
pEdit->SetText( aText );
ComboBox* pCombo = dynamic_cast<ComboBox*>(pEdit);
@@ -250,12 +283,11 @@ static void ImplUpdateSeparators( const String& rOldDecSep, const String& rNewDe
for ( USHORT i=0; i < nEntryCount; i++ )
{
aText = pCombo->GetEntry( i );
- if( bChangeDec )
- aText.SearchAndReplaceAll( rNewDecSep, rOldDecSep );
- if( bChangeTh )
- aText.SearchAndReplaceAll( rNewThSep, rOldThSep );
+ void* pEntryData = pCombo->GetEntryData( i );
+ ImplUpdateSeparatorString( aText, rOldDecSep, rNewDecSep, rOldThSep, rNewThSep );
pCombo->RemoveEntry( i );
pCombo->InsertEntry( aText, i );
+ pCombo->SetEntryData( i, pEntryData );
}
}
if( bUpdateMode )
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index ebccfdc1e6bb..02c8d2b5fcb3 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -2819,7 +2819,7 @@ void ImplWin::ImplDraw( bool bLayout )
sal_Int32 nLeft, nTop, nRight, nBottom;
pWin->GetBorder( nLeft, nTop, nRight, nBottom );
Point aPoint( -nLeft, -nTop );
- Region aCtrlRegion( Rectangle( aPoint - GetPosPixel(), pWin->GetSizePixel() ) );
+ Rectangle aCtrlRegion( aPoint - GetPosPixel(), pWin->GetSizePixel() );
BOOL bMouseOver = FALSE;
if( GetParent() )
@@ -2838,8 +2838,7 @@ void ImplWin::ImplDraw( bool bLayout )
if( ! (nParentStyle & WB_BORDER) || (nParentStyle & WB_NOBORDER) )
{
Rectangle aParentRect( Point( 0, 0 ), pWin->GetSizePixel() );
- Region aParentReg( aParentRect );
- pWin->DrawNativeControl( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aParentReg,
+ pWin->DrawNativeControl( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aParentRect,
nState, aControlValue, rtl::OUString() );
}
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index 6c7df5b106bf..eb8c20d1d803 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -129,14 +129,14 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
IsNativeControlSupported( CTRL_LISTBOX, PART_ENTIRE_CONTROL ) )
{
ImplControlValue aControlValue;
- Region aCtrlRegion( Rectangle( (const Point&)Point(), Size( 20, mnDDHeight ) ) );
- Region aBoundingRgn( aCtrlRegion );
- Region aContentRgn( aCtrlRegion );
+ Rectangle aCtrlRegion( Point( 0, 0 ), Size( 20, mnDDHeight ) );
+ Rectangle aBoundingRgn( aCtrlRegion );
+ Rectangle aContentRgn( aCtrlRegion );
if( GetNativeControlRegion( CTRL_LISTBOX, PART_ENTIRE_CONTROL, aCtrlRegion,
CTRL_STATE_ENABLED, aControlValue, rtl::OUString(),
aBoundingRgn, aContentRgn ) )
{
- sal_Int32 nHeight = aBoundingRgn.GetBoundRect().GetHeight();
+ sal_Int32 nHeight = aBoundingRgn.GetHeight();
if( nHeight > mnDDHeight )
mnDDHeight = static_cast<USHORT>(nHeight);
}
@@ -652,10 +652,10 @@ void ListBox::Resize()
Window *pBorder = GetWindow( WINDOW_BORDER );
ImplControlValue aControlValue;
Point aPoint;
- Region aContent, aBound;
+ Rectangle aContent, aBound;
// use the full extent of the control
- Region aArea( Rectangle(aPoint, pBorder->GetOutputSizePixel()) );
+ Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );
if ( GetNativeControlRegion( CTRL_LISTBOX, PART_BUTTON_DOWN,
aArea, 0, aControlValue, rtl::OUString(), aBound, aContent) )
@@ -665,8 +665,8 @@ void ListBox::Resize()
aContent.Move( -aPoint.X(), -aPoint.Y() );
// use the themes drop down size for the button
- aOutSz.Width() = aContent.GetBoundRect().Left();
- mpBtn->SetPosSizePixel( aContent.GetBoundRect().Left(), nTop, aContent.GetBoundRect().Right(), (nBottom-nTop) );
+ aOutSz.Width() = aContent.Left();
+ mpBtn->SetPosSizePixel( aContent.Left(), nTop, aContent.Right(), (nBottom-nTop) );
// adjust the size of the edit field
if ( GetNativeControlRegion( CTRL_LISTBOX, PART_SUB_EDIT,
@@ -676,7 +676,6 @@ void ListBox::Resize()
aContent.Move( -aPoint.X(), -aPoint.Y() );
// use the themes drop down size
- Rectangle aContentRect = aContent.GetBoundRect();
if( ! (GetStyle() & WB_BORDER) && ImplGetSVData()->maNWFData.mbNoFocusRects )
{
// no border but focus ring behavior -> we have a problem; the
@@ -684,11 +683,11 @@ void ListBox::Resize()
// let's do the best we can and center vertically, so it doesn't look
// completely wrong.
Size aSz( GetOutputSizePixel() );
- long nDiff = aContentRect.Top() - (aSz.Height() - aContentRect.GetHeight())/2;
- aContentRect.Top() -= nDiff;
- aContentRect.Bottom() -= nDiff;
+ long nDiff = aContent.Top() - (aSz.Height() - aContent.GetHeight())/2;
+ aContent.Top() -= nDiff;
+ aContent.Bottom() -= nDiff;
}
- mpImplWin->SetPosSizePixel( aContentRect.TopLeft(), aContentRect.GetSize() );
+ mpImplWin->SetPosSizePixel( aContent.TopLeft(), aContent.GetSize() );
}
else
mpImplWin->SetSizePixel( aOutSz );
@@ -1327,15 +1326,14 @@ Size ListBox::CalcMinimumSize() const
// see how large the edit area inside is to estimate what is needed for the dropdown
ImplControlValue aControlValue;
Point aPoint;
- Region aContent, aBound;
+ Rectangle aContent, aBound;
Size aTestSize( 100, 20 );
- Region aArea( Rectangle( aPoint, aTestSize ) );
+ Rectangle aArea( aPoint, aTestSize );
if( const_cast<ListBox*>(this)->GetNativeControlRegion(
CTRL_LISTBOX, PART_SUB_EDIT, aArea, 0, aControlValue, rtl::OUString(), aBound, aContent) )
{
// use the themes drop down size
- Rectangle aContentRect = aContent.GetBoundRect();
- aSz.Width() += aTestSize.Width() - aContentRect.GetWidth();
+ aSz.Width() += aTestSize.Width() - aContent.GetWidth();
}
else
aSz.Width() += GetSettings().GetStyleSettings().GetScrollBarSize();
@@ -1347,13 +1345,12 @@ Size ListBox::CalcMinimumSize() const
{
ImplControlValue aControlValue;
Rectangle aRect( Point( 0, 0 ), aSz );
- Region aContent, aBound;
+ Rectangle aContent, aBound;
if( const_cast<ListBox*>(this)->GetNativeControlRegion(
CTRL_LISTBOX, PART_ENTIRE_CONTROL, aRect, 0, aControlValue, rtl::OUString(), aBound, aContent) )
{
- Rectangle aBoundRect( aBound.GetBoundRect() );
- if( aBoundRect.GetHeight() > aSz.Height() )
- aSz.Height() = aBoundRect.GetHeight();
+ if( aBound.GetHeight() > aSz.Height() )
+ aSz.Height() = aBound.GetHeight();
}
}
diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx
index 94f61818ac92..1c83779da1a9 100644
--- a/vcl/source/control/menubtn.cxx
+++ b/vcl/source/control/menubtn.cxx
@@ -169,20 +169,27 @@ IMPL_LINK( MenuButton, ImplMenuTimeoutHdl, Timer*, EMPTYARG )
void MenuButton::MouseButtonDown( const MouseEvent& rMEvt )
{
+ bool bExecute = true;
if ( mnMenuMode & MENUBUTTON_MENUMODE_TIMED )
{
- if ( !mpMenuTimer )
+ // if the separated dropdown symbol is hit,
+ // execute the popup immediately
+ if( ! ImplGetSymbolRect().IsInside( rMEvt.GetPosPixel() ) )
{
- mpMenuTimer = new Timer;
- mpMenuTimer->SetTimeoutHdl( LINK( this, MenuButton, ImplMenuTimeoutHdl ) );
- }
+ if ( !mpMenuTimer )
+ {
+ mpMenuTimer = new Timer;
+ mpMenuTimer->SetTimeoutHdl( LINK( this, MenuButton, ImplMenuTimeoutHdl ) );
+ }
- mpMenuTimer->SetTimeout( GetSettings().GetMouseSettings().GetActionDelay() );
- mpMenuTimer->Start();
+ mpMenuTimer->SetTimeout( GetSettings().GetMouseSettings().GetActionDelay() );
+ mpMenuTimer->Start();
- PushButton::MouseButtonDown( rMEvt );
+ PushButton::MouseButtonDown( rMEvt );
+ bExecute = false;
+ }
}
- else
+ if( bExecute )
{
if ( PushButton::ImplHitTestPushButton( this, rMEvt.GetPosPixel() ) )
{
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index 54a1e0a97eab..9c82bb096dec 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -342,8 +342,8 @@ void ScrollBar::ImplCalc( BOOL bUpdate )
Rectangle& maTrackRect = mpData->maTrackRect; // TODO: remove when maTrackRect is no longer in mpData
if ( mbCalcSize )
{
- const Region aControlRegion( Rectangle( (const Point&)Point(0,0), aSize ) );
- Region aBtn1Region, aBtn2Region, aTrackRegion, aBoundingRegion;
+ const Rectangle aControlRegion( Point(0,0), aSize );
+ Rectangle aBtn1Region, aBtn2Region, aTrackRegion, aBoundingRegion;
if ( GetStyle() & WB_HORZ )
{
@@ -352,8 +352,8 @@ void ScrollBar::ImplCalc( BOOL bUpdate )
GetNativeControlRegion( CTRL_SCROLLBAR, PART_BUTTON_RIGHT,
aControlRegion, 0, ImplControlValue(), rtl::OUString(), aBoundingRegion, aBtn2Region ) )
{
- maBtn1Rect = aBtn1Region.GetBoundRect();
- maBtn2Rect = aBtn2Region.GetBoundRect();
+ maBtn1Rect = aBtn1Region;
+ maBtn2Rect = aBtn2Region;
}
else
{
@@ -366,7 +366,7 @@ void ScrollBar::ImplCalc( BOOL bUpdate )
if ( GetNativeControlRegion( CTRL_SCROLLBAR, PART_TRACK_HORZ_AREA,
aControlRegion, 0, ImplControlValue(), rtl::OUString(), aBoundingRegion, aTrackRegion ) )
- maTrackRect = aTrackRegion.GetBoundRect();
+ maTrackRect = aTrackRegion;
else
maTrackRect = Rectangle( maBtn1Rect.TopRight(), maBtn2Rect.BottomLeft() );
@@ -393,8 +393,8 @@ void ScrollBar::ImplCalc( BOOL bUpdate )
GetNativeControlRegion( CTRL_SCROLLBAR, PART_BUTTON_DOWN,
aControlRegion, 0, ImplControlValue(), rtl::OUString(), aBoundingRegion, aBtn2Region ) )
{
- maBtn1Rect = aBtn1Region.GetBoundRect();
- maBtn2Rect = aBtn2Region.GetBoundRect();
+ maBtn1Rect = aBtn1Region;
+ maBtn2Rect = aBtn2Region;
}
else
{
@@ -407,7 +407,7 @@ void ScrollBar::ImplCalc( BOOL bUpdate )
if ( GetNativeControlRegion( CTRL_SCROLLBAR, PART_TRACK_VERT_AREA,
aControlRegion, 0, ImplControlValue(), rtl::OUString(), aBoundingRegion, aTrackRegion ) )
- maTrackRect = aTrackRegion.GetBoundRect();
+ maTrackRect = aTrackRegion;
else
maTrackRect = Rectangle( maBtn1Rect.BottomLeft()+Point(0,1), maBtn2Rect.TopRight() );
@@ -524,7 +524,7 @@ void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags )
{
- ImplControlValue aControlValue( BUTTONVALUE_DONTKNOW, rtl::OUString(), 0 );
+ ScrollbarValue scrValue;
BOOL bNativeOK = IsNativeControlSupported(CTRL_SCROLLBAR, PART_ENTIRE_CONTROL);
if( bNativeOK )
@@ -535,7 +535,6 @@ BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags )
if( IsNativeControlSupported(CTRL_SCROLLBAR, bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT) )
{
ControlState nState = ( IsEnabled() ? CTRL_STATE_ENABLED : 0 ) | ( HasFocus() ? CTRL_STATE_FOCUSED : 0 );
- ScrollbarValue scrValue;
scrValue.mnMin = mnMinRange;
scrValue.mnMax = mnMaxRange;
@@ -570,20 +569,14 @@ BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags )
}
}
- aControlValue.setOptionalVal( (void *)(&scrValue) );
-
-#if 1
- Region aCtrlRegion;
+ Rectangle aCtrlRegion;
aCtrlRegion.Union( maBtn1Rect );
aCtrlRegion.Union( maBtn2Rect );
aCtrlRegion.Union( maPage1Rect );
aCtrlRegion.Union( maPage2Rect );
aCtrlRegion.Union( maThumbRect );
-#else
- const Region aCtrlRegion( Rectangle( Point(0,0), GetOutputSizePixel() ) );
-#endif
bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, (bHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT),
- aCtrlRegion, nState, aControlValue, rtl::OUString() );
+ aCtrlRegion, nState, scrValue, rtl::OUString() );
}
else
{
@@ -591,8 +584,8 @@ BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags )
{
sal_uInt32 part1 = bHorz ? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER;
sal_uInt32 part2 = bHorz ? PART_TRACK_HORZ_RIGHT : PART_TRACK_VERT_LOWER;
- Region aCtrlRegion1( maPage1Rect );
- Region aCtrlRegion2( maPage2Rect );
+ Rectangle aCtrlRegion1( maPage1Rect );
+ Rectangle aCtrlRegion2( maPage2Rect );
ControlState nState1 = (IsEnabled() ? CTRL_STATE_ENABLED : 0) | (HasFocus() ? CTRL_STATE_FOCUSED : 0);
ControlState nState2 = nState1;
@@ -613,18 +606,18 @@ BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags )
if ( nDrawFlags & SCRBAR_DRAW_PAGE1 )
bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, part1, aCtrlRegion1, nState1,
- aControlValue, rtl::OUString() );
+ scrValue, rtl::OUString() );
if ( nDrawFlags & SCRBAR_DRAW_PAGE2 )
bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, part2, aCtrlRegion2, nState2,
- aControlValue, rtl::OUString() );
+ scrValue, rtl::OUString() );
}
if ( (nDrawFlags & SCRBAR_DRAW_BTN1) || (nDrawFlags & SCRBAR_DRAW_BTN2) )
{
sal_uInt32 part1 = bHorz ? PART_BUTTON_LEFT : PART_BUTTON_UP;
sal_uInt32 part2 = bHorz ? PART_BUTTON_RIGHT : PART_BUTTON_DOWN;
- Region aCtrlRegion1( maBtn1Rect );
- Region aCtrlRegion2( maBtn2Rect );
+ Rectangle aCtrlRegion1( maBtn1Rect );
+ Rectangle aCtrlRegion2( maBtn2Rect );
ControlState nState1 = HasFocus() ? CTRL_STATE_FOCUSED : 0;
ControlState nState2 = nState1;
@@ -655,16 +648,16 @@ BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags )
if ( nDrawFlags & SCRBAR_DRAW_BTN1 )
bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, part1, aCtrlRegion1, nState1,
- aControlValue, rtl::OUString() );
+ scrValue, rtl::OUString() );
if ( nDrawFlags & SCRBAR_DRAW_BTN2 )
bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, part2, aCtrlRegion2, nState2,
- aControlValue, rtl::OUString() );
+ scrValue, rtl::OUString() );
}
if ( (nDrawFlags & SCRBAR_DRAW_THUMB) && !maThumbRect.IsEmpty() )
{
ControlState nState = IsEnabled() ? CTRL_STATE_ENABLED : 0;
- Region aCtrlRegion( maThumbRect );
+ Rectangle aCtrlRegion( maThumbRect );
if ( mnStateFlags & SCRBAR_STATE_THUMB_DOWN )
nState |= CTRL_STATE_PRESSED;
@@ -683,7 +676,7 @@ BOOL ScrollBar::ImplDrawNative( USHORT nDrawFlags )
}
bNativeOK = DrawNativeControl( CTRL_SCROLLBAR, (bHorz ? PART_THUMB_HORZ : PART_THUMB_VERT),
- aCtrlRegion, nState, aControlValue, rtl::OUString() );
+ aCtrlRegion, nState, scrValue, rtl::OUString() );
}
}
}
@@ -920,7 +913,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, BOOL bCallAction )
BOOL bIsInside = FALSE;
Point aPoint( 0, 0 );
- Region aControlRegion( Rectangle( aPoint, GetOutputSizePixel() ) );
+ Rectangle aControlRegion( aPoint, GetOutputSizePixel() );
switch ( meScrollType )
{
@@ -953,7 +946,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, BOOL bCallAction )
case SCROLL_PAGEUP:
// HitTestNativeControl, see remark at top of file
if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_LEFT: PART_TRACK_VERT_UPPER,
- Region( maPage1Rect ), rMousePos, bIsInside )?
+ maPage1Rect, rMousePos, bIsInside )?
bIsInside:
maPage1Rect.IsInside( rMousePos ) )
{
@@ -967,7 +960,7 @@ void ScrollBar::ImplDoMouseAction( const Point& rMousePos, BOOL bCallAction )
case SCROLL_PAGEDOWN:
// HitTestNativeControl, see remark at top of file
if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_RIGHT: PART_TRACK_VERT_LOWER,
- Region( maPage2Rect ), rMousePos, bIsInside )?
+ maPage2Rect, rMousePos, bIsInside )?
bIsInside:
maPage2Rect.IsInside( rMousePos ) )
{
@@ -1030,7 +1023,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
BOOL bDragToMouse = FALSE;
Point aPoint( 0, 0 );
- Region aControlRegion( Rectangle( aPoint, GetOutputSizePixel() ) );
+ Rectangle aControlRegion( aPoint, GetOutputSizePixel() );
if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_BUTTON_LEFT: PART_BUTTON_UP,
aControlRegion, rMousePos, bIsInside )?
@@ -1063,7 +1056,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
else
{
bool bThumbHit = HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_THUMB_HORZ : PART_THUMB_VERT,
- Region( maThumbRect ), rMousePos, bIsInside )
+ maThumbRect, rMousePos, bIsInside )
? bIsInside : maThumbRect.IsInside( rMousePos );
bool bDragHandling = rMEvt.IsMiddle() || bThumbHit || ImplGetSVData()->maNWFData.mbScrollbarJumpPage;
if( bDragHandling )
@@ -1112,7 +1105,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt )
// HitTestNativeControl, see remark at top of file
if ( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER,
- Region( maPage1Rect ), rMousePos, bIsInside )?
+ maPage1Rect, rMousePos, bIsInside )?
bIsInside:
maPage1Rect.IsInside( rMousePos ) )
{
@@ -1387,7 +1380,7 @@ Rectangle* ScrollBar::ImplFindPartRect( const Point& rPt )
BOOL bIsInside = FALSE;
Point aPoint( 0, 0 );
- Region aControlRegion( Rectangle( aPoint, GetOutputSizePixel() ) );
+ Rectangle aControlRegion( aPoint, GetOutputSizePixel() );
if( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal? PART_BUTTON_LEFT: PART_BUTTON_UP,
aControlRegion, rPt, bIsInside )?
@@ -1401,19 +1394,19 @@ Rectangle* ScrollBar::ImplFindPartRect( const Point& rPt )
return &maBtn2Rect;
// HitTestNativeControl, see remark at top of file
else if( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal ? PART_TRACK_HORZ_LEFT : PART_TRACK_VERT_UPPER,
- Region( maPage1Rect ), rPt, bIsInside)?
+ maPage1Rect, rPt, bIsInside)?
bIsInside:
maPage1Rect.IsInside( rPt ) )
return &maPage1Rect;
// HitTestNativeControl, see remark at top of file
else if( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal ? PART_TRACK_HORZ_RIGHT : PART_TRACK_VERT_LOWER,
- Region( maPage2Rect ), rPt, bIsInside)?
+ maPage2Rect, rPt, bIsInside)?
bIsInside:
maPage2Rect.IsInside( rPt ) )
return &maPage2Rect;
// HitTestNativeControl, see remark at top of file
else if( HitTestNativeControl( CTRL_SCROLLBAR, bHorizontal ? PART_THUMB_HORZ : PART_THUMB_VERT,
- Region( maThumbRect ), rPt, bIsInside)?
+ maThumbRect, rPt, bIsInside)?
bIsInside:
maThumbRect.IsInside( rPt ) )
return &maThumbRect;
diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx
index 2390a8e3e9a6..daf733a57a33 100644
--- a/vcl/source/control/slider.cxx
+++ b/vcl/source/control/slider.cxx
@@ -195,15 +195,14 @@ void Slider::ImplUpdateRects( BOOL bUpdate )
else
maChannel2Rect.SetEmpty();
- const Region aControlRegion( Rectangle( Point(0,0), Size( SLIDER_THUMB_SIZE, 10 ) ) );
- Region aThumbBounds, aThumbContent;
+ const Rectangle aControlRegion( Rectangle( Point(0,0), Size( SLIDER_THUMB_SIZE, 10 ) ) );
+ Rectangle aThumbBounds, aThumbContent;
if ( GetNativeControlRegion( CTRL_SLIDER, PART_THUMB_HORZ,
aControlRegion, 0, ImplControlValue(), rtl::OUString(),
aThumbBounds, aThumbContent ) )
{
- Rectangle aRect( aThumbBounds.GetBoundRect() );
- maThumbRect.Left() = mnThumbPixPos - aRect.GetWidth()/2;
- maThumbRect.Right() = maThumbRect.Left() + aRect.GetWidth() - 1;
+ maThumbRect.Left() = mnThumbPixPos - aThumbBounds.GetWidth()/2;
+ maThumbRect.Right() = maThumbRect.Left() + aThumbBounds.GetWidth() - 1;
bInvalidateAll = true;
}
}
@@ -230,15 +229,14 @@ void Slider::ImplUpdateRects( BOOL bUpdate )
else
maChannel2Rect.SetEmpty();
- const Region aControlRegion( Rectangle( Point(0,0), Size( 10, SLIDER_THUMB_SIZE ) ) );
- Region aThumbBounds, aThumbContent;
+ const Rectangle aControlRegion( Rectangle( Point(0,0), Size( 10, SLIDER_THUMB_SIZE ) ) );
+ Rectangle aThumbBounds, aThumbContent;
if ( GetNativeControlRegion( CTRL_SLIDER, PART_THUMB_VERT,
aControlRegion, 0, ImplControlValue(), rtl::OUString(),
aThumbBounds, aThumbContent ) )
{
- Rectangle aRect( aThumbBounds.GetBoundRect() );
- maThumbRect.Top() = mnThumbPixPos - aRect.GetHeight()/2;
- maThumbRect.Bottom() = maThumbRect.Top() + aRect.GetHeight() - 1;
+ maThumbRect.Top() = mnThumbPixPos - aThumbBounds.GetHeight()/2;
+ maThumbRect.Bottom() = maThumbRect.Top() + aThumbBounds.GetHeight() - 1;
bInvalidateAll = true;
}
}
@@ -388,7 +386,6 @@ void Slider::ImplDraw( USHORT nDrawFlags )
ImplCalc( FALSE );
ControlPart nPart = (GetStyle() & WB_HORZ) ? PART_TRACK_HORZ_AREA : PART_TRACK_VERT_AREA;
- ImplControlValue aControlValue( BUTTONVALUE_DONTKNOW, rtl::OUString(), 0 );
ControlState nState = ( IsEnabled() ? CTRL_STATE_ENABLED : 0 ) | ( HasFocus() ? CTRL_STATE_FOCUSED : 0 );
SliderValue sldValue;
@@ -402,11 +399,10 @@ void Slider::ImplDraw( USHORT nDrawFlags )
if( maThumbRect.IsInside( GetPointerPosPixel() ) )
sldValue.mnThumbState |= CTRL_STATE_ROLLOVER;
}
- aControlValue.setOptionalVal( (void *)(&sldValue) );
- const Region aCtrlRegion( Rectangle( Point(0,0), GetOutputSizePixel() ) );
+ const Rectangle aCtrlRegion( Point(0,0), GetOutputSizePixel() );
bool bNativeOK = DrawNativeControl( CTRL_SLIDER, nPart,
- aCtrlRegion, nState, aControlValue, rtl::OUString() );
+ aCtrlRegion, nState, sldValue, rtl::OUString() );
if( bNativeOK )
return;
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index d18a412e31cc..754270e9012f 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -88,15 +88,12 @@ BOOL ImplDrawNativeSpinfield( Window *pWin, const SpinbuttonValue& rSpinbuttonVa
// there is just no useful native support for spinfields with dropdown
!(pWin->GetStyle() & WB_DROPDOWN) )
{
- ImplControlValue aControlValue;
- aControlValue.setOptionalVal( (void*) &rSpinbuttonValue );
-
if( pWin->IsNativeControlSupported(CTRL_SPINBOX, rSpinbuttonValue.mnUpperPart) &&
pWin->IsNativeControlSupported(CTRL_SPINBOX, rSpinbuttonValue.mnLowerPart) )
{
// only paint the embedded spin buttons, all buttons are painted at once
- bNativeOK = pWin->DrawNativeControl( CTRL_SPINBOX, PART_ALL_BUTTONS, Region(), CTRL_STATE_ENABLED,
- aControlValue, rtl::OUString() );
+ bNativeOK = pWin->DrawNativeControl( CTRL_SPINBOX, PART_ALL_BUTTONS, Rectangle(), CTRL_STATE_ENABLED,
+ rSpinbuttonValue, rtl::OUString() );
}
else
{
@@ -115,17 +112,17 @@ BOOL ImplDrawNativeSpinfield( Window *pWin, const SpinbuttonValue& rSpinbuttonVa
Point aPt;
Size aSize( pBorder->GetOutputSizePixel() ); // the size of the border window, i.e., the whole control
- Region aBound, aContent;
- Region aNatRgn( Rectangle( aPt, aSize ) );
+ Rectangle aBound, aContent;
+ Rectangle aNatRgn( aPt, aSize );
if( pBorder->GetNativeControlRegion(CTRL_SPINBOX, PART_ENTIRE_CONTROL,
- aNatRgn, 0, aControlValue, rtl::OUString(), aBound, aContent) )
+ aNatRgn, 0, rSpinbuttonValue, rtl::OUString(), aBound, aContent) )
{
- aSize = aContent.GetBoundRect().GetSize();
+ aSize = aContent.GetSize();
}
- Region aRgn( Rectangle( aPt, aSize ) );
+ Rectangle aRgn( aPt, aSize );
bNativeOK = pBorder->DrawNativeControl( CTRL_SPINBOX, PART_ENTIRE_CONTROL, aRgn, CTRL_STATE_ENABLED,
- aControlValue, rtl::OUString() );
+ rSpinbuttonValue, rtl::OUString() );
pBorder->SetClipRegion( oldRgn );
}
@@ -139,12 +136,9 @@ BOOL ImplDrawNativeSpinbuttons( Window *pWin, const SpinbuttonValue& rSpinbutton
if( pWin->IsNativeControlSupported(CTRL_SPINBUTTONS, PART_ENTIRE_CONTROL) )
{
- ImplControlValue aControlValue;
- aControlValue.setOptionalVal( (void*) &rSpinbuttonValue );
-
// only paint the standalone spin buttons, all buttons are painted at once
- bNativeOK = pWin->DrawNativeControl( CTRL_SPINBUTTONS, PART_ALL_BUTTONS, Region(), CTRL_STATE_ENABLED,
- aControlValue, rtl::OUString() );
+ bNativeOK = pWin->DrawNativeControl( CTRL_SPINBUTTONS, PART_ALL_BUTTONS, Rectangle(), CTRL_STATE_ENABLED,
+ rSpinbuttonValue, rtl::OUString() );
}
return bNativeOK;
}
@@ -705,7 +699,7 @@ void SpinField::ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rec
nBottom1--;
BOOL bNativeRegionOK = FALSE;
- Region aContentUp, aContentDown;
+ Rectangle aContentUp, aContentDown;
if ( (pDev->GetOutDevType() == OUTDEV_WINDOW) &&
// there is just no useful native support for spinfields with dropdown
@@ -717,11 +711,11 @@ void SpinField::ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rec
// get the system's spin button size
ImplControlValue aControlValue;
- Region aBound;
+ Rectangle aBound;
Point aPoint;
// use the full extent of the control
- Region aArea( Rectangle( aPoint, pBorder->GetOutputSizePixel() ) );
+ Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );
bNativeRegionOK =
pWin->GetNativeControlRegion(CTRL_SPINBOX, PART_BUTTON_UP,
@@ -740,8 +734,8 @@ void SpinField::ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rec
if( bNativeRegionOK )
{
- rSpinUpArea = aContentUp.GetBoundRect();
- rSpinDownArea = aContentDown.GetBoundRect();
+ rSpinUpArea = aContentUp;
+ rSpinDownArea = aContentDown;
}
else
{
@@ -774,11 +768,11 @@ void SpinField::Resize()
ImplControlValue aControlValue;
Point aPoint;
- Region aContent, aBound;
+ Rectangle aContent, aBound;
// use the full extent of the control
Window *pBorder = GetWindow( WINDOW_BORDER );
- Region aArea( Rectangle(aPoint, pBorder->GetOutputSizePixel()) );
+ Rectangle aArea( aPoint, pBorder->GetOutputSizePixel() );
// adjust position and size of the edit field
if ( GetNativeControlRegion(CTRL_SPINBOX, PART_SUB_EDIT,
@@ -789,10 +783,9 @@ void SpinField::Resize()
aContent.Move(-aPoint.X(), -aPoint.Y());
// use the themes drop down size
- Rectangle aContentRect = aContent.GetBoundRect();
- mpEdit->SetPosPixel( aContentRect.TopLeft() );
+ mpEdit->SetPosPixel( aContent.TopLeft() );
bSubEditPositioned = true;
- aSize = aContentRect.GetSize();
+ aSize = aContent.GetSize();
}
else
{
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 95f84626b582..c892b32534ec 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -411,15 +411,14 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth )
aSize.Width() += TAB_TABOFFSET_X*2;
aSize.Height() += TAB_TABOFFSET_Y*2;
- Region aCtrlRegion( Rectangle( (const Point&)Point( 0, 0 ), aSize ) );
- Region aBoundingRgn, aContentRgn;
- const ImplControlValue aControlValue( BUTTONVALUE_DONTKNOW, rtl::OUString(), 0 );
+ Rectangle aCtrlRegion( Point( 0, 0 ), aSize );
+ Rectangle aBoundingRgn, aContentRgn;
+ const ImplControlValue aControlValue;
if(GetNativeControlRegion( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL, aCtrlRegion,
CTRL_STATE_ENABLED, aControlValue, rtl::OUString(),
aBoundingRgn, aContentRgn ) )
{
- Rectangle aCont(aContentRgn.GetBoundRect());
- return aCont.GetSize();
+ return aContentRgn.GetSize();
}
// For systems without synthetic bold support
@@ -938,8 +937,7 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
if( !bLayout && (bNativeOK = IsNativeControlSupported(CTRL_TAB_ITEM, PART_ENTIRE_CONTROL)) == TRUE )
{
- ImplControlValue aControlValue;
- Region aCtrlRegion( pItem->maRect );
+ Rectangle aCtrlRegion( pItem->maRect );
ControlState nState = 0;
if( pItem->mnId == mnCurPageId )
@@ -974,10 +972,9 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
tiValue.mnAlignment |= TABITEM_FIRST_IN_GROUP;
if ( bLastInGroup )
tiValue.mnAlignment |= TABITEM_LAST_IN_GROUP;
- aControlValue.setOptionalVal( (void *)(&tiValue) );
bNativeOK = DrawNativeControl( CTRL_TAB_ITEM, PART_ENTIRE_CONTROL, aCtrlRegion, nState,
- aControlValue, rtl::OUString() );
+ tiValue, rtl::OUString() );
}
if( ! bLayout && !bNativeOK )
@@ -1236,7 +1233,7 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
BOOL bNativeOK = FALSE;
if( ! bLayout && (bNativeOK = IsNativeControlSupported( CTRL_TAB_PANE, PART_ENTIRE_CONTROL) ) == TRUE )
{
- const ImplControlValue aControlValue( BUTTONVALUE_DONTKNOW, rtl::OUString(), 0 );
+ const ImplControlValue aControlValue;
ControlState nState = CTRL_STATE_ENABLED;
int part = PART_ENTIRE_CONTROL;
@@ -1250,10 +1247,8 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
if( !rRect.IsEmpty() )
aClipRgn.Intersect( rRect );
- Region aCtrlRegion( aRect );
- Rectangle aClipRect( aClipRgn.GetBoundRect() );
- if( !aClipRgn.IsEmpty() ) //&& aClipRect.getHeight() && aClipRect.getWidth() )
- bNativeOK = DrawNativeControl( CTRL_TAB_PANE, part, aCtrlRegion, nState,
+ if( !aClipRgn.IsEmpty() )
+ bNativeOK = DrawNativeControl( CTRL_TAB_PANE, part, aRect, nState,
aControlValue, rtl::OUString() );
}
else
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 468d4be36b0a..43f24e5026ea 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1397,6 +1397,7 @@ static void FindCmap(TrueTypeFont *ttf)
sal_uInt32 table_size = getTableSize(ttf, O_cmap);
sal_uInt16 ncmaps = GetUInt16(table, 2, 1);
unsigned int i;
+ sal_uInt32 AppleUni = 0; // Apple Unicode
sal_uInt32 ThreeZero = 0; /* MS Symbol */
sal_uInt32 ThreeOne = 0; /* MS UCS-2 */
sal_uInt32 ThreeTwo = 0; /* MS ShiftJIS */
@@ -1423,7 +1424,7 @@ static void FindCmap(TrueTypeFont *ttf)
/* Unicode tables in Apple fonts */
if (pID == 0) {
- ThreeOne = offset; break;
+ AppleUni = offset;
}
if (pID == 3) {
@@ -1440,6 +1441,10 @@ static void FindCmap(TrueTypeFont *ttf)
}
}
+ // fall back to AppleUnicode if there are no ThreeOne/Threezero tables
+ if( AppleUni && !ThreeZero && !ThreeOne)
+ ThreeOne = AppleUni;
+
if (ThreeOne) {
ttf->cmapType = CMAP_MS_Unicode;
ttf->cmap = table + ThreeOne;
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index 4d32990f9335..60ad94a63273 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
+#include <osl/file.h>
#include <tools/vcompat.hxx>
#include <tools/urlobj.hxx>
#include <tools/debug.hxx>
@@ -398,12 +399,10 @@ ImpSwap::ImpSwap( BYTE* pData, ULONG nDataSize ) :
{
::utl::TempFile aTempFile;
- maURL = INetURLObject(aTempFile.GetURL());
-
- if( maURL.GetMainURL( INetURLObject::NO_DECODE ).getLength() )
+ maURL = aTempFile.GetURL();
+ if( maURL.getLength() )
{
- SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( maURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READWRITE | STREAM_SHARE_DENYWRITE );
-
+ SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( maURL, STREAM_READWRITE | STREAM_SHARE_DENYWRITE );
if( pOStm )
{
pOStm->Write( pData, mnDataSize );
@@ -412,28 +411,8 @@ ImpSwap::ImpSwap( BYTE* pData, ULONG nDataSize ) :
if( bError )
{
- try
- {
- ::ucbhelper::Content aCnt( maURL.GetMainURL( INetURLObject::NO_DECODE ),
- ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
-
- aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ),
- ::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
- }
- catch( const ::com::sun::star::ucb::ContentCreationException& )
- {
- }
- catch( const ::com::sun::star::uno::RuntimeException& )
- {
- }
- catch( const ::com::sun::star::ucb::CommandAbortedException& )
- {
- }
- catch( const ::com::sun::star::uno::Exception& )
- {
- }
-
- maURL = INetURLObject();
+ osl_removeFile( maURL.pData );
+ maURL = String();
}
}
}
@@ -445,28 +424,7 @@ ImpSwap::ImpSwap( BYTE* pData, ULONG nDataSize ) :
ImpSwap::~ImpSwap()
{
if( IsSwapped() )
- {
- try
- {
- ::ucbhelper::Content aCnt( maURL.GetMainURL( INetURLObject::NO_DECODE ),
- ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
-
- aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ),
- ::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
- }
- catch( const ::com::sun::star::ucb::ContentCreationException& )
- {
- }
- catch( const ::com::sun::star::uno::RuntimeException& )
- {
- }
- catch( const ::com::sun::star::ucb::CommandAbortedException& )
- {
- }
- catch( const ::com::sun::star::uno::Exception& )
- {
- }
- }
+ osl_removeFile( maURL.pData );
}
// ------------------------------------------------------------------------
@@ -477,8 +435,7 @@ BYTE* ImpSwap::GetData() const
if( IsSwapped() )
{
- SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( maURL.GetMainURL( INetURLObject::NO_DECODE ), STREAM_READWRITE );
-
+ SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( maURL, STREAM_READWRITE );
if( pIStm )
{
pData = new BYTE[ mnDataSize ];
diff --git a/vcl/source/gdi/imgcons.cxx b/vcl/source/gdi/imgcons.cxx
deleted file mode 100644
index 0826c5f2310b..000000000000
--- a/vcl/source/gdi/imgcons.cxx
+++ /dev/null
@@ -1,574 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_vcl.hxx"
-
-#include <tools/stream.hxx>
-#include <vcl/bmpacc.hxx>
-#include <vcl/bitmapex.hxx>
-#include <vcl/image.hxx>
-#include <vcl/imgcons.hxx>
-
-// -------------------
-// - ImplColorMapper -
-// -------------------
-
-class ImplColorMapper
-{
- Color maCol;
- ULONG mnR;
- ULONG mnG;
- ULONG mnB;
- ULONG mnT;
- ULONG mnRShift;
- ULONG mnGShift;
- ULONG mnBShift;
- ULONG mnTShift;
-
- ULONG ImplCalcMaskShift( ULONG nVal );
-
-public:
-
- ImplColorMapper( ULONG nRMask, ULONG nGMask, ULONG nBMask, ULONG nTMask );
- ~ImplColorMapper();
-
- const Color& ImplGetColor( ULONG nColor )
- {
- maCol.SetRed( (UINT8) ( ( nColor & mnR ) >> mnRShift ) );
- maCol.SetGreen( (UINT8) ( ( nColor & mnG ) >> mnGShift ) );
- maCol.SetBlue( (UINT8) ( ( nColor & mnB ) >> mnBShift ) );
- maCol.SetTransparency( (UINT8) ( ( nColor & mnT ) >> mnTShift ) );
- return maCol;
- }
-};
-
-// -----------------------------------------------------------------------------
-
-ImplColorMapper::ImplColorMapper( ULONG nRMask, ULONG nGMask, ULONG nBMask, ULONG nTMask ) :
- mnR( nRMask ),
- mnG( nGMask ),
- mnB( nBMask ),
- mnT( nTMask )
-{
- mnRShift = ImplCalcMaskShift( mnR );
- mnGShift = ImplCalcMaskShift( mnG );
- mnBShift = ImplCalcMaskShift( mnB );
- mnTShift = ImplCalcMaskShift( mnT );
-}
-
-// -----------------------------------------------------------------------------
-
-ImplColorMapper::~ImplColorMapper()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-ULONG ImplColorMapper::ImplCalcMaskShift( ULONG nVal )
-{
- DBG_ASSERT( nVal > 0, "Mask has no value!" );
-
- ULONG nRet = 0UL;
-
- for( ULONG i = 0UL; i < 32; i++ )
- {
- if( nVal & ( 1UL << i ) )
- {
- nRet = i;
- break;
- }
- }
-
- return nRet;
-}
-
-// -----------------
-// - ImageConsumer -
-// -----------------
-
-ImageConsumer::ImageConsumer() :
- mpMapper( NULL ),
- mpPal ( NULL ),
- mnStatus( 0UL ),
- mbTrans ( FALSE )
-{
-}
-
-// -----------------------------------------------------------------------------
-
-ImageConsumer::~ImageConsumer()
-{
- delete[] mpPal;
- delete mpMapper;
-}
-
-// -----------------------------------------------------------------------------
-
-void ImageConsumer::Init( sal_uInt32 nWidth, sal_uInt32 nHeight )
-{
- maSize = Size( nWidth, nHeight );
- maBitmap = maMask = Bitmap();
- mnStatus = 0UL;
- mbTrans = FALSE;
-}
-
-// -----------------------------------------------------------------------------
-
-void ImageConsumer::SetColorModel( USHORT nBitCount,
- sal_uInt32 nPalEntries, const sal_uInt32* pRGBAPal,
- sal_uInt32 nRMask, sal_uInt32 nGMask, sal_uInt32 nBMask, sal_uInt32 nAMask )
-{
- DBG_ASSERT( maSize.Width() && maSize.Height(), "Missing call to ImageConsumer::Init(...)!" );
-
- BitmapPalette aPal( Min( (USHORT) nPalEntries, (USHORT) 256 ) );
-
- if( nPalEntries )
- {
- BitmapColor aCol;
- const sal_Int32* pTmp = (sal_Int32*) pRGBAPal;
-
- delete mpMapper;
- mpMapper = NULL;
-
- delete[] mpPal;
- mpPal = new Color[ nPalEntries ];
-
- for( ULONG i = 0; i < nPalEntries; i++, pTmp++ )
- {
- Color& rCol = mpPal[ i ];
- BYTE cVal;
-
- cVal = (BYTE) ( ( *pTmp & 0xff000000UL ) >> 24L );
- rCol.SetRed( cVal );
-
- if( i < (ULONG) aPal.GetEntryCount() )
- aPal[ (USHORT) i ].SetRed( cVal );
-
- cVal = (BYTE) ( ( *pTmp & 0x00ff0000UL ) >> 16L );
- rCol.SetGreen( cVal );
-
- if( i < (ULONG) aPal.GetEntryCount() )
- aPal[ (USHORT) i ].SetGreen( cVal );
-
- cVal = (BYTE) ( ( *pTmp & 0x0000ff00UL ) >> 8L );
- rCol.SetBlue( cVal );
-
- if( i < (ULONG) aPal.GetEntryCount() )
- aPal[ (USHORT) i ].SetBlue( cVal );
-
- rCol.SetTransparency( (BYTE) ( ( *pTmp & 0x000000ffL ) ) );
- }
-
- if( nBitCount <= 1 )
- nBitCount = 1;
- else if( nBitCount <= 4 )
- nBitCount = 4;
- else if( nBitCount <= 8 )
- nBitCount = 8;
- else
- nBitCount = 24;
- }
- else
- {
- delete mpMapper;
- mpMapper = new ImplColorMapper( nRMask, nGMask, nBMask, nAMask );
-
- delete[] mpPal;
- mpPal = NULL;
-
- nBitCount = 24;
- }
-
- if( !maBitmap )
- {
-
- maBitmap = Bitmap( maSize, nBitCount, &aPal );
- maMask = Bitmap( maSize, 1 );
- maMask.Erase( COL_BLACK );
- mbTrans = FALSE;
- }
-}
-
-// -----------------------------------------------------------------------------
-
-void ImageConsumer::SetPixelsByBytes( sal_uInt32 nConsX, sal_uInt32 nConsY,
- sal_uInt32 nConsWidth, sal_uInt32 nConsHeight,
- const BYTE* pData, sal_uInt32 nOffset, sal_uInt32 nScanSize )
-{
- DBG_ASSERT( !!maBitmap && !!maMask, "Missing call to ImageConsumer::SetColorModel(...)!" );
-
- BitmapWriteAccess* pBmpAcc = maBitmap.AcquireWriteAccess();
- BitmapWriteAccess* pMskAcc = maMask.AcquireWriteAccess();
- sal_Bool bDataChanged = sal_False;
-
- if( pBmpAcc && pMskAcc )
- {
- const long nWidth = pBmpAcc->Width();
- const long nHeight = pBmpAcc->Height();
-
- maChangedRect = Rectangle( Point(), Size( nWidth, nHeight ) );
- maChangedRect.Intersection( Rectangle( Point( nConsX, nConsY ), Size( nConsWidth, nConsHeight ) ) );
-
- if( !maChangedRect.IsEmpty() )
- {
- const long nStartX = maChangedRect.Left();
- const long nEndX = maChangedRect.Right();
- const long nStartY = maChangedRect.Top();
- const long nEndY = maChangedRect.Bottom();
-
- if( mpMapper && ( pBmpAcc->GetBitCount() > 8 ) )
- {
- BitmapColor aCol;
- BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
-
- for( long nY = nStartY; nY <= nEndY; nY++ )
- {
- const BYTE* pTmp = pData + ( nY - nStartY ) * nScanSize + nOffset;
-
- for( long nX = nStartX; nX <= nEndX; nX++ )
- {
- const Color& rCol = mpMapper->ImplGetColor( *pTmp++ );
-
- // 0: Transparent; >0: Non-Transparent
- if( !rCol.GetTransparency() )
- {
- pMskAcc->SetPixel( nY, nX, aMskWhite );
- mbTrans = TRUE;
- }
- else
- {
- aCol.SetRed( rCol.GetRed() );
- aCol.SetGreen( rCol.GetGreen() );
- aCol.SetBlue( rCol.GetBlue() );
- pBmpAcc->SetPixel( nY, nX, aCol );
- }
- }
- }
-
- bDataChanged = sal_True;
- }
- else if( mpPal && ( pBmpAcc->GetBitCount() <= 8 ) )
- {
- BitmapColor aIndex( (BYTE) 0 );
- BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
-
- for( long nY = nStartY; nY <= nEndY; nY++ )
- {
- const BYTE* pTmp = pData + ( nY - nStartY ) * nScanSize + nOffset;
-
- for( long nX = nStartX; nX <= nEndX; nX++ )
- {
- const BYTE cIndex = *pTmp++;
- const Color& rCol = mpPal[ cIndex ];
-
- // 0: Transparent; >0: Non-Transparent
- if( !rCol.GetTransparency() )
- {
- pMskAcc->SetPixel( nY, nX, aMskWhite );
- mbTrans = TRUE;
- }
- else
- {
- aIndex.SetIndex( cIndex );
- pBmpAcc->SetPixel( nY, nX, aIndex );
- }
- }
- }
-
- bDataChanged = sal_True;
- }
- else if( mpPal && ( pBmpAcc->GetBitCount() > 8 ) )
- {
- BitmapColor aCol;
- BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
-
- for( long nY = nStartY; nY <= nEndY; nY++ )
- {
- const BYTE* pTmp = pData + ( nY - nStartY ) * nScanSize + nOffset;
-
- for( long nX = nStartX; nX <= nEndX; nX++ )
- {
- const BYTE cIndex = *pTmp++;
- const Color& rCol = mpPal[ cIndex ];
-
- // 0: Transparent; >0: Non-Transparent
- if( !rCol.GetTransparency() )
- {
- pMskAcc->SetPixel( nY, nX, aMskWhite );
- mbTrans = TRUE;
- }
- else
- {
- aCol.SetRed( rCol.GetRed() );
- aCol.SetGreen( rCol.GetGreen() );
- aCol.SetBlue( rCol.GetBlue() );
- pBmpAcc->SetPixel( nY, nX, aCol );
- }
- }
- }
-
- bDataChanged = sal_True;
- }
- else
- {
- DBG_ERROR( "Producer format error!" );
- maChangedRect.SetEmpty();
- }
- }
- }
- else
- maChangedRect.SetEmpty();
-
- maBitmap.ReleaseAccess( pBmpAcc );
- maMask.ReleaseAccess( pMskAcc );
-
- if( bDataChanged )
- DataChanged();
-}
-
-// -----------------------------------------------------------------------------
-
-void ImageConsumer::SetPixelsByLongs( sal_uInt32 nConsX, sal_uInt32 nConsY,
- sal_uInt32 nConsWidth, sal_uInt32 nConsHeight,
- const sal_uInt32* pData, sal_uInt32 nOffset, sal_uInt32 nScanSize )
-{
- DBG_ASSERT( !!maBitmap && !!maMask, "Missing call to ImageConsumer::SetColorModel(...)!" );
-
- BitmapWriteAccess* pBmpAcc = maBitmap.AcquireWriteAccess();
- BitmapWriteAccess* pMskAcc = maMask.AcquireWriteAccess();
- sal_Bool bDataChanged = sal_False;
-
- if( pBmpAcc && pMskAcc )
- {
- const long nWidth = pBmpAcc->Width();
- const long nHeight = pBmpAcc->Height();
-
- maChangedRect = Rectangle( Point(), Size( nWidth, nHeight ) );
- maChangedRect.Intersection( Rectangle( Point( nConsX, nConsY ), Size( nConsWidth, nConsHeight ) ) );
-
- if( !maChangedRect.IsEmpty() )
- {
- const long nStartX = maChangedRect.Left();
- const long nEndX = maChangedRect.Right();
- const long nStartY = maChangedRect.Top();
- const long nEndY = maChangedRect.Bottom();
-
- if( mpMapper && ( pBmpAcc->GetBitCount() > 8 ) )
- {
- BitmapColor aCol;
- BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
-
- for( long nY = nStartY; nY <= nEndY; nY++ )
- {
- const sal_Int32* pTmp = (sal_Int32*) pData + ( nY - nStartY ) * nScanSize + nOffset;
-
- for( long nX = nStartX; nX <= nEndX; nX++ )
- {
- const Color& rCol = mpMapper->ImplGetColor( *pTmp++ );
-
- // 0: Transparent; >0: Non-Transparent
- if( !rCol.GetTransparency() )
- {
- pMskAcc->SetPixel( nY, nX, aMskWhite );
- mbTrans = TRUE;
- }
- else
- {
- aCol.SetRed( rCol.GetRed() );
- aCol.SetGreen( rCol.GetGreen() );
- aCol.SetBlue( rCol.GetBlue() );
- pBmpAcc->SetPixel( nY, nX, aCol );
- }
- }
- }
-
- bDataChanged = sal_True;
- }
- else if( mpPal && ( pBmpAcc->GetBitCount() <= 8 ) )
- {
- BitmapColor aIndex( (BYTE) 0 );
- BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
-
- for( long nY = nStartY; nY <= nEndY; nY++ )
- {
- const sal_Int32* pTmp = (sal_Int32*) pData + ( nY - nStartY ) * nScanSize + nOffset;
-
- for( long nX = nStartX; nX <= nEndX; nX++ )
- {
- const sal_Int32 nIndex = *pTmp++;
- const Color& rCol = mpPal[ nIndex ];
-
- // 0: Transparent; >0: Non-Transparent
- if( !rCol.GetTransparency() )
- {
- pMskAcc->SetPixel( nY, nX, aMskWhite );
- mbTrans = TRUE;
- }
- else
- {
- aIndex.SetIndex( (BYTE) nIndex );
- pBmpAcc->SetPixel( nY, nX, aIndex );
- }
- }
- }
-
- bDataChanged = sal_True;
- }
- else if( mpPal && ( pBmpAcc->GetBitCount() > 8 ) )
- {
- BitmapColor aCol;
- BitmapColor aMskWhite( pMskAcc->GetBestMatchingColor( Color( COL_WHITE ) ) );
-
- for( long nY = nStartY; nY <= nEndY; nY++ )
- {
- const sal_Int32* pTmp = (sal_Int32*) pData + ( nY - nStartY ) * nScanSize + nOffset;
-
- for( long nX = nStartX; nX <= nEndX; nX++ )
- {
- const sal_Int32 nIndex = *pTmp++;
- const Color& rCol = mpPal[ nIndex ];
-
- // 0: Transparent; >0: Non-Transparent
- if( !rCol.GetTransparency() )
- {
- pMskAcc->SetPixel( nY, nX, aMskWhite );
- mbTrans = TRUE;
- }
- else
- {
- aCol.SetRed( rCol.GetRed() );
- aCol.SetGreen( rCol.GetGreen() );
- aCol.SetBlue( rCol.GetBlue() );
- pBmpAcc->SetPixel( nY, nX, aCol );
- }
- }
- }
-
- bDataChanged = sal_True;
- }
- else
- {
- DBG_ERROR( "Producer format error!" );
- maChangedRect.SetEmpty();
- }
- }
- }
- else
- maChangedRect.SetEmpty();
-
- maBitmap.ReleaseAccess( pBmpAcc );
- maMask.ReleaseAccess( pMskAcc );
-
- if( bDataChanged )
- DataChanged();
-}
-
-// -----------------------------------------------------------------------------
-
-void ImageConsumer::Completed( sal_uInt32 nStatus /*, ImageProducer& rProducer */ )
-{
- delete mpMapper;
- mpMapper = NULL;
- delete[] mpPal;
- mpPal = NULL;
- maSize = Size();
- mnStatus = nStatus;
-
- switch( nStatus )
- {
- case( SINGLEFRAMEDONE ):
- case( STATICIMAGEDONE ):
- {
- if( !mbTrans )
- maMask = Bitmap();
- }
- break;
-
- case( IMAGEERROR ):
- case( IMAGEABORTED ):
- maBitmap = maMask = Bitmap();
- break;
-
- default:
- break;
- }
-
-// rProducer.RemoveConsumer( *this );
-
- if( maDoneLink.IsSet() )
- maDoneLink.Call( this );
-}
-
-// -----------------------------------------------------------------------------
-
-void ImageConsumer::DataChanged()
-{
- if( maChgLink.IsSet() )
- maChgLink.Call( this );
-}
-
-// -----------------------------------------------------------------------------
-
-sal_uInt32 ImageConsumer::GetStatus() const
-{
- return mnStatus;
-}
-
-// -----------------------------------------------------------------------------
-
-BOOL ImageConsumer::GetData( BitmapEx& rBmpEx ) const
-{
- const BOOL bRet = ( SINGLEFRAMEDONE == mnStatus || STATICIMAGEDONE == mnStatus );
-
- if( bRet )
- {
- if( !!maMask )
- rBmpEx = BitmapEx( maBitmap, maMask );
- else
- rBmpEx = BitmapEx( maBitmap );
- }
-
- return bRet;
-}
-
-// -----------------------------------------------------------------------------
-
-BOOL ImageConsumer::GetData( Image& rImage ) const
-{
- const BOOL bRet = ( SINGLEFRAMEDONE == mnStatus || STATICIMAGEDONE == mnStatus );
-
- if( bRet )
- {
- if( !!maMask )
- rImage = Image( maBitmap, maMask );
- else
- rImage = Image( maBitmap );
- }
-
- return bRet;
-}
diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk
index f069828f25f9..77df20976c73 100644
--- a/vcl/source/gdi/makefile.mk
+++ b/vcl/source/gdi/makefile.mk
@@ -50,6 +50,7 @@ CDEFS+=-DENABLE_GRAPHITE
EXCEPTIONSFILES= $(SLO)$/salmisc.obj \
$(SLO)$/outdev.obj \
$(SLO)$/outdev3.obj \
+ $(SLO)$/outdevnative.obj \
$(SLO)$/gfxlink.obj \
$(SLO)$/print.obj \
$(SLO)$/print2.obj \
@@ -84,7 +85,6 @@ SLOFILES= $(EXCEPTIONSFILES) \
$(SLO)$/bitmap4.obj \
$(SLO)$/alpha.obj \
$(SLO)$/bitmapex.obj \
- $(SLO)$/imgcons.obj \
$(SLO)$/bmpacc.obj \
$(SLO)$/bmpacc2.obj \
$(SLO)$/bmpacc3.obj \
@@ -106,7 +106,6 @@ SLOFILES= $(EXCEPTIONSFILES) \
$(SLO)$/outdev4.obj \
$(SLO)$/outdev5.obj \
$(SLO)$/outdev6.obj \
- $(SLO)$/outdevnative.obj \
$(SLO)$/regband.obj \
$(SLO)$/region.obj \
$(SLO)$/wall.obj \
diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx
index 325146b6be8a..dffc7c82caf0 100644
--- a/vcl/source/gdi/metric.cxx
+++ b/vcl/source/gdi/metric.cxx
@@ -263,7 +263,8 @@ ImplFontCharMap::ImplFontCharMap( const CmapResult& rCR )
}
}
-static ImplFontCharMap* pDefaultImplFontCharMap = NULL;
+static ImplFontCharMap* pDefaultUnicodeImplFontCharMap = NULL;
+static ImplFontCharMap* pDefaultSymbolImplFontCharMap = NULL;
static const sal_uInt32 aDefaultUnicodeRanges[] = {0x0020,0xD800, 0xE000,0xFFF0};
static const sal_uInt32 aDefaultSymbolRanges[] = {0x0020,0x0100, 0xF020,0xF100};
@@ -288,25 +289,42 @@ ImplFontCharMap::~ImplFontCharMap()
// -----------------------------------------------------------------------
-ImplFontCharMap* ImplFontCharMap::GetDefaultMap( bool bSymbols)
+namespace
{
- if( pDefaultImplFontCharMap )
- pDefaultImplFontCharMap->AddReference();
- else
+ ImplFontCharMap *GetDefaultUnicodeMap()
{
- const sal_uInt32* pRangeCodes = aDefaultUnicodeRanges;
- int nCodesCount = sizeof(aDefaultUnicodeRanges) / sizeof(*pRangeCodes);
- if( bSymbols )
+ if( pDefaultUnicodeImplFontCharMap )
+ pDefaultUnicodeImplFontCharMap->AddReference();
+ else
{
- pRangeCodes = aDefaultSymbolRanges;
- nCodesCount = sizeof(aDefaultSymbolRanges) / sizeof(*pRangeCodes);
+ const sal_uInt32* pRangeCodes = aDefaultUnicodeRanges;
+ int nCodesCount = sizeof(aDefaultUnicodeRanges) / sizeof(*pRangeCodes);
+ CmapResult aDefaultCR( false, pRangeCodes, nCodesCount/2 );
+ pDefaultUnicodeImplFontCharMap = new ImplFontCharMap( aDefaultCR );
}
- CmapResult aDefaultCR( bSymbols, pRangeCodes, nCodesCount/2 );
- pDefaultImplFontCharMap = new ImplFontCharMap( aDefaultCR );
+ return pDefaultUnicodeImplFontCharMap;
}
- return pDefaultImplFontCharMap;
+ ImplFontCharMap *GetDefaultSymbolMap()
+ {
+ if( pDefaultSymbolImplFontCharMap )
+ pDefaultSymbolImplFontCharMap->AddReference();
+ else
+ {
+ const sal_uInt32* pRangeCodes = aDefaultSymbolRanges;
+ int nCodesCount = sizeof(aDefaultSymbolRanges) / sizeof(*pRangeCodes);
+ CmapResult aDefaultCR( true, pRangeCodes, nCodesCount/2 );
+ pDefaultSymbolImplFontCharMap = new ImplFontCharMap( aDefaultCR );
+ }
+
+ return pDefaultSymbolImplFontCharMap;
+ }
+}
+
+ImplFontCharMap* ImplFontCharMap::GetDefaultMap( bool bSymbols)
+{
+ return bSymbols ? GetDefaultSymbolMap() : GetDefaultUnicodeMap();
}
// -----------------------------------------------------------------------
@@ -321,7 +339,7 @@ void ImplFontCharMap::AddReference()
void ImplFontCharMap::DeReference()
{
if( --mnRefCount <= 0 )
- if( this != pDefaultImplFontCharMap )
+ if( (this != pDefaultUnicodeImplFontCharMap) && (this != pDefaultSymbolImplFontCharMap) )
delete this;
}
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index 3826a3dbc7b0..bea307a4c38d 100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -1614,6 +1614,18 @@ void OutputDevice::DrawPixel( const Polygon& rPts, const Color& rColor )
// ------------------------------------------------------------------------
+namespace
+{
+ BYTE lcl_calcColor( const BYTE nSourceColor, const BYTE nSourceOpaq, const BYTE nDestColor )
+ {
+ int c = ( (int)nDestColor * ( 255 - nSourceOpaq ) )
+ + (int)nSourceOpaq * (int)nSourceColor;
+ return BYTE( c / 255 );
+ }
+}
+
+// ------------------------------------------------------------------------
+
Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
BitmapReadAccess* pP,
BitmapReadAccess* pA,
@@ -1626,7 +1638,6 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
const long* pMapY )
{
BitmapColor aDstCol,aSrcCol;
- BYTE nSrcAlpha, nDstAlpha;
Bitmap res;
int nX, nOutX, nY, nOutY;
@@ -1660,36 +1671,23 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
aSrcCol = pP->GetColor( nMapY, nMapX );
aDstCol = pB->GetColor( nY, nX );
- nSrcAlpha = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
- nDstAlpha = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
+ const BYTE nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
+ const BYTE nDstOpaq = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
- if( nSrcAlpha + nDstAlpha == 0 )
- {
- // #i70653# zero alpha -> zero color values
- aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ 0 ] + nD ) >> 16UL ] +
- nVCLGLut[ ( nVCLLut[ 0 ] + nD ) >> 16UL ] +
- nVCLBLut[ ( nVCLLut[ 0 ] + nD ) >> 16UL ] ) );
- }
- else
- {
- aDstCol.SetRed( (BYTE)(((int)(aSrcCol.GetRed())*nSrcAlpha + (int)(aDstCol.GetRed())*nDstAlpha) /
- (nSrcAlpha+nDstAlpha)) );
- aDstCol.SetGreen( (BYTE)(((int)(aSrcCol.GetGreen())*nSrcAlpha + (int)(aDstCol.GetGreen())*nDstAlpha) /
- (nSrcAlpha+nDstAlpha)) );
- aDstCol.SetBlue( (BYTE)(((int)(aSrcCol.GetBlue())*nSrcAlpha + (int)(aDstCol.GetBlue())*nDstAlpha) /
- (nSrcAlpha+nDstAlpha)) );
-
- aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] +
- nVCLGLut[ ( nVCLLut[ aDstCol.GetGreen() ] + nD ) >> 16UL ] +
- nVCLBLut[ ( nVCLLut[ aDstCol.GetBlue() ] + nD ) >> 16UL ] ) );
- }
+ aDstCol.SetRed( lcl_calcColor( aSrcCol.GetRed(), nSrcOpaq, aDstCol.GetRed() ) );
+ aDstCol.SetBlue( lcl_calcColor( aSrcCol.GetBlue(), nSrcOpaq, aDstCol.GetBlue() ) );
+ aDstCol.SetGreen( lcl_calcColor( aSrcCol.GetGreen(), nSrcOpaq, aDstCol.GetGreen() ) );
+
+ aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16UL ] +
+ nVCLGLut[ ( nVCLLut[ aDstCol.GetGreen() ] + nD ) >> 16UL ] +
+ nVCLBLut[ ( nVCLLut[ aDstCol.GetBlue() ] + nD ) >> 16UL ] ) );
pW->SetPixel( nY, nX, aIndex );
// Have to perform the compositing 'algebra' in
// the inverse alpha space (with 255 meaning
// opaque), otherwise, transitivity is not
// achieved.
- nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstAlpha, nSrcAlpha );
+ const BYTE nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstOpaq, nSrcOpaq );
aIndex.SetIndex( (BYTE) ( nVCLRLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] +
nVCLGLut[ ( nVCLLut[ nSrcAlpha ] + nD ) >> 16UL ] +
@@ -1718,25 +1716,12 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
aSrcCol = pP->GetColor( nMapY, nMapX );
aDstCol = pB->GetColor( nY, nX );
- nSrcAlpha = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
- nDstAlpha = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
+ const BYTE nSrcOpaq = 255 - pA->GetPixel( nMapY, nMapX ).GetBlueOrIndex();
+ const BYTE nDstOpaq = 255 - pAlphaW->GetPixel( nY, nX ).GetBlueOrIndex();
- if( nSrcAlpha + nDstAlpha == 0 )
- {
- // #i70653# zero alpha -> zero color values
- aDstCol.SetRed(0);
- aDstCol.SetGreen(0);
- aDstCol.SetBlue(0);
- }
- else
- {
- aDstCol.SetRed( (BYTE)(((int)(aSrcCol.GetRed())*nSrcAlpha + (int)(aDstCol.GetRed())*nDstAlpha) /
- (nSrcAlpha+nDstAlpha)) );
- aDstCol.SetGreen( (BYTE)(((int)(aSrcCol.GetGreen())*nSrcAlpha + (int)(aDstCol.GetGreen())*nDstAlpha) /
- (nSrcAlpha+nDstAlpha)) );
- aDstCol.SetBlue( (BYTE)(((int)(aSrcCol.GetBlue())*nSrcAlpha + (int)(aDstCol.GetBlue())*nDstAlpha) /
- (nSrcAlpha+nDstAlpha)) );
- }
+ aDstCol.SetRed( lcl_calcColor( aSrcCol.GetRed(), nSrcOpaq, aDstCol.GetRed() ) );
+ aDstCol.SetBlue( lcl_calcColor( aSrcCol.GetBlue(), nSrcOpaq, aDstCol.GetBlue() ) );
+ aDstCol.SetGreen( lcl_calcColor( aSrcCol.GetGreen(), nSrcOpaq, aDstCol.GetGreen() ) );
pB->SetPixel( nY, nX, aDstCol );
@@ -1744,7 +1729,7 @@ Bitmap OutputDevice::ImplBlendWithAlpha( Bitmap aBmp,
// the inverse alpha space (with 255 meaning
// opaque), otherwise, transitivity is not
// achieved.
- nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstAlpha, nSrcAlpha );
+ const BYTE nSrcAlpha = 255-COLOR_CHANNEL_MERGE( 255, (BYTE)nDstOpaq, nSrcOpaq );
pAlphaW->SetPixel( nY, nX, Color(nSrcAlpha, nSrcAlpha, nSrcAlpha) );
}
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 949d3df5275f..c4185a77382e 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -1645,10 +1645,25 @@ ImplDevFontListData* ImplDevFontList::ImplFindBySubstFontAttr( const utl::FontNa
pFoundData = ImplFindBySearchName( aSearchName );
if( pFoundData )
- break;
+ return pFoundData;
}
- return pFoundData;
+ // use known attributes from the configuration to find a matching substitute
+ const ULONG nSearchType = rFontAttr.Type;
+ if( nSearchType != 0 )
+ {
+ const FontWeight eSearchWeight = rFontAttr.Weight;
+ const FontWidth eSearchWidth = rFontAttr.Width;
+ const FontItalic eSearchSlant = ITALIC_DONTKNOW;
+ const FontFamily eSearchFamily = FAMILY_DONTKNOW;
+ const String aSearchName;
+ pFoundData = ImplFindByAttributes( nSearchType,
+ eSearchWeight, eSearchWidth, eSearchFamily, eSearchSlant, aSearchName );
+ if( pFoundData )
+ return pFoundData;
+ }
+
+ return NULL;
}
// -----------------------------------------------------------------------
@@ -1889,10 +1904,11 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( ULONG nSearchType,
nTestMatch -= 1000000;
// test font name substrings
- if( (rSearchFamilyName.Len() && pData->maMatchFamilyName.Len())
+ // TODO: calculate name matching score using e.g. Levenstein distance
+ if( (rSearchFamilyName.Len() >= 4) && (pData->maMatchFamilyName.Len() >= 4)
&& ((rSearchFamilyName.Search( pData->maMatchFamilyName ) != STRING_NOTFOUND)
|| (pData->maMatchFamilyName.Search( rSearchFamilyName ) != STRING_NOTFOUND)) )
- nTestMatch += 100000*2;
+ nTestMatch += 5000;
// test SERIF attribute
if( nSearchType & IMPL_FONT_ATTR_SERIF )
@@ -6057,6 +6073,11 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
rtl::OUString aMissingCodes = aMissingCodeBuf.makeStringAndClear();
ImplFontSelectData aFontSelData = mpFontEntry->maFontSelData;
+
+ ImplFontMetricData aOrigMetric( aFontSelData );
+ // TODO: use cached metric in fontentry
+ mpGraphics->GetFontMetric( &aOrigMetric );
+
// when device specific font substitution may have been performed for
// the originally selected font then make sure that a fallback to that
// font is performed first
@@ -6101,7 +6122,27 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
}
#endif
+ // TODO: try to get the metric data from the GFB's mpFontEntry
+ ImplFontMetricData aSubstituteMetric( aFontSelData );
pFallbackFont->mnSetFontFlags = mpGraphics->SetFont( &aFontSelData, nFallbackLevel );
+ mpGraphics->GetFontMetric( &aSubstituteMetric, nFallbackLevel );
+
+ const long nOriginalHeight = aOrigMetric.mnAscent + aOrigMetric.mnDescent;
+ const long nSubstituteHeight = aSubstituteMetric.mnAscent + aSubstituteMetric.mnDescent;
+ // Too tall, shrink it a bit. Need a better calculation to include extra
+ // factors and any extra wriggle room we might have available?
+ // TODO: should we scale by max-ascent/max-descent instead of design height?
+ if( nSubstituteHeight > nOriginalHeight )
+ {
+ const float fScale = nOriginalHeight / (float)nSubstituteHeight;
+ const float fOrigHeight = aFontSelData.mfExactHeight;
+ const int nOrigHeight = aFontSelData.mnHeight;
+ aFontSelData.mfExactHeight *= fScale;
+ aFontSelData.mnHeight = static_cast<int>(aFontSelData.mfExactHeight);
+ pFallbackFont->mnSetFontFlags = mpGraphics->SetFont( &aFontSelData, nFallbackLevel );
+ aFontSelData.mnHeight = nOrigHeight;
+ aFontSelData.mfExactHeight = fOrigHeight;
+ }
// create and add glyph fallback layout to multilayout
rLayoutArgs.ResetPos();
diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx
index 47b150ddc4c5..5b8d228bb141 100644
--- a/vcl/source/gdi/outdev6.cxx
+++ b/vcl/source/gdi/outdev6.cxx
@@ -345,6 +345,12 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
if( OUTDEV_PRINTER == meOutDevType )
{
+ if(100 <= nTransparencePercent)
+ {
+ // #i112959# 100% transparent, draw nothing
+ return;
+ }
+
Rectangle aPolyRect( LogicToPixel( rPolyPoly ).GetBoundRect() );
const Size aDPISize( LogicToPixel( Size( 1, 1 ), MAP_INCH ) );
const long nBaseExtent = Max( FRound( aDPISize.Width() / 300. ), 1L );
@@ -359,30 +365,40 @@ void OutputDevice::DrawTransparent( const PolyPolygon& rPolyPoly,
case( 25 ): nMove = nBaseExtent * 3; break;
case( 50 ): nMove = nBaseExtent * 4; break;
case( 75 ): nMove = nBaseExtent * 6; break;
- // TODO What is the correct VALUE???
+
+ // #i112959# very transparent (88 < nTransparencePercent <= 99)
+ case( 100 ): nMove = nBaseExtent * 8; break;
+
+ // #i112959# not transparent (nTransparencePercent < 13)
default: nMove = 0; break;
}
Push( PUSH_CLIPREGION | PUSH_LINECOLOR );
IntersectClipRegion( rPolyPoly );
SetLineColor( GetFillColor() );
-
- Rectangle aRect( aPolyRect.TopLeft(), Size( aPolyRect.GetWidth(), nBaseExtent ) );
-
const BOOL bOldMap = mbMap;
EnableMapMode( FALSE );
- while( aRect.Top() <= aPolyRect.Bottom() )
+ if(nMove)
{
- DrawRect( aRect );
- aRect.Move( 0, nMove );
- }
+ Rectangle aRect( aPolyRect.TopLeft(), Size( aPolyRect.GetWidth(), nBaseExtent ) );
+ while( aRect.Top() <= aPolyRect.Bottom() )
+ {
+ DrawRect( aRect );
+ aRect.Move( 0, nMove );
+ }
- aRect = Rectangle( aPolyRect.TopLeft(), Size( nBaseExtent, aPolyRect.GetHeight() ) );
- while( aRect.Left() <= aPolyRect.Right() )
+ aRect = Rectangle( aPolyRect.TopLeft(), Size( nBaseExtent, aPolyRect.GetHeight() ) );
+ while( aRect.Left() <= aPolyRect.Right() )
+ {
+ DrawRect( aRect );
+ aRect.Move( nMove, 0 );
+ }
+ }
+ else
{
- DrawRect( aRect );
- aRect.Move( nMove, 0 );
+ // #i112959# if not transparent, draw full rectangle in clip region
+ DrawRect( aPolyRect );
}
EnableMapMode( bOldMap );
@@ -1135,7 +1151,7 @@ void OutputDevice::Erase()
{
ImplControlValue aControlValue;
Point aGcc3WorkaroundTemporary;
- Region aCtrlRegion( Rectangle( aGcc3WorkaroundTemporary, GetOutputSizePixel() ) );
+ Rectangle aCtrlRegion( aGcc3WorkaroundTemporary, GetOutputSizePixel() );
ControlState nState = 0;
if( pWindow->IsEnabled() ) nState |= CTRL_STATE_ENABLED;
diff --git a/vcl/source/gdi/outdevnative.cxx b/vcl/source/gdi/outdevnative.cxx
index fed41ec4de85..521f4d7ea62d 100644
--- a/vcl/source/gdi/outdevnative.cxx
+++ b/vcl/source/gdi/outdevnative.cxx
@@ -59,6 +59,38 @@ static bool lcl_enableNativeWidget( const OutputDevice& i_rDevice )
}
}
+ImplControlValue::~ImplControlValue()
+{
+}
+
+ScrollbarValue::~ScrollbarValue()
+{
+}
+
+SliderValue::~SliderValue()
+{
+}
+
+TabitemValue::~TabitemValue()
+{
+}
+
+SpinbuttonValue::~SpinbuttonValue()
+{
+}
+
+ToolbarValue::~ToolbarValue()
+{
+}
+
+MenubarValue::~MenubarValue()
+{
+}
+
+PushButtonValue::~PushButtonValue()
+{
+}
+
// -----------------------------------------------------------------------
// These functions are mainly passthrough functions that allow access to
// the SalFrame behind a Window object for native widget rendering purposes.
@@ -83,7 +115,7 @@ BOOL OutputDevice::IsNativeControlSupported( ControlType nType, ControlPart nPar
BOOL OutputDevice::HitTestNativeControl( ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
const Point& aPos,
BOOL& rIsInside )
{
@@ -95,7 +127,7 @@ BOOL OutputDevice::HitTestNativeControl( ControlType nType,
return FALSE;
Point aWinOffs( mnOutOffX, mnOutOffY );
- Region screenRegion( rControlRegion );
+ Rectangle screenRegion( rControlRegion );
screenRegion.Move( aWinOffs.X(), aWinOffs.Y());
return( mpGraphics->HitTestNativeControl(nType, nPart, screenRegion, Point( aPos.X() + mnOutOffX, aPos.Y() + mnOutOffY ),
@@ -104,47 +136,117 @@ BOOL OutputDevice::HitTestNativeControl( ControlType nType,
// -----------------------------------------------------------------------
-static void lcl_moveControlValue( ControlType nType, const ImplControlValue& aValue, const Point& rDelta )
+static boost::shared_ptr< ImplControlValue > lcl_transformControlValue( const ImplControlValue& rVal, OutputDevice& rDev )
{
- if( aValue.getOptionalVal() )
+ boost::shared_ptr< ImplControlValue > aResult;
+ switch( rVal.getType() )
{
- switch( nType )
+ case CTRL_SLIDER:
{
- case CTRL_SLIDER:
- {
- SliderValue* pSlVal = reinterpret_cast<SliderValue*>(aValue.getOptionalVal());
- pSlVal->maThumbRect.Move( rDelta.X(), rDelta.Y() );
- }
- break;
- case CTRL_SCROLLBAR:
- {
- ScrollbarValue* pScVal = reinterpret_cast<ScrollbarValue*>(aValue.getOptionalVal());
- pScVal->maThumbRect.Move( rDelta.X(), rDelta.Y() );
- pScVal->maButton1Rect.Move( rDelta.X(), rDelta.Y() );
- pScVal->maButton2Rect.Move( rDelta.X(), rDelta.Y() );
- }
- break;
- case CTRL_SPINBOX:
- case CTRL_SPINBUTTONS:
- {
- SpinbuttonValue* pSpVal = reinterpret_cast<SpinbuttonValue*>(aValue.getOptionalVal());
- pSpVal->maUpperRect.Move( rDelta.X(), rDelta.Y() );
- pSpVal->maLowerRect.Move( rDelta.X(), rDelta.Y() );
- }
- break;
- case CTRL_TOOLBAR:
- {
- ToolbarValue* pTVal = reinterpret_cast<ToolbarValue*>(aValue.getOptionalVal());
- pTVal->maGripRect.Move( rDelta.X(), rDelta.Y() );
- }
+ const SliderValue* pSlVal = static_cast<const SliderValue*>(&rVal);
+ SliderValue* pNew = new SliderValue( *pSlVal );
+ aResult.reset( pNew );
+ pNew->maThumbRect = rDev.ImplLogicToDevicePixel( pSlVal->maThumbRect );
+ }
+ break;
+ case CTRL_SCROLLBAR:
+ {
+ const ScrollbarValue* pScVal = static_cast<const ScrollbarValue*>(&rVal);
+ ScrollbarValue* pNew = new ScrollbarValue( *pScVal );
+ aResult.reset( pNew );
+ pNew->maThumbRect = rDev.ImplLogicToDevicePixel( pScVal->maThumbRect );
+ pNew->maButton1Rect = rDev.ImplLogicToDevicePixel( pScVal->maButton1Rect );
+ pNew->maButton2Rect = rDev.ImplLogicToDevicePixel( pScVal->maButton2Rect );
+ }
+ break;
+ case CTRL_SPINBUTTONS:
+ {
+ const SpinbuttonValue* pSpVal = static_cast<const SpinbuttonValue*>(&rVal);
+ SpinbuttonValue* pNew = new SpinbuttonValue( *pSpVal );
+ aResult.reset( pNew );
+ pNew->maUpperRect = rDev.ImplLogicToDevicePixel( pSpVal->maUpperRect );
+ pNew->maLowerRect = rDev.ImplLogicToDevicePixel( pSpVal->maLowerRect );
+ }
+ break;
+ case CTRL_TOOLBAR:
+ {
+ const ToolbarValue* pTVal = static_cast<const ToolbarValue*>(&rVal);
+ ToolbarValue* pNew = new ToolbarValue( *pTVal );
+ aResult.reset( pNew );
+ pNew->maGripRect = rDev.ImplLogicToDevicePixel( pTVal->maGripRect );
+ }
+ break;
+ case CTRL_TAB_ITEM:
+ {
+ const TabitemValue* pTIVal = static_cast<const TabitemValue*>(&rVal);
+ TabitemValue* pNew = new TabitemValue( *pTIVal );
+ aResult.reset( pNew );
+ }
+ break;
+ case CTRL_MENUBAR:
+ {
+ const MenubarValue* pMVal = static_cast<const MenubarValue*>(&rVal);
+ MenubarValue* pNew = new MenubarValue( *pMVal );
+ aResult.reset( pNew );
+ }
+ break;
+ case CTRL_PUSHBUTTON:
+ {
+ const PushButtonValue* pBVal = static_cast<const PushButtonValue*>(&rVal);
+ PushButtonValue* pNew = new PushButtonValue( *pBVal );
+ aResult.reset( pNew );
+ }
+ break;
+ case CTRL_GENERIC:
+ aResult.reset( new ImplControlValue( rVal ) );
break;
+ default:
+ OSL_ENSURE( 0, "unknown ImplControlValue type !" );
+ break;
+ }
+ return aResult;
+}
+
+#if 0
+static void lcl_moveControlValue( ControlType nType, const ImplControlValue& aValue, const Point& rDelta )
+{
+ switch( aValue.getType() )
+ {
+ case CTRL_SLIDER:
+ {
+ SliderValue* pSlVal = static_cast<SliderValue*>(const_cast<ImplControlValue*>(&aValue));
+ pSlVal->maThumbRect.Move( rDelta.X(), rDelta.Y() );
+ }
+ break;
+ case CTRL_SCROLLBAR:
+ {
+ ScrollbarValue* pScVal = static_cast<ScrollbarValue*>(const_cast<ImplControlValue*>(&aValue));
+ pScVal->maThumbRect.Move( rDelta.X(), rDelta.Y() );
+ pScVal->maButton1Rect.Move( rDelta.X(), rDelta.Y() );
+ pScVal->maButton2Rect.Move( rDelta.X(), rDelta.Y() );
+ }
+ break;
+ case CTRL_SPINBOX:
+ case CTRL_SPINBUTTONS:
+ {
+ SpinbuttonValue* pSpVal = static_cast<SpinbuttonValue*>(const_cast<ImplControlValue*>(&aValue));
+ pSpVal->maUpperRect.Move( rDelta.X(), rDelta.Y() );
+ pSpVal->maLowerRect.Move( rDelta.X(), rDelta.Y() );
+ }
+ break;
+ case CTRL_TOOLBAR:
+ {
+ ToolbarValue* pTVal = static_cast<ToolbarValue*>(const_cast<ImplControlValue*>(&aValue));
+ pTVal->maGripRect.Move( rDelta.X(), rDelta.Y() );
}
+ break;
}
}
+#endif
BOOL OutputDevice::DrawNativeControl( ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
::rtl::OUString aCaption )
@@ -183,22 +285,15 @@ BOOL OutputDevice::DrawNativeControl( ControlType nType,
// Convert the coordinates from relative to Window-absolute, so we draw
// in the correct place in platform code
- Point aWinOffs( mnOutOffX, mnOutOffY );
- Region screenRegion( rControlRegion );
- screenRegion.Move( aWinOffs.X(), aWinOffs.Y());
-
- // do so for ImplControlValue members, also
- lcl_moveControlValue( nType, aValue, aWinOffs );
+ boost::shared_ptr< ImplControlValue > aScreenCtrlValue( lcl_transformControlValue( aValue, *this ) );
+ Rectangle screenRegion( ImplLogicToDevicePixel( rControlRegion ) );
Region aTestRegion( GetActiveClipRegion() );
aTestRegion.Intersect( rControlRegion );
if( aTestRegion == rControlRegion )
nState |= CTRL_CACHING_ALLOWED; // control is not clipped, caching allowed
- BOOL bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, aValue, aCaption, this );
-
- // transform back ImplControlValue members
- lcl_moveControlValue( nType, aValue, Point()-aWinOffs );
+ BOOL bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this );
return bRet;
}
@@ -208,7 +303,7 @@ BOOL OutputDevice::DrawNativeControl( ControlType nType,
BOOL OutputDevice::DrawNativeControlText(ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
::rtl::OUString aCaption )
@@ -233,15 +328,10 @@ BOOL OutputDevice::DrawNativeControlText(ControlType nType,
// Convert the coordinates from relative to Window-absolute, so we draw
// in the correct place in platform code
- Point aWinOffs( mnOutOffX, mnOutOffY );
- Region screenRegion( rControlRegion );
- screenRegion.Move( aWinOffs.X(), aWinOffs.Y());
- lcl_moveControlValue( nType, aValue, aWinOffs );
-
- BOOL bRet = mpGraphics->DrawNativeControlText(nType, nPart, screenRegion, nState, aValue, aCaption, this );
+ boost::shared_ptr< ImplControlValue > aScreenCtrlValue( lcl_transformControlValue( aValue, *this ) );
+ Rectangle screenRegion( ImplLogicToDevicePixel( rControlRegion ) );
- // transform back ImplControlValue members
- lcl_moveControlValue( nType, aValue, Point()-aWinOffs );
+ BOOL bRet = mpGraphics->DrawNativeControlText(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this );
return bRet;
}
@@ -251,12 +341,12 @@ BOOL OutputDevice::DrawNativeControlText(ControlType nType,
BOOL OutputDevice::GetNativeControlRegion( ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
::rtl::OUString aCaption,
- Region &rNativeBoundingRegion,
- Region &rNativeContentRegion )
+ Rectangle &rNativeBoundingRegion,
+ Rectangle &rNativeContentRegion )
{
if( !lcl_enableNativeWidget( *this ) )
return FALSE;
@@ -267,22 +357,18 @@ BOOL OutputDevice::GetNativeControlRegion( ControlType nType,
// Convert the coordinates from relative to Window-absolute, so we draw
// in the correct place in platform code
- Point aWinOffs( mnOutOffX, mnOutOffY );
- Region screenRegion( rControlRegion );
- screenRegion.Move( aWinOffs.X(), aWinOffs.Y());
- lcl_moveControlValue( nType, aValue, aWinOffs );
+ boost::shared_ptr< ImplControlValue > aScreenCtrlValue( lcl_transformControlValue( aValue, *this ) );
+ Rectangle screenRegion( ImplLogicToDevicePixel( rControlRegion ) );
- BOOL bRet = mpGraphics->GetNativeControlRegion(nType, nPart, screenRegion, nState, aValue,
+ BOOL bRet = mpGraphics->GetNativeControlRegion(nType, nPart, screenRegion, nState, *aScreenCtrlValue,
aCaption, rNativeBoundingRegion,
rNativeContentRegion, this );
if( bRet )
{
// transform back native regions
- rNativeBoundingRegion.Move( -aWinOffs.X(), -aWinOffs.Y() );
- rNativeContentRegion.Move( -aWinOffs.X(), -aWinOffs.Y() );
+ rNativeBoundingRegion = ImplDevicePixelToLogic( rNativeBoundingRegion );
+ rNativeContentRegion = ImplDevicePixelToLogic( rNativeContentRegion );
}
- // transform back ImplControlValue members
- lcl_moveControlValue( nType, aValue, Point()-aWinOffs );
return bRet;
}
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 6cb0a7d07697..7b7f3bbcb4d3 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -32,6 +32,7 @@
#include <math.h>
#include <algorithm>
+#include <tools/urlobj.hxx>
#include <pdfwriter_impl.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 191f8f26dc75..f6bd81ef1bea 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -150,6 +150,7 @@ public:
typedef std::hash_map< rtl::OUString, size_t, rtl::OUStringHash > PropertyToIndexMap;
typedef std::hash_map< rtl::OUString, ControlDependency, rtl::OUStringHash > ControlDependencyMap;
+ typedef std::hash_map< rtl::OUString, Sequence< sal_Bool >, rtl::OUStringHash > ChoiceDisableMap;
boost::shared_ptr<Printer> mpPrinter;
Sequence< PropertyValue > maUIOptions;
@@ -158,6 +159,7 @@ public:
PropertyToIndexMap maPropertyToIndex;
Link maOptionChangeHdl;
ControlDependencyMap maControlDependencies;
+ ChoiceDisableMap maChoiceDisableMap;
sal_Bool mbFirstPage;
sal_Bool mbLastPage;
sal_Bool mbReversePageOrder;
@@ -1299,6 +1301,7 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_
bool bHaveProperty = false;
rtl::OUString aPropName;
vcl::ImplPrinterControllerData::ControlDependency aDep;
+ Sequence< sal_Bool > aChoicesDisabled;
for( int n = 0; n < aOptProp.getLength(); n++ )
{
const beans::PropertyValue& rEntry( aOptProp[ n ] );
@@ -1326,6 +1329,10 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_
{
rEntry.Value >>= aDep.mnDependsOnEntry;
}
+ else if( rEntry.Name.equalsAscii( "ChoicesDisabled" ) )
+ {
+ rEntry.Value >>= aChoicesDisabled;
+ }
}
if( bHaveProperty )
{
@@ -1338,6 +1345,8 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_
}
if( aDep.maDependsOnName.getLength() > 0 )
mpImplData->maControlDependencies[ aPropName ] = aDep;
+ if( aChoicesDisabled.getLength() > 0 )
+ mpImplData->maChoiceDisableMap[ aPropName ] = aChoicesDisabled;
}
}
}
@@ -1413,6 +1422,20 @@ bool PrinterController::isUIOptionEnabled( const rtl::OUString& i_rProperty ) co
return bEnabled;
}
+bool PrinterController::isUIChoiceEnabled( const rtl::OUString& i_rProperty, sal_Int32 i_nValue ) const
+{
+ bool bEnabled = true;
+ ImplPrinterControllerData::ChoiceDisableMap::const_iterator it =
+ mpImplData->maChoiceDisableMap.find( i_rProperty );
+ if(it != mpImplData->maChoiceDisableMap.end() )
+ {
+ const Sequence< sal_Bool >& rDisabled( it->second );
+ if( i_nValue >= 0 && i_nValue < rDisabled.getLength() )
+ bEnabled = ! rDisabled[i_nValue];
+ }
+ return bEnabled;
+}
+
rtl::OUString PrinterController::getDependency( const rtl::OUString& i_rProperty ) const
{
rtl::OUString aDependency;
@@ -1789,14 +1812,20 @@ Any PrinterOptionsHelper::getChoiceControlOpt( const rtl::OUString& i_rTitle,
const Sequence< rtl::OUString >& i_rChoices,
sal_Int32 i_nValue,
const rtl::OUString& i_rType,
+ const Sequence< sal_Bool >& i_rDisabledChoices,
const PrinterOptionsHelper::UIControlOptions& i_rControlOptions
)
{
UIControlOptions aOpt( i_rControlOptions );
sal_Int32 nUsed = aOpt.maAddProps.getLength();
- aOpt.maAddProps.realloc( nUsed + 1 );
+ aOpt.maAddProps.realloc( nUsed + 1 + (i_rDisabledChoices.getLength() ? 1 : 0) );
aOpt.maAddProps[nUsed].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Choices" ) );
aOpt.maAddProps[nUsed].Value = makeAny( i_rChoices );
+ if( i_rDisabledChoices.getLength() )
+ {
+ aOpt.maAddProps[nUsed+1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ChoicesDisabled" ) );
+ aOpt.maAddProps[nUsed+1].Value = makeAny( i_rDisabledChoices );
+ }
PropertyValue aVal;
aVal.Name = i_rProperty;
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index 7a6808a0e392..97e11c5a6aa4 100644..100755
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -669,13 +669,13 @@ BOOL SalGraphics::DrawEPS( long nX, long nY, long nWidth, long nHeight, void*
return drawEPS( nX, nY, nWidth, nHeight, pPtr, nSize );
}
-BOOL SalGraphics::HitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+BOOL SalGraphics::HitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
const Point& aPos, BOOL& rIsInside, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
Point pt( aPos );
- Region rgn( rControlRegion );
+ Rectangle rgn( rControlRegion );
mirror( pt.X(), pOutDev );
mirror( rgn, pOutDev );
return hitTestNativeControl( nType, nPart, rgn, pt, rIsInside );
@@ -684,51 +684,48 @@ BOOL SalGraphics::HitTestNativeControl( ControlType nType, ControlPart nPart, co
return hitTestNativeControl( nType, nPart, rControlRegion, aPos, rIsInside );
}
-void SalGraphics::mirror( ControlType nType, const ImplControlValue& rVal, const OutputDevice* pOutDev, bool bBack ) const
+void SalGraphics::mirror( ControlType , const ImplControlValue& rVal, const OutputDevice* pOutDev, bool bBack ) const
{
- if( rVal.getOptionalVal() )
+ switch( rVal.getType() )
{
- switch( nType )
+ case CTRL_SLIDER:
{
- case CTRL_SLIDER:
- {
- SliderValue* pSlVal = reinterpret_cast<SliderValue*>(rVal.getOptionalVal());
- mirror(pSlVal->maThumbRect,pOutDev,bBack);
- }
- break;
- case CTRL_SCROLLBAR:
- {
- ScrollbarValue* pScVal = reinterpret_cast<ScrollbarValue*>(rVal.getOptionalVal());
- mirror(pScVal->maThumbRect,pOutDev,bBack);
- mirror(pScVal->maButton1Rect,pOutDev,bBack);
- mirror(pScVal->maButton2Rect,pOutDev,bBack);
- }
- break;
- case CTRL_SPINBOX:
- case CTRL_SPINBUTTONS:
- {
- SpinbuttonValue* pSpVal = reinterpret_cast<SpinbuttonValue*>(rVal.getOptionalVal());
- mirror(pSpVal->maUpperRect,pOutDev,bBack);
- mirror(pSpVal->maLowerRect,pOutDev,bBack);
- }
- break;
- case CTRL_TOOLBAR:
- {
- ToolbarValue* pTVal = reinterpret_cast<ToolbarValue*>(rVal.getOptionalVal());
- mirror(pTVal->maGripRect,pOutDev,bBack);
- }
- break;
+ SliderValue* pSlVal = static_cast<SliderValue*>(const_cast<ImplControlValue*>(&rVal));
+ mirror(pSlVal->maThumbRect,pOutDev,bBack);
+ }
+ break;
+ case CTRL_SCROLLBAR:
+ {
+ ScrollbarValue* pScVal = static_cast<ScrollbarValue*>(const_cast<ImplControlValue*>(&rVal));
+ mirror(pScVal->maThumbRect,pOutDev,bBack);
+ mirror(pScVal->maButton1Rect,pOutDev,bBack);
+ mirror(pScVal->maButton2Rect,pOutDev,bBack);
+ }
+ break;
+ case CTRL_SPINBOX:
+ case CTRL_SPINBUTTONS:
+ {
+ SpinbuttonValue* pSpVal = static_cast<SpinbuttonValue*>(const_cast<ImplControlValue*>(&rVal));
+ mirror(pSpVal->maUpperRect,pOutDev,bBack);
+ mirror(pSpVal->maLowerRect,pOutDev,bBack);
+ }
+ break;
+ case CTRL_TOOLBAR:
+ {
+ ToolbarValue* pTVal = static_cast<ToolbarValue*>(const_cast<ImplControlValue*>(&rVal));
+ mirror(pTVal->maGripRect,pOutDev,bBack);
}
+ break;
}
}
-BOOL SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+BOOL SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const OUString& aCaption, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
- Region rgn( rControlRegion );
+ Rectangle rgn( rControlRegion );
mirror( rgn, pOutDev );
mirror( nType, aValue, pOutDev );
BOOL bRet = drawNativeControl( nType, nPart, rgn, nState, aValue, aCaption );
@@ -739,13 +736,13 @@ BOOL SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const
return drawNativeControl( nType, nPart, rControlRegion, nState, aValue, aCaption );
}
-BOOL SalGraphics::DrawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+BOOL SalGraphics::DrawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const OUString& aCaption, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
- Region rgn( rControlRegion );
+ Rectangle rgn( rControlRegion );
mirror( rgn, pOutDev );
mirror( nType, aValue, pOutDev );
BOOL bRet = drawNativeControlText( nType, nPart, rgn, nState, aValue, aCaption );
@@ -756,13 +753,13 @@ BOOL SalGraphics::DrawNativeControlText( ControlType nType, ControlPart nPart, c
return drawNativeControlText( nType, nPart, rControlRegion, nState, aValue, aCaption );
}
-BOOL SalGraphics::GetNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState,
+BOOL SalGraphics::GetNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const OUString& aCaption,
- Region &rNativeBoundingRegion, Region &rNativeContentRegion, const OutputDevice *pOutDev )
+ Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion, const OutputDevice *pOutDev )
{
if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (pOutDev && pOutDev->IsRTLEnabled()) )
{
- Region rgn( rControlRegion );
+ Rectangle rgn( rControlRegion );
mirror( rgn, pOutDev );
mirror( nType, aValue, pOutDev );
if( getNativeControlRegion( nType, nPart, rgn, nState, aValue, aCaption,
diff --git a/vcl/source/gdi/salnativewidgets-none.cxx b/vcl/source/gdi/salnativewidgets-none.cxx
index 7faf12d062fe..8aa0e47f1a35 100644
--- a/vcl/source/gdi/salnativewidgets-none.cxx
+++ b/vcl/source/gdi/salnativewidgets-none.cxx
@@ -58,7 +58,7 @@ BOOL SalGraphics::IsNativeControlSupported( ControlType, ControlPart )
*/
BOOL SalGraphics::hitTestNativeControl( ControlType,
ControlPart,
- const Region&,
+ const Rectangle&,
const Point&,
BOOL& )
{
@@ -77,7 +77,7 @@ BOOL SalGraphics::hitTestNativeControl( ControlType,
*/
BOOL SalGraphics::drawNativeControl( ControlType,
ControlPart,
- const Region&,
+ const Rectangle&,
ControlState,
const ImplControlValue&,
const OUString& )
@@ -98,7 +98,7 @@ BOOL SalGraphics::drawNativeControl( ControlType,
*/
BOOL SalGraphics::drawNativeControlText( ControlType,
ControlPart,
- const Region&,
+ const Rectangle&,
ControlState,
const ImplControlValue&,
const OUString& )
@@ -122,12 +122,12 @@ BOOL SalGraphics::drawNativeControlText( ControlType,
*/
BOOL SalGraphics::getNativeControlRegion( ControlType,
ControlPart,
- const Region&,
+ const Rectangle&,
ControlState,
const ImplControlValue&,
const OUString&,
- Region &,
- Region & )
+ Rectangle &,
+ Rectangle & )
{
return( FALSE );
}
diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index ebdd59f517af..aeb928c46608 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -895,6 +895,9 @@ void FreetypeServerFont::SetFontOptions( const ImplFontOptions& rFontOptions)
}
}
#endif
+
+ if( mnPrioEmbedded <= 0 )
+ mnLoadFlags |= FT_LOAD_NO_BITMAP;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/glyphs/graphite_adaptors.cxx b/vcl/source/glyphs/graphite_adaptors.cxx
index f66f5b48e39e..f82e3afe39c8 100644
--- a/vcl/source/glyphs/graphite_adaptors.cxx
+++ b/vcl/source/glyphs/graphite_adaptors.cxx
@@ -99,12 +99,18 @@ FontProperties::FontProperties(const FreetypeServerFont &font) throw()
fItalic = false;
}
- // Get the font name.
+ // Get the font name, but prefix with file name hash in case
+ // there are 2 fonts on the system with the same face name
+ sal_Int32 nHashCode = font.GetFontFileName()->hashCode();
+ ::rtl::OUStringBuffer nHashFaceName;
+ nHashFaceName.append(nHashCode, 16);
const sal_Unicode * name = font.GetFontSelData().maName.GetBuffer();
- const size_t name_sz = std::min(sizeof szFaceName/sizeof(wchar_t)-1,
- size_t(font.GetFontSelData().maName.Len()));
+ nHashFaceName.append(name);
- std::copy(name, name + name_sz, szFaceName);
+ const size_t name_sz = std::min(sizeof szFaceName/sizeof(wchar_t)-1,
+ static_cast<size_t>(nHashFaceName.getLength()));
+
+ std::copy(nHashFaceName.getStr(), nHashFaceName.getStr() + name_sz, szFaceName);
szFaceName[name_sz] = '\0';
}
@@ -120,13 +126,13 @@ GraphiteFontAdaptor::GraphiteFontAdaptor(ServerFont & sfont, const sal_Int32 dpi
mfEmUnits(static_cast<FreetypeServerFont &>(sfont).GetMetricsFT().y_ppem),
mpFeatures(NULL)
{
- //std::wstring face_name(maFontProperties.szFaceName);
const rtl::OString aLang = MsLangId::convertLanguageToIsoByteString( sfont.GetFontSelData().meLanguage );
-#ifdef DEBUG
- printf("GraphiteFontAdaptor %lx\n", (long)this);
-#endif
rtl::OString name = rtl::OUStringToOString(
sfont.GetFontSelData().maTargetName, RTL_TEXTENCODING_UTF8 );
+#ifdef DEBUG
+ printf("GraphiteFontAdaptor %lx %s italic=%u bold=%u\n", (long)this, name.getStr(),
+ maFontProperties.fItalic, maFontProperties.fBold);
+#endif
sal_Int32 nFeat = name.indexOf(grutils::GrFeatureParser::FEAT_PREFIX) + 1;
if (nFeat > 0)
{
@@ -259,21 +265,24 @@ const void * GraphiteFontAdaptor::getTable(gr::fontTableId32 table_id, size_t *
// Return the glyph's metrics in pixels.
void GraphiteFontAdaptor::getGlyphMetrics(gr::gid16 nGlyphId, gr::Rect & aBounding, gr::Point & advances)
{
- // Graphite gets really confused if the glyphs have been transformed, so
- // if orientation has been set we can't use the font's glyph cache
- // unfortunately the font selection data, doesn't always have the orientation
- // set, even if it was when the glyphs were cached, so we use our own cache.
-
-// const GlyphMetric & metric = mrFont.GetGlyphMetric(nGlyphId);
-//
-// aBounding.right = aBounding.left = metric.GetOffset().X();
-// aBounding.bottom = aBounding.top = -metric.GetOffset().Y();
-// aBounding.right += metric.GetSize().Width();
-// aBounding.bottom -= metric.GetSize().Height();
-//
-// advances.x = metric.GetDelta().X();
-// advances.y = -metric.GetDelta().Y();
-
+ // There used to be problems when orientation was set however, this no
+ // longer seems to be the case and the Glyph Metric cache in
+ // FreetypeServerFont is more efficient since it lasts between calls to VCL
+#if 1
+ const GlyphMetric & metric = mrFont.GetGlyphMetric(nGlyphId);
+
+ aBounding.right = aBounding.left = metric.GetOffset().X();
+ aBounding.bottom = aBounding.top = -metric.GetOffset().Y();
+ aBounding.right += metric.GetSize().Width();
+ aBounding.bottom -= metric.GetSize().Height();
+
+ advances.x = metric.GetDelta().X();
+ advances.y = -metric.GetDelta().Y();
+
+#else
+ // The problem with the code below is that the cache only lasts
+ // as long as the life time of the GraphiteFontAdaptor, which
+ // is created once per call to X11SalGraphics::GetTextLayout
GlyphMetricMap::const_iterator gm_itr = maGlyphMetricMap.find(nGlyphId);
if (gm_itr != maGlyphMetricMap.end())
{
@@ -321,6 +330,7 @@ void GraphiteFontAdaptor::getGlyphMetrics(gr::gid16 nGlyphId, gr::Rect & aBoundi
// Now add an entry to our metrics map.
maGlyphMetricMap[nGlyphId] = std::make_pair(aBounding, advances);
}
+#endif
}
#endif
diff --git a/vcl/source/glyphs/graphite_cache.cxx b/vcl/source/glyphs/graphite_cache.cxx
index 5582c1eecc93..7682cdb6c8ba 100644
--- a/vcl/source/glyphs/graphite_cache.cxx
+++ b/vcl/source/glyphs/graphite_cache.cxx
@@ -105,7 +105,7 @@ GrSegRecord * GraphiteSegmentCache::cacheSegment(TextSourceAdaptor * adapter, gr
// when the next key is added, the record for the prevKey's m_nextKey field
// is updated to the newest key so that m_oldestKey can be updated to the
// next oldest key when the record for m_oldestKey is deleted
- if (m_segMap.size() > SEG_CACHE_SIZE)
+ if (m_segMap.size() > m_nSegCacheSize)
{
GraphiteSegMap::iterator oldestPair = m_segMap.find(reinterpret_cast<long>(m_oldestKey));
// oldest record may no longer exist if a buffer was changed
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index de3ae3ada505..b677cdb108b9 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -56,6 +56,10 @@
#include <svsys.h>
#endif
+#ifdef UNX
+#include <vcl/graphite_adaptors.hxx>
+#endif
+
#include <vcl/salgdi.hxx>
#include <unicode/uchar.h>
@@ -175,7 +179,8 @@ GraphiteLayout::Glyphs::fill_from(gr::Segment & rSegment, ImplLayoutArgs &rArgs,
glyph_range_t iGlyphs = rSegment.glyphs();
int nGlyphs = iGlyphs.second - iGlyphs.first;
gr::GlyphIterator prevBase = iGlyphs.second;
- float fMinX = rSegment.advanceWidth();
+ float fSegmentAdvance = rSegment.advanceWidth();
+ float fMinX = fSegmentAdvance;
float fMaxX = 0.0f;
rGlyph2Char.assign(nGlyphs, -1);
long nDxOffset = 0;
@@ -222,7 +227,8 @@ GraphiteLayout::Glyphs::fill_from(gr::Segment & rSegment, ImplLayoutArgs &rArgs,
nFirstGlyphInCluster != nGlyphIndex)
{
std::pair <float,float> aBounds =
- appendCluster(rSegment, rArgs, bRtl, nFirstCharInCluster,
+ appendCluster(rSegment, rArgs, bRtl,
+ fSegmentAdvance, nFirstCharInCluster,
nNextChar, nFirstGlyphInCluster, nGlyphIndex, fScaling,
rChar2Base, rGlyph2Char, rCharDxs, nDxOffset);
fMinX = std::min(aBounds.first, fMinX);
@@ -285,7 +291,8 @@ GraphiteLayout::Glyphs::fill_from(gr::Segment & rSegment, ImplLayoutArgs &rArgs,
nFirstGlyphInCluster != nGlyphIndex)
{
std::pair <float,float> aBounds =
- appendCluster(rSegment, rArgs, bRtl, nFirstCharInCluster, nNextChar,
+ appendCluster(rSegment, rArgs, bRtl, fSegmentAdvance,
+ nFirstCharInCluster, nNextChar,
nFirstGlyphInCluster, nGlyphIndex, fScaling,
rChar2Base, rGlyph2Char, rCharDxs, nDxOffset);
fMinX = std::min(aBounds.first, fMinX);
@@ -334,11 +341,11 @@ GraphiteLayout::Glyphs::fill_from(gr::Segment & rSegment, ImplLayoutArgs &rArgs,
}
}
-std::pair<float,float> GraphiteLayout::Glyphs::appendCluster(gr::Segment & rSeg,
- ImplLayoutArgs & rArgs, bool bRtl, int nFirstCharInCluster, int nNextChar,
- int nFirstGlyphInCluster, int nNextGlyph, float fScaling,
- std::vector<int> & rChar2Base, std::vector<int> & rGlyph2Char,
- std::vector<int> & rCharDxs, long & rDXOffset)
+std::pair<float,float> GraphiteLayout::Glyphs::appendCluster(gr::Segment& rSeg,
+ ImplLayoutArgs & rArgs, bool bRtl,float fSegmentAdvance,
+ int nFirstCharInCluster, int nNextChar, int nFirstGlyphInCluster,
+ int nNextGlyph, float fScaling, std::vector<int> & rChar2Base,
+ std::vector<int> & rGlyph2Char, std::vector<int> & rCharDxs, long & rDXOffset)
{
glyph_range_t iGlyphs = rSeg.glyphs();
int nGlyphs = iGlyphs.second - iGlyphs.first;
@@ -402,9 +409,9 @@ std::pair<float,float> GraphiteLayout::Glyphs::appendCluster(gr::Segment & rSeg,
gr::GlyphInfo aGlyph = *(iGlyphs.first + j);
if (j + nDelta >= nGlyphs || j + nDelta < 0) // at rhs ltr,rtl
{
- fNextOrigin = rSeg.advanceWidth();
- nNextOrigin = round(rSeg.advanceWidth() * fScaling + rDXOffset);
- aBounds.second = std::max(rSeg.advanceWidth(), aBounds.second);
+ fNextOrigin = fSegmentAdvance;
+ nNextOrigin = round(fSegmentAdvance * fScaling + rDXOffset);
+ aBounds.second = std::max(fSegmentAdvance, aBounds.second);
}
else
{
@@ -546,7 +553,7 @@ GraphiteLayout::GraphiteLayout(const gr::Font & font, const grutils::GrFeaturePa
// If true, it can cause end of line spaces to be hidden e.g. Doulos SIL
maLayout.setStartOfLine(false);
maLayout.setEndOfLine(false);
-// maLayout.setDumbFallback(false);
+ maLayout.setDumbFallback(true);
// trailing ws doesn't seem to always take affect if end of line is true
maLayout.setTrailingWs(gr::ktwshAll);
#ifdef GRLAYOUT_DEBUG
@@ -598,6 +605,8 @@ bool GraphiteLayout::LayoutText(ImplLayoutArgs & rArgs)
else delete pSegment;
#else
gr::Segment * pSegment = CreateSegment(rArgs);
+ if (!pSegment)
+ return false;
bool success = LayoutGlyphs(rArgs, pSegment);
delete pSegment;
#endif
@@ -649,7 +658,19 @@ public:
#endif
return hash;
};
-
+protected:
+ virtual void UniqueCacheInfo(std::wstring & stuFace, bool & fBold, bool & fItalic)
+ {
+#ifdef WIN32
+ dynamic_cast<GraphiteWinFont&>(mrRealFont).UniqueCacheInfo(stuFace, fBold, fItalic);
+#else
+#ifdef UNX
+ dynamic_cast<GraphiteFontAdaptor&>(mrRealFont).UniqueCacheInfo(stuFace, fBold, fItalic);
+#else
+#error Unknown base type for gr::Font::UniqueCacheInfo
+#endif
+#endif
+ }
private:
gr::Font & mrRealFont;
};
@@ -738,6 +759,14 @@ gr::Segment * GraphiteLayout::CreateSegment(ImplLayoutArgs& rArgs)
}
else
{
+#ifdef GRLAYOUT_DEBUG
+ fprintf(grLog(), "Gr::LayoutText failed: ");
+ for (int i = mnMinCharPos; i < limit; i++)
+ {
+ fprintf(grLog(), "%04x ", rArgs.mpStr[i]);
+ }
+ fprintf(grLog(), "\n");
+#endif
clear();
return NULL;
}
@@ -897,7 +926,7 @@ long GraphiteLayout::FillDXArray( sal_Int32* pDXArray ) const
if (i > 0) pDXArray[i] -= mvCharDxs[i-1];
}
#ifdef GRLAYOUT_DEBUG
- fprintf(grLog(),"%d,%d,%ld ", (int)i, (int)mvCharDxs[i], pDXArray[i]);
+ fprintf(grLog(),"%d,%d,%d ", (int)i, (int)mvCharDxs[i], pDXArray[i]);
#endif
}
//std::adjacent_difference(mvCharDxs.begin(), mvCharDxs.end(), pDXArray);
@@ -974,13 +1003,13 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs)
{
if (mvGlyphs[i].IsClusterStart())
{
- nOffset = fExtraPerCluster * nCluster;
+ nOffset = FRound( fExtraPerCluster * nCluster );
size_t nCharIndex = mvGlyph2Char[i];
mvCharDxs[nCharIndex] += nOffset;
// adjust char dxs for rest of characters in cluster
while (++nCharIndex < mvGlyph2Char.size())
{
- int nChar2Base = (mvChar2BaseGlyph[nCharIndex] == -1)? -1 : mvChar2BaseGlyph[nCharIndex] & GLYPH_INDEX_MASK;
+ int nChar2Base = (mvChar2BaseGlyph[nCharIndex] == -1)? -1 : (int)(mvChar2BaseGlyph[nCharIndex] & GLYPH_INDEX_MASK);
if (nChar2Base == -1 || nChar2Base == static_cast<int>(i))
mvCharDxs[nCharIndex] += nOffset;
}
@@ -1003,12 +1032,12 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs)
Glyphs::iterator iGlyph = mvGlyphs.begin();
while (iGlyph != iLastGlyph)
{
- iGlyph->maLinearPos.X() = static_cast<float>(iGlyph->maLinearPos.X()) * fXFactor;
+ iGlyph->maLinearPos.X() = FRound( fXFactor * iGlyph->maLinearPos.X() );
++iGlyph;
}
for (size_t i = 0; i < mvCharDxs.size(); i++)
{
- mvCharDxs[i] = fXFactor * static_cast<float>(mvCharDxs[i]);
+ mvCharDxs[i] = FRound( fXFactor * mvCharDxs[i] );
}
}
}
@@ -1020,7 +1049,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
#ifdef GRLAYOUT_DEBUG
for (size_t iDx = 0; iDx < mvCharDxs.size(); iDx++)
- fprintf(grLog(),"%d,%d,%ld ", (int)iDx, (int)mvCharDxs[iDx], args.mpDXArray[iDx]);
+ fprintf(grLog(),"%d,%d,%d ", (int)iDx, (int)mvCharDxs[iDx], args.mpDXArray[iDx]);
fprintf(grLog(),"ApplyDx\n");
#endif
bool bRtl = mnLayoutFlags & SAL_LAYOUT_BIDI_RTL;
@@ -1033,7 +1062,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
int nPrevClusterLastChar = -1;
for (size_t i = 0; i < nChars; i++)
{
- int nChar2Base = (mvChar2BaseGlyph[i] == -1)? -1 : mvChar2BaseGlyph[i] & GLYPH_INDEX_MASK;
+ int nChar2Base = (mvChar2BaseGlyph[i] == -1)? -1 : (int)(mvChar2BaseGlyph[i] & GLYPH_INDEX_MASK);
if ((nChar2Base > -1) && (nChar2Base != nPrevClusterGlyph))
{
assert((nChar2Base > -1) && (nChar2Base < (signed)mvGlyphs.size()));
@@ -1047,11 +1076,11 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
int nLastGlyph = nChar2Base;
for (; j < nChars; j++)
{
- int nChar2BaseJ = (mvChar2BaseGlyph[j] == -1)? -1 : mvChar2BaseGlyph[j] & GLYPH_INDEX_MASK;
+ int nChar2BaseJ = (mvChar2BaseGlyph[j] == -1)? -1 : (int)(mvChar2BaseGlyph[j] & GLYPH_INDEX_MASK);
assert((nChar2BaseJ >= -1) && (nChar2BaseJ < (signed)mvGlyphs.size()));
if (nChar2BaseJ != -1 && mvGlyphs[nChar2BaseJ].IsClusterStart())
{
- nLastGlyph = nChar2BaseJ + ((bRtl)? 1 : -1);
+ nLastGlyph = nChar2BaseJ + ((bRtl)? +1 : -1);
nLastChar = j - 1;
break;
}
@@ -1090,7 +1119,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
}
long nDWidth = nNewClusterWidth - nOrigClusterWidth;
#ifdef GRLAYOUT_DEBUG
- fprintf(grLog(), "c%d last glyph %d/%d\n", i, nLastGlyph, mvGlyphs.size());
+ fprintf(grLog(), "c%lu last glyph %d/%lu\n", i, nLastGlyph, mvGlyphs.size());
#endif
assert((nLastGlyph > -1) && (nLastGlyph < (signed)mvGlyphs.size()));
mvGlyphs[nLastGlyph].mnNewWidth += nDWidth;
@@ -1128,7 +1157,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt
std::copy(args.mpDXArray, args.mpDXArray + nChars,
mvCharDxs.begin() + (args.mnMinCharPos - mnMinCharPos));
#ifdef GRLAYOUT_DEBUG
- fprintf(grLog(),"ApplyDx %ld(%ld)\n", args.mpDXArray[nChars - 1], mnWidth);
+ fprintf(grLog(),"ApplyDx %d(%ld)\n", args.mpDXArray[nChars - 1], mnWidth);
#endif
mnWidth = args.mpDXArray[nChars - 1];
}
@@ -1170,7 +1199,7 @@ void GraphiteLayout::kashidaJustify(std::vector<int>& rDeltaWidths, sal_GlyphId
}
nKashidaCount = 1 + (nGapWidth / nKashidaWidth);
#ifdef GRLAYOUT_DEBUG
- printf("inserting %d kashidas at %ld\n", nKashidaCount, (*i).mnGlyphIndex);
+ printf("inserting %d kashidas at %u\n", nKashidaCount, (*i).mnGlyphIndex);
#endif
GlyphItem glyphItem = *i;
Point aPos(0, 0);
@@ -1309,7 +1338,7 @@ void GraphiteLayout::GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray
pCaretXArray[i] = pCaretXArray[i+1] = 0;
}
#ifdef GRLAYOUT_DEBUG
- fprintf(grLog(),"%d,%ld-%ld\t", nCharSlot, pCaretXArray[i], pCaretXArray[i+1]);
+ fprintf(grLog(),"%d,%d-%d\t", nCharSlot, pCaretXArray[i], pCaretXArray[i+1]);
#endif
}
#ifdef GRLAYOUT_DEBUG
diff --git a/vcl/source/glyphs/graphite_textsrc.hxx b/vcl/source/glyphs/graphite_textsrc.hxx
index cea9e4d5b607..388f8a631b49 100644
--- a/vcl/source/glyphs/graphite_textsrc.hxx
+++ b/vcl/source/glyphs/graphite_textsrc.hxx
@@ -93,6 +93,7 @@ public:
virtual ext_std::pair<gr::toffset, gr::toffset> propertyRange(gr::toffset ich);
virtual size_t getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset);
virtual bool sameSegment(gr::toffset ich1, gr::toffset ich2);
+ virtual bool featureVariations() { return false; }
operator ImplLayoutArgs & () throw();
void setFeatures(const grutils::GrFeatureParser * pFeatures);
diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx
index db622073cea9..67f50b69a182 100644
--- a/vcl/source/helper/strhelper.cxx
+++ b/vcl/source/helper/strhelper.cxx
@@ -365,8 +365,8 @@ String WhitespaceToSpace( const String& rLine, BOOL bProtect )
else
{
*pLeap = *pRun;
- *pLeap++;
- *pRun++;
+ ++pLeap;
+ ++pRun;
}
}
}
@@ -422,8 +422,8 @@ ByteString WhitespaceToSpace( const ByteString& rLine, BOOL bProtect )
else
{
*pLeap = *pRun;
- *pLeap++;
- *pRun++;
+ ++pLeap;
+ ++pRun;
}
}
}
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 8eedf76043da..b221d1f7d928 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -1151,15 +1151,13 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
if( mbNWFBorder )
{
ImplControlValue aControlValue;
- Region aCtrlRegion( Rectangle( (const Point&)Point(), Size( mnWidth < 10 ? 10 : mnWidth, mnHeight < 10 ? 10 : mnHeight ) ) );
- Region aBoundingRgn( aCtrlRegion );
- Region aContentRgn( aCtrlRegion );
+ Rectangle aCtrlRegion( (const Point&)Point(), Size( mnWidth < 10 ? 10 : mnWidth, mnHeight < 10 ? 10 : mnHeight ) );
+ Rectangle aBounds( aCtrlRegion );
+ Rectangle aContent( aCtrlRegion );
if( pWin->GetNativeControlRegion( aCtrlType, PART_ENTIRE_CONTROL, aCtrlRegion,
CTRL_STATE_ENABLED, aControlValue, rtl::OUString(),
- aBoundingRgn, aContentRgn ) )
+ aBounds, aContent ) )
{
- Rectangle aBounds( aBoundingRgn.GetBoundRect() );
- Rectangle aContent( aContentRgn.GetBoundRect() );
mnLeftBorder = aContent.Left() - aBounds.Left();
mnRightBorder = aBounds.Right() - aContent.Right();
mnTopBorder = aContent.Top() - aBounds.Top();
@@ -1346,13 +1344,14 @@ void ImplSmallBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice*, co
nState |= CTRL_STATE_ROLLOVER;
Point aPoint;
- Region aCtrlRegion( Rectangle( aPoint, Size( mnWidth, mnHeight ) ) );
+ Rectangle aCtrlRegion( aPoint, Size( mnWidth, mnHeight ) );
- Region aBoundingRgn( Rectangle( aPoint, Size( mnWidth, mnHeight ) ) );
- Region aContentRgn=aCtrlRegion;
+ Rectangle aBoundingRgn( aPoint, Size( mnWidth, mnHeight ) );
+ Rectangle aContentRgn( aCtrlRegion );
if(pWin->GetNativeControlRegion( aCtrlType, aCtrlPart, aCtrlRegion,
- nState, aControlValue, rtl::OUString(), aBoundingRgn, aContentRgn )) {
- aCtrlRegion=aContentRgn;
+ nState, aControlValue, rtl::OUString(), aBoundingRgn, aContentRgn ))
+ {
+ aCtrlRegion=aContentRgn;
}
bNativeOK = pWin->DrawNativeControl( aCtrlType, aCtrlPart, aCtrlRegion, nState,
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index a32790cfb0d4..e5c3dc525cec 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -877,12 +877,12 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
if( pWin->GetType() == WINDOW_BORDERWINDOW )
nValueStyle |= FRAME_DRAW_BORDERWINDOWBORDER;
ImplControlValue aControlValue( nValueStyle );
- Region aBound, aContent;
- Region aNatRgn( rRect );
+ Rectangle aBound, aContent;
+ Rectangle aNatRgn( rRect );
if(pWin && pWin->GetNativeControlRegion(CTRL_FRAME, PART_BORDER,
aNatRgn, 0, aControlValue, rtl::OUString(), aBound, aContent) )
{
- rRect = aContent.GetBoundRect();
+ rRect = aContent;
}
else if ( nStyle & FRAME_DRAW_MONO )
ImplDrawDPILineRect( pDev, rRect, NULL, bRound );
@@ -922,15 +922,15 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect,
if( pWin->GetType() == WINDOW_BORDERWINDOW )
nValueStyle |= FRAME_DRAW_BORDERWINDOWBORDER;
ImplControlValue aControlValue( nValueStyle );
- Region aBound, aContent;
- Region aNatRgn( rRect );
+ Rectangle aBound, aContent;
+ Rectangle aNatRgn( rRect );
if( pWin->GetNativeControlRegion(CTRL_FRAME, PART_BORDER,
aNatRgn, 0, aControlValue, rtl::OUString(), aBound, aContent) )
{
if( pWin->DrawNativeControl( CTRL_FRAME, PART_BORDER, aContent, CTRL_STATE_ENABLED,
aControlValue, rtl::OUString()) )
{
- rRect = aContent.GetBoundRect();
+ rRect = aContent;
return;
}
}
diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx
index 95e6c6113c45..9ea407e52ee3 100644
--- a/vcl/source/window/dockingarea.cxx
+++ b/vcl/source/window/dockingarea.cxx
@@ -152,23 +152,21 @@ void DockingAreaWindow::Paint( const Rectangle& )
EnableNativeWidget( TRUE ); // only required because the toolkit curently switches this flag off
if( IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL ) )
{
- ImplControlValue aControlValue;
- ToolbarValue aToolbarValue;
+ ToolbarValue aControlValue;
if( GetAlign() == WINDOWALIGN_TOP && ImplGetSVData()->maNWFData.mbMenuBarDockingAreaCommonBG )
{
// give NWF a hint that this dockingarea is adjacent to the menubar
// useful for special gradient effects that should cover both windows
- aToolbarValue.mbIsTopDockingArea = TRUE;
+ aControlValue.mbIsTopDockingArea = TRUE;
}
- aControlValue.setOptionalVal( (void *)(&aToolbarValue) );
ControlState nState = CTRL_STATE_ENABLED;
if( !ImplGetSVData()->maNWFData.mbDockingAreaSeparateTB )
{
// draw a single toolbar background covering the whole docking area
Point tmp;
- Region aCtrlRegion( Rectangle( tmp, GetOutputSizePixel() ) );
+ Rectangle aCtrlRegion( tmp, GetOutputSizePixel() );
DrawNativeControl( CTRL_TOOLBAR, IsHorizontal() ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT,
aCtrlRegion, nState, aControlValue, rtl::OUString() );
@@ -231,7 +229,7 @@ void DockingAreaWindow::Paint( const Rectangle& )
aTBRect.Bottom() = aOutSz.Height() - 1;
}
DrawNativeControl( CTRL_TOOLBAR, IsHorizontal() ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT,
- Region( aTBRect), nState, aControlValue, rtl::OUString() );
+ aTBRect, nState, aControlValue, rtl::OUString() );
}
}
}
diff --git a/vcl/source/window/javachild.cxx b/vcl/source/window/javachild.cxx
index 2cd18b897ff5..aa198c85c138 100644
--- a/vcl/source/window/javachild.cxx
+++ b/vcl/source/window/javachild.cxx
@@ -2,10 +2,13 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
+ * $RCSfile: javachild.cxx,v $
+ * $Revision: 1.12 $
+ *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -28,32 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-
-#ifdef SOLAR_JAVA
-#include <jni.h>
-#endif
-#include <comphelper/processfactory.hxx>
-
-#include <vcl/unohelp.hxx>
-#include <rtl/process.h>
-#include <rtl/ref.hxx>
-#include <jvmaccess/virtualmachine.hxx>
-#include <com/sun/star/java/XJavaVM.hpp>
-#include <com/sun/star/java/XJavaThreadRegister_11.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-#ifndef _SV_SVSYS_HXX
-#include <svsys.h>
-#endif
-#include <vcl/salinst.hxx>
-#include <vcl/salframe.hxx>
-#include <vcl/window.hxx>
-#include <vcl/salobj.hxx>
#include <vcl/javachild.hxx>
-#include <vcl/svdata.hxx>
-#include <vcl/sysdata.hxx>
-
-using namespace ::com::sun::star;
// -------------------
// - JavaChildWindow -
@@ -79,129 +57,7 @@ JavaChildWindow::~JavaChildWindow()
// -----------------------------------------------------------------------
-void JavaChildWindow::implTestJavaException( void* pEnv )
-{
-#ifdef SOLAR_JAVA
- JNIEnv* pJavaEnv = reinterpret_cast< JNIEnv* >( pEnv );
- jthrowable jtThrowable = pJavaEnv->ExceptionOccurred();
-
- if( jtThrowable )
- { // is it a java exception ?
-#if OSL_DEBUG_LEVEL > 1
- pJavaEnv->ExceptionDescribe();
-#endif // OSL_DEBUG_LEVEL > 1
- pJavaEnv->ExceptionClear();
-
- jclass jcThrowable = pJavaEnv->FindClass("java/lang/Throwable");
- jmethodID jmThrowable_getMessage = pJavaEnv->GetMethodID(jcThrowable, "getMessage", "()Ljava/lang/String;");
- jstring jsMessage = (jstring) pJavaEnv->CallObjectMethod(jtThrowable, jmThrowable_getMessage);
- ::rtl::OUString ouMessage;
-
- if(jsMessage)
- {
- const jchar * jcMessage = pJavaEnv->GetStringChars(jsMessage, NULL);
- ouMessage = ::rtl::OUString(jcMessage);
- pJavaEnv->ReleaseStringChars(jsMessage, jcMessage);
- }
-
- throw uno::RuntimeException(ouMessage, uno::Reference<uno::XInterface>());
- }
-#endif // SOLAR_JAVA
-}
-
-// -----------------------------------------------------------------------
-
sal_IntPtr JavaChildWindow::getParentWindowHandleForJava()
{
- sal_IntPtr nRet = 0;
-
-#if defined WNT
- nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->hWnd );
-#elif defined QUARTZ
- // FIXME: this is wrong
- nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView );
-#elif defined UNX
-#ifdef SOLAR_JAVA
- uno::Reference< lang::XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
-
- if( xFactory.is() && ( GetSystemData()->aWindow > 0 ) )
- {
- try
- {
- ::rtl::Reference< ::jvmaccess::VirtualMachine > xVM;
- uno::Reference< java::XJavaVM > xJavaVM( xFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.java.JavaVirtualMachine") ) ), uno::UNO_QUERY );
- uno::Sequence< sal_Int8 > aProcessID( 17 );
-
- rtl_getGlobalProcessId( (sal_uInt8*) aProcessID.getArray() );
- aProcessID[ 16 ] = 0;
- OSL_ENSURE(sizeof (sal_Int64) >= sizeof (jvmaccess::VirtualMachine *), "Pointer cannot be represented as sal_Int64");
- sal_Int64 nPointer = reinterpret_cast< sal_Int64 >( static_cast< jvmaccess::VirtualMachine * >(0));
- xJavaVM->getJavaVM(aProcessID) >>= nPointer;
- xVM = reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer);
-
- if( xVM.is() )
- {
- try
- {
- ::jvmaccess::VirtualMachine::AttachGuard aVMAttachGuard( xVM );
- JNIEnv* pEnv = aVMAttachGuard.getEnvironment();
-
- jclass jcToolkit = pEnv->FindClass("java/awt/Toolkit");
- implTestJavaException(pEnv);
-
- jmethodID jmToolkit_getDefaultToolkit = pEnv->GetStaticMethodID( jcToolkit, "getDefaultToolkit", "()Ljava/awt/Toolkit;" );
- implTestJavaException(pEnv);
-
- pEnv->CallStaticObjectMethod(jcToolkit, jmToolkit_getDefaultToolkit);
- implTestJavaException(pEnv);
-
- jclass jcMotifAppletViewer = pEnv->FindClass("sun/plugin/navig/motif/MotifAppletViewer");
- if( pEnv->ExceptionOccurred() )
- {
- pEnv->ExceptionClear();
-
- jcMotifAppletViewer = pEnv->FindClass( "sun/plugin/viewer/MNetscapePluginContext");
- implTestJavaException(pEnv);
- }
-
- jclass jcClassLoader = pEnv->FindClass("java/lang/ClassLoader");
- implTestJavaException(pEnv);
-
- jmethodID jmClassLoader_loadLibrary = pEnv->GetStaticMethodID( jcClassLoader, "loadLibrary", "(Ljava/lang/Class;Ljava/lang/String;Z)V");
- implTestJavaException(pEnv);
-
- jstring jsplugin = pEnv->NewStringUTF("javaplugin_jni");
- implTestJavaException(pEnv);
-
- pEnv->CallStaticVoidMethod(jcClassLoader, jmClassLoader_loadLibrary, jcMotifAppletViewer, jsplugin, JNI_FALSE);
- implTestJavaException(pEnv);
-
- jmethodID jmMotifAppletViewer_getWidget = pEnv->GetStaticMethodID( jcMotifAppletViewer, "getWidget", "(IIIII)I" );
- implTestJavaException(pEnv);
-
- const Size aSize( GetOutputSizePixel() );
- jint ji_widget = pEnv->CallStaticIntMethod( jcMotifAppletViewer, jmMotifAppletViewer_getWidget,
- GetSystemData()->aWindow, 0, 0, aSize.Width(), aSize.Height() );
- implTestJavaException(pEnv);
-
- nRet = static_cast< sal_IntPtr >( ji_widget );
- }
- catch( uno::RuntimeException& )
- {
- }
-
- if( !nRet )
- nRet = static_cast< sal_IntPtr >( GetSystemData()->aWindow );
- }
- }
- catch( ... )
- {
- }
- }
-#endif // SOLAR_JAVA
-#else // WNT || QUARTZ || UNX
- // TBD
-#endif
-
- return nRet;
+ return SystemChildWindow::GetParentWindowHandle( sal_True );
}
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 1723d26ce399..81676eba3be4 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2268,10 +2268,10 @@ long Menu::ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lon
if( ! bIsMenuBar )
{
ImplControlValue aVal;
- Region aNativeBounds;
- Region aNativeContent;
+ Rectangle aNativeBounds;
+ Rectangle aNativeContent;
Point tmp( 0, 0 );
- Region aCtrlRegion( Rectangle( tmp, Size( 100, 15 ) ) );
+ Rectangle aCtrlRegion( Rectangle( tmp, Size( 100, 15 ) ) );
if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM_CHECK_MARK ) )
{
if( pWin->GetNativeControlRegion( ControlType(CTRL_MENU_POPUP),
@@ -2284,8 +2284,8 @@ long Menu::ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lon
aNativeContent )
)
{
- rCheckHeight = aNativeBounds.GetBoundRect().GetHeight();
- rMaxWidth = aNativeContent.GetBoundRect().GetWidth();
+ rCheckHeight = aNativeBounds.GetHeight();
+ rMaxWidth = aNativeContent.GetWidth();
}
}
if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM_RADIO_MARK ) )
@@ -2300,8 +2300,8 @@ long Menu::ImplGetNativeCheckAndRadioSize( Window* pWin, long& rCheckHeight, lon
aNativeContent )
)
{
- rRadioHeight = aNativeBounds.GetBoundRect().GetHeight();
- rMaxWidth = Max (rMaxWidth, aNativeContent.GetBoundRect().GetWidth());
+ rRadioHeight = aNativeBounds.GetHeight();
+ rMaxWidth = Max (rMaxWidth, aNativeContent.GetWidth());
}
}
}
@@ -2516,10 +2516,10 @@ Size Menu::ImplCalcSize( Window* pWin )
if( pWindow->IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL ) )
{
ImplControlValue aVal;
- Region aNativeBounds;
- Region aNativeContent;
+ Rectangle aNativeBounds;
+ Rectangle aNativeContent;
Point tmp( 0, 0 );
- Region aCtrlRegion( Rectangle( tmp, Size( 100, 15 ) ) );
+ Rectangle aCtrlRegion( tmp, Size( 100, 15 ) );
if( pWindow->GetNativeControlRegion( ControlType(CTRL_MENUBAR),
ControlPart(PART_ENTIRE_CONTROL),
aCtrlRegion,
@@ -2530,7 +2530,7 @@ Size Menu::ImplCalcSize( Window* pWin )
aNativeContent )
)
{
- int nNativeHeight = aNativeBounds.GetBoundRect().GetHeight();
+ int nNativeHeight = aNativeBounds.GetHeight();
if( nNativeHeight > aSz.Height() )
aSz.Height() = nNativeHeight;
}
@@ -2555,7 +2555,7 @@ static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRec
if( i_pWindow->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) )
{
ImplControlValue aControlValue;
- Region aCtrlRegion( i_rRect );
+ Rectangle aCtrlRegion( i_rRect );
ControlState nState = CTRL_STATE_PRESSED | CTRL_STATE_ENABLED;
aControlValue.setTristateVal( BUTTONVALUE_ON );
@@ -2689,7 +2689,7 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
Rectangle aCheckRect( aTmpPos, Size( nCtrlHeight, nCtrlHeight ) );
pWin->DrawNativeControl( CTRL_MENU_POPUP, nPart,
- Region( aCheckRect ),
+ aCheckRect,
nState,
ImplControlValue(),
OUString() );
@@ -4679,7 +4679,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
IntersectClipRegion( Rectangle( Point( nX, nY ), Size( aSz.Width(), pData->aSz.Height() ) ) );
Rectangle aCtrlRect( Point( nX, 0 ), Size( aPxSize.Width()-nX, aPxSize.Height() ) );
DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL,
- Region( aCtrlRect ),
+ aCtrlRect,
CTRL_STATE_ENABLED,
ImplControlValue(),
OUString() );
@@ -4688,7 +4688,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
{
bDrawItemRect = false;
if( FALSE == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM,
- Region( aItemRect ),
+ aItemRect,
CTRL_STATE_SELECTED | ( pData->bEnabled? CTRL_STATE_ENABLED: 0 ),
ImplControlValue(),
OUString() ) )
@@ -5026,7 +5026,7 @@ void MenuFloatingWindow::Paint( const Rectangle& )
Size aPxSize( GetOutputSizePixel() );
aPxSize.Width() -= nX;
DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL,
- Region( Rectangle( Point( nX, 0 ), aPxSize ) ),
+ Rectangle( Point( nX, 0 ), aPxSize ),
CTRL_STATE_ENABLED,
ImplControlValue(),
OUString() );
@@ -5540,23 +5540,21 @@ void MenuBarWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL ) )
{
// draw background (transparency)
- ImplControlValue aControlValue;
- MenubarValue aMenubarValue;
- aMenubarValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( this );
- aControlValue.setOptionalVal( (void *)(&aMenubarValue) );
+ MenubarValue aControlValue;
+ aControlValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( this );
Point tmp(0,0);
- Region aBgRegion( Rectangle( tmp, GetOutputSizePixel() ) );
+ Rectangle aBgRegion( tmp, GetOutputSizePixel() );
DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL,
aBgRegion,
CTRL_STATE_ENABLED,
aControlValue,
OUString() );
- ImplAddNWFSeparator( this, aMenubarValue );
+ ImplAddNWFSeparator( this, aControlValue );
// draw selected item
DrawNativeControl( CTRL_MENUBAR, PART_MENU_ITEM,
- Region( aRect ),
+ aRect,
CTRL_STATE_ENABLED | CTRL_STATE_SELECTED,
aControlValue,
OUString() );
@@ -5572,18 +5570,15 @@ void MenuBarWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
{
if( IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL) )
{
- ImplControlValue aControlValue;
MenubarValue aMenubarValue;
aMenubarValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( this );
- aControlValue.setOptionalVal( (void *)(&aMenubarValue) );
// use full window size to get proper gradient
// but clip accordingly
Point aPt;
Rectangle aCtrlRect( aPt, GetOutputSizePixel() );
- Region aCtrlRegion( aCtrlRect );
- DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, aCtrlRegion, CTRL_STATE_ENABLED, aControlValue, rtl::OUString() );
+ DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, aCtrlRect, CTRL_STATE_ENABLED, aMenubarValue, rtl::OUString() );
ImplAddNWFSeparator( this, aMenubarValue );
}
else
@@ -5814,14 +5809,12 @@ void MenuBarWindow::Paint( const Rectangle& )
if( IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL) )
{
Point aPt;
- Region aCtrlRegion( Rectangle( aPt, GetOutputSizePixel() ) );
+ Rectangle aCtrlRegion( aPt, GetOutputSizePixel() );
- ImplControlValue aControlValue;
MenubarValue aMenubarValue;
aMenubarValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( this );
- aControlValue.setOptionalVal( (void *)(&aMenubarValue) );
- DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, aCtrlRegion, CTRL_STATE_ENABLED, aControlValue, rtl::OUString() );
+ DrawNativeControl( CTRL_MENUBAR, PART_ENTIRE_CONTROL, aCtrlRegion, CTRL_STATE_ENABLED, aMenubarValue, rtl::OUString() );
ImplAddNWFSeparator( this, aMenubarValue );
}
SetFillColor( GetSettings().GetStyleSettings().GetMenuColor() );
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 35077b1cff0e..4490bfb3dbeb 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -1192,6 +1192,7 @@ void PrintDialog::setupOptionalUI()
rtl::OUString aText;
rtl::OUString aPropertyName;
Sequence< rtl::OUString > aChoices;
+ Sequence< sal_Bool > aChoicesDisabled;
Sequence< rtl::OUString > aHelpTexts;
sal_Int64 nMinValue = 0, nMaxValue = 0;
sal_Int32 nCurHelpText = 0;
@@ -1215,6 +1216,10 @@ void PrintDialog::setupOptionalUI()
{
rEntry.Value >>= aChoices;
}
+ else if( rEntry.Name.equalsAscii( "ChoicesDisabled" ) )
+ {
+ rEntry.Value >>= aChoicesDisabled;
+ }
else if( rEntry.Name.equalsAscii( "Property" ) )
{
PropertyValue aVal;
@@ -1497,6 +1502,8 @@ void PrintDialog::setupOptionalUI()
pBtn->SetText( aChoices[m] );
pBtn->Check( m == nSelectVal );
pBtn->SetToggleHdl( LINK( this, PrintDialog, UIOption_RadioHdl ) );
+ if( aChoicesDisabled.getLength() > m && aChoicesDisabled[m] == sal_True )
+ pBtn->Enable( FALSE );
pBtn->Show();
maPropertyToWindowMap[ aPropertyName ].push_back( pBtn );
maControlToPropertyMap[pBtn] = aPropertyName;
@@ -1821,6 +1828,16 @@ void PrintDialog::checkOptionalControlDependencies()
}
}
+ if( bShouldbeEnabled && dynamic_cast<RadioButton*>(it->first) )
+ {
+ std::map< Window*, sal_Int32 >::const_iterator r_it = maControlToNumValMap.find( it->first );
+ if( r_it != maControlToNumValMap.end() )
+ {
+ bShouldbeEnabled = maPController->isUIChoiceEnabled( it->second, r_it->second );
+ }
+ }
+
+
bool bIsEnabled = it->first->IsEnabled();
// Enable does not do a change check first, so can be less cheap than expected
if( bShouldbeEnabled != bIsEnabled )
@@ -2514,13 +2531,13 @@ void PrintProgressDialog::implCalcProgressRect()
if( IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
{
ImplControlValue aValue;
- Region aControlRegion( Rectangle( Point(), Size( 100, mnProgressHeight ) ) );
- Region aNativeControlRegion, aNativeContentRegion;
+ Rectangle aControlRegion( Point(), Size( 100, mnProgressHeight ) );
+ Rectangle aNativeControlRegion, aNativeContentRegion;
if( GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
CTRL_STATE_ENABLED, aValue, rtl::OUString(),
aNativeControlRegion, aNativeContentRegion ) )
{
- mnProgressHeight = aNativeControlRegion.GetBoundRect().GetHeight();
+ mnProgressHeight = aNativeControlRegion.GetHeight();
}
mbNativeProgress = true;
}
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index c139ae1ffb30..ba4ab7984c52 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -320,6 +320,8 @@ void StatusBar::ImplFormat()
nExtraWidth2 = 0;
}
nX = STATUSBAR_OFFSET_X;
+ if( ImplHasMirroredGraphics() && IsRTLEnabled() )
+ nX += ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset;
}
pItem = mpItemList->First();
@@ -544,7 +546,7 @@ void DrawProgress( Window* pWindow, const Point& rPos,
long nPerc = (nPercent2 > 10000) ? 10000 : nPercent2;
ImplControlValue aValue( nFullWidth * (long)nPerc / 10000 );
Rectangle aDrawRect( rPos, Size( nFullWidth, nPrgsHeight ) );
- Region aControlRegion( aDrawRect );
+ Rectangle aControlRegion( aDrawRect );
if( bNeedErase )
{
Window* pEraseWindow = pWindow;
@@ -711,13 +713,13 @@ void StatusBar::ImplCalcProgressRect()
if( IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
{
ImplControlValue aValue;
- Region aControlRegion( Rectangle( (const Point&)Point(), maPrgsFrameRect.GetSize() ) );
- Region aNativeControlRegion, aNativeContentRegion;
+ Rectangle aControlRegion( Rectangle( (const Point&)Point(), maPrgsFrameRect.GetSize() ) );
+ Rectangle aNativeControlRegion, aNativeContentRegion;
if( (bNativeOK = GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
CTRL_STATE_ENABLED, aValue, rtl::OUString(),
aNativeControlRegion, aNativeContentRegion ) ) != FALSE )
{
- long nProgressHeight = aNativeControlRegion.GetBoundRect().GetHeight();
+ long nProgressHeight = aNativeControlRegion.GetHeight();
if( nProgressHeight > maPrgsFrameRect.GetHeight() )
{
long nDelta = nProgressHeight - maPrgsFrameRect.GetHeight();
@@ -833,7 +835,7 @@ void StatusBar::Resize()
{
// Breite und Hoehe abfragen und merken
Size aSize = GetOutputSizePixel();
- mnDX = aSize.Width();
+ mnDX = aSize.Width() - ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset;
mnDY = aSize.Height();
mnCalcHeight = mnDY;
// subtract border
@@ -1723,13 +1725,13 @@ Size StatusBar::CalcWindowSizePixel() const
if( pThis->IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) )
{
ImplControlValue aValue;
- Region aControlRegion( Rectangle( (const Point&)Point(), Size( nCalcWidth, nMinHeight ) ) );
- Region aNativeControlRegion, aNativeContentRegion;
+ Rectangle aControlRegion( (const Point&)Point(), Size( nCalcWidth, nMinHeight ) );
+ Rectangle aNativeControlRegion, aNativeContentRegion;
if( pThis->GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion,
CTRL_STATE_ENABLED, aValue, rtl::OUString(),
aNativeControlRegion, aNativeContentRegion ) )
{
- nProgressHeight = aNativeControlRegion.GetBoundRect().GetHeight();
+ nProgressHeight = aNativeControlRegion.GetHeight();
}
}
@@ -1737,14 +1739,13 @@ Size StatusBar::CalcWindowSizePixel() const
pThis->IsNativeControlSupported( CTRL_FRAME, PART_BORDER ) )
{
ImplControlValue aControlValue( FRAME_DRAW_NODRAW );
- Region aBound, aContent;
- Region aNatRgn( Rectangle( Point( 0, 0 ), Size( 150, 50 ) ) );
+ Rectangle aBound, aContent;
+ Rectangle aNatRgn( Point( 0, 0 ), Size( 150, 50 ) );
if( pThis->GetNativeControlRegion(CTRL_FRAME, PART_BORDER,
aNatRgn, 0, aControlValue, rtl::OUString(), aBound, aContent) )
{
mpImplData->mnItemBorderWidth =
- ( aBound.GetBoundRect().GetHeight() -
- aContent.GetBoundRect().GetHeight() ) / 2;
+ ( aBound.GetHeight() - aContent.GetHeight() ) / 2;
}
}
diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx
index ef71f83df1ee..4e897eef4a8b 100644
--- a/vcl/source/window/syschild.cxx
+++ b/vcl/source/window/syschild.cxx
@@ -28,25 +28,34 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
+#include <rtl/process.h>
+#include <rtl/ref.hxx>
+#include <tools/rc.h>
+#include <vcl/window.h>
#include <vcl/salinst.hxx>
#include <vcl/salframe.hxx>
#include <vcl/window.hxx>
#include <vcl/salobj.hxx>
-
-#ifndef _SV_RC_H
-#include <tools/rc.h>
-#endif
#include <vcl/svdata.hxx>
-#ifndef _SV_WIDNOW_H
-#include <vcl/window.h>
-#endif
+#include <vcl/sysdata.hxx>
#include <vcl/svapp.hxx>
#include <vcl/syschild.hxx>
+#include <vcl/unohelp.hxx>
+#ifdef SOLAR_JAVA
+#include <jni.h>
+#endif
+
+#include <comphelper/processfactory.hxx>
+#include <jvmaccess/virtualmachine.hxx>
+#include <com/sun/star/java/XJavaVM.hpp>
+#include <com/sun/star/java/XJavaThreadRegister_11.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+
+#include <vcl/syschild.hxx>
+using namespace ::com::sun::star;
// =======================================================================
@@ -183,6 +192,8 @@ void SystemChildWindow::EnableEraseBackground( BOOL bEnable )
mpWindowImpl->mpSysObj->EnableEraseBackground( bEnable );
}
+// -----------------------------------------------------------------------
+
BOOL SystemChildWindow::IsEraseBackgroundEnabled()
{
if ( mpWindowImpl->mpSysObj )
@@ -190,3 +201,138 @@ BOOL SystemChildWindow::IsEraseBackgroundEnabled()
else
return FALSE;
}
+
+// -----------------------------------------------------------------------
+
+void SystemChildWindow::ImplTestJavaException( void* pEnv )
+{
+#ifdef SOLAR_JAVA
+ JNIEnv* pJavaEnv = reinterpret_cast< JNIEnv* >( pEnv );
+ jthrowable jtThrowable = pJavaEnv->ExceptionOccurred();
+
+ if( jtThrowable )
+ { // is it a java exception ?
+#if OSL_DEBUG_LEVEL > 1
+ pJavaEnv->ExceptionDescribe();
+#endif // OSL_DEBUG_LEVEL > 1
+ pJavaEnv->ExceptionClear();
+
+ jclass jcThrowable = pJavaEnv->FindClass("java/lang/Throwable");
+ jmethodID jmThrowable_getMessage = pJavaEnv->GetMethodID(jcThrowable, "getMessage", "()Ljava/lang/String;");
+ jstring jsMessage = (jstring) pJavaEnv->CallObjectMethod(jtThrowable, jmThrowable_getMessage);
+ ::rtl::OUString ouMessage;
+
+ if(jsMessage)
+ {
+ const jchar * jcMessage = pJavaEnv->GetStringChars(jsMessage, NULL);
+ ouMessage = ::rtl::OUString(jcMessage);
+ pJavaEnv->ReleaseStringChars(jsMessage, jcMessage);
+ }
+
+ throw uno::RuntimeException(ouMessage, uno::Reference<uno::XInterface>());
+ }
+#endif // SOLAR_JAVA
+}
+
+// -----------------------------------------------------------------------
+
+sal_IntPtr SystemChildWindow::GetParentWindowHandle( sal_Bool bUseJava )
+{
+ sal_IntPtr nRet = 0;
+
+#if defined WNT
+ nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->hWnd );
+#elif defined QUARTZ
+ // FIXME: this is wrong
+ nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView );
+#elif defined UNX
+ if( !bUseJava )
+ {
+ nRet = (sal_IntPtr) GetSystemData()->aWindow;
+ }
+#ifdef SOLAR_JAVA
+ else
+ {
+ uno::Reference< lang::XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() );
+
+ if( xFactory.is() && ( GetSystemData()->aWindow > 0 ) )
+ {
+ try
+ {
+ ::rtl::Reference< ::jvmaccess::VirtualMachine > xVM;
+ uno::Reference< java::XJavaVM > xJavaVM( xFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.java.JavaVirtualMachine") ) ), uno::UNO_QUERY );
+ uno::Sequence< sal_Int8 > aProcessID( 17 );
+
+ rtl_getGlobalProcessId( (sal_uInt8*) aProcessID.getArray() );
+ aProcessID[ 16 ] = 0;
+ OSL_ENSURE(sizeof (sal_Int64) >= sizeof (jvmaccess::VirtualMachine *), "Pointer cannot be represented as sal_Int64");
+ sal_Int64 nPointer = reinterpret_cast< sal_Int64 >( static_cast< jvmaccess::VirtualMachine * >(0));
+ xJavaVM->getJavaVM(aProcessID) >>= nPointer;
+ xVM = reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer);
+
+ if( xVM.is() )
+ {
+ try
+ {
+ ::jvmaccess::VirtualMachine::AttachGuard aVMAttachGuard( xVM );
+ JNIEnv* pEnv = aVMAttachGuard.getEnvironment();
+
+ jclass jcToolkit = pEnv->FindClass("java/awt/Toolkit");
+ ImplTestJavaException(pEnv);
+
+ jmethodID jmToolkit_getDefaultToolkit = pEnv->GetStaticMethodID( jcToolkit, "getDefaultToolkit", "()Ljava/awt/Toolkit;" );
+ ImplTestJavaException(pEnv);
+
+ pEnv->CallStaticObjectMethod(jcToolkit, jmToolkit_getDefaultToolkit);
+ ImplTestJavaException(pEnv);
+
+ jclass jcMotifAppletViewer = pEnv->FindClass("sun/plugin/navig/motif/MotifAppletViewer");
+ if( pEnv->ExceptionOccurred() )
+ {
+ pEnv->ExceptionClear();
+
+ jcMotifAppletViewer = pEnv->FindClass( "sun/plugin/viewer/MNetscapePluginContext");
+ ImplTestJavaException(pEnv);
+ }
+
+ jclass jcClassLoader = pEnv->FindClass("java/lang/ClassLoader");
+ ImplTestJavaException(pEnv);
+
+ jmethodID jmClassLoader_loadLibrary = pEnv->GetStaticMethodID( jcClassLoader, "loadLibrary", "(Ljava/lang/Class;Ljava/lang/String;Z)V");
+ ImplTestJavaException(pEnv);
+
+ jstring jsplugin = pEnv->NewStringUTF("javaplugin_jni");
+ ImplTestJavaException(pEnv);
+
+ pEnv->CallStaticVoidMethod(jcClassLoader, jmClassLoader_loadLibrary, jcMotifAppletViewer, jsplugin, JNI_FALSE);
+ ImplTestJavaException(pEnv);
+
+ jmethodID jmMotifAppletViewer_getWidget = pEnv->GetStaticMethodID( jcMotifAppletViewer, "getWidget", "(IIIII)I" );
+ ImplTestJavaException(pEnv);
+
+ const Size aSize( GetOutputSizePixel() );
+ jint ji_widget = pEnv->CallStaticIntMethod( jcMotifAppletViewer, jmMotifAppletViewer_getWidget,
+ GetSystemData()->aWindow, 0, 0, aSize.Width(), aSize.Height() );
+ ImplTestJavaException(pEnv);
+
+ nRet = static_cast< sal_IntPtr >( ji_widget );
+ }
+ catch( uno::RuntimeException& )
+ {
+ }
+
+ if( !nRet )
+ nRet = static_cast< sal_IntPtr >( GetSystemData()->aWindow );
+ }
+ }
+ catch( ... )
+ {
+ }
+ }
+ }
+#endif // SOLAR_JAVA
+#else // WNT || QUARTZ || UNX
+#endif
+
+ return nRet;
+}
diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx
index 7bfd115af8f9..0589d57009f4 100644
--- a/vcl/source/window/tabpage.cxx
+++ b/vcl/source/window/tabpage.cxx
@@ -149,7 +149,7 @@ void TabPage::Paint( const Rectangle& )
// draw native tabpage only inside tabcontrols, standalone tabpages look ugly (due to bad dialog design)
if( IsNativeControlSupported(CTRL_TAB_BODY, PART_ENTIRE_CONTROL) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) )
{
- const ImplControlValue aControlValue( BUTTONVALUE_DONTKNOW, rtl::OUString(), 0 );
+ const ImplControlValue aControlValue;
ControlState nState = CTRL_STATE_ENABLED;
int part = PART_ENTIRE_CONTROL;
@@ -160,7 +160,7 @@ void TabPage::Paint( const Rectangle& )
Point aPoint;
// pass the whole window region to NWF as the tab body might be a gradient or bitmap
// that has to be scaled properly, clipping makes sure that we do not paint too much
- Region aCtrlRegion( Rectangle( aPoint, GetOutputSizePixel() ) );
+ Rectangle aCtrlRegion( aPoint, GetOutputSizePixel() );
DrawNativeControl( CTRL_TAB_BODY, part, aCtrlRegion, nState,
aControlValue, rtl::OUString() );
}
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 9ad0b8734437..4de6c88490f6 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -215,13 +215,13 @@ int ToolBox::ImplGetDragWidth( ToolBox* pThis )
ImplControlValue aControlValue;
Point aPoint;
- Region aContent, aBound;
- Region aArea( Rectangle(aPoint, pThis->GetOutputSizePixel()) );
+ Rectangle aContent, aBound;
+ Rectangle aArea( aPoint, pThis->GetOutputSizePixel() );
if ( pThis->GetNativeControlRegion(CTRL_TOOLBAR, pThis->mbHorz ? PART_THUMB_VERT : PART_THUMB_HORZ,
aArea, 0, aControlValue, rtl::OUString(), aBound, aContent) )
{
- width = pThis->mbHorz ? aContent.GetBoundRect().GetWidth() : aContent.GetBoundRect().GetHeight();
+ width = pThis->mbHorz ? aContent.GetWidth() : aContent.GetHeight();
}
}
return width;
@@ -338,16 +338,14 @@ void ToolBox::ImplDrawGrip( ToolBox* pThis )
BOOL bNativeOk = FALSE;
if( pThis->IsNativeControlSupported( CTRL_TOOLBAR, pThis->mbHorz ? PART_THUMB_HORZ : PART_THUMB_VERT ) )
{
- ImplControlValue aControlValue;
ToolbarValue aToolbarValue;
aToolbarValue.maGripRect = pWrapper->GetDragArea();
- aControlValue.setOptionalVal( (void *)(&aToolbarValue) );
Point aPt;
- Region aCtrlRegion( Rectangle( aPt, pThis->GetOutputSizePixel() ) );
+ Rectangle aCtrlRegion( aPt, pThis->GetOutputSizePixel() );
ControlState nState = CTRL_STATE_ENABLED;
bNativeOk = pThis->DrawNativeControl( CTRL_TOOLBAR, pThis->mbHorz ? PART_THUMB_VERT : PART_THUMB_HORZ,
- aCtrlRegion, nState, aControlValue, rtl::OUString() );
+ aCtrlRegion, nState, aToolbarValue, rtl::OUString() );
}
if( bNativeOk )
@@ -557,7 +555,7 @@ BOOL ToolBox::ImplDrawNativeBackground( ToolBox* pThis, const Region & )
{
// use NWF
Point aPt;
- Region aCtrlRegion( Rectangle( aPt, pThis->GetOutputSizePixel() ) );
+ Rectangle aCtrlRegion( aPt, pThis->GetOutputSizePixel() );
ControlState nState = CTRL_STATE_ENABLED;
return pThis->DrawNativeControl( CTRL_TOOLBAR, pThis->mbHorz ? PART_DRAW_BACKGROUND_HORZ : PART_DRAW_BACKGROUND_VERT,
@@ -1918,9 +1916,9 @@ BOOL ToolBox::ImplCalcItem()
// determine minimum size necessary in NWF
{
Rectangle aRect( Point( 0, 0 ), Size( nMinWidth, nMinHeight ) );
- Region aReg = aRect;
+ Rectangle aReg( aRect );
ImplControlValue aVal;
- Region aNativeBounds, aNativeContent;
+ Rectangle aNativeBounds, aNativeContent;
if( IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) )
{
if( GetNativeControlRegion( CTRL_TOOLBAR, PART_BUTTON,
@@ -1929,7 +1927,7 @@ BOOL ToolBox::ImplCalcItem()
aVal, OUString(),
aNativeBounds, aNativeContent ) )
{
- aRect = aNativeBounds.GetBoundRect();
+ aRect = aNativeBounds;
if( aRect.GetWidth() > nMinWidth )
nMinWidth = aRect.GetWidth();
if( aRect.GetHeight() > nMinHeight )
@@ -1954,7 +1952,7 @@ BOOL ToolBox::ImplCalcItem()
aVal, OUString(),
aNativeBounds, aNativeContent ) )
{
- aRect = aNativeBounds.GetBoundRect();
+ aRect = aNativeBounds;
if( aRect.GetHeight() > mnWinHeight )
mnWinHeight = aRect.GetHeight();
}
@@ -1966,7 +1964,7 @@ BOOL ToolBox::ImplCalcItem()
aVal, OUString(),
aNativeBounds, aNativeContent ) )
{
- aRect = aNativeBounds.GetBoundRect();
+ aRect = aNativeBounds;
if( aRect.GetHeight() > mnWinHeight )
mnWinHeight = aRect.GetHeight();
}
@@ -1978,7 +1976,7 @@ BOOL ToolBox::ImplCalcItem()
aVal, OUString(),
aNativeBounds, aNativeContent ) )
{
- aRect = aNativeBounds.GetBoundRect();
+ aRect = aNativeBounds;
if( aRect.GetHeight() > mnWinHeight )
mnWinHeight = aRect.GetHeight();
}
@@ -3418,7 +3416,6 @@ static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, USHORT highl
if( !bIsWindow && pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) )
{
ImplControlValue aControlValue;
- Region aCtrlRegion( rRect );
ControlState nState = 0;
if ( highlight == 1 ) nState |= CTRL_STATE_PRESSED;
@@ -3429,7 +3426,7 @@ static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, USHORT highl
bNativeOk = pThis->DrawNativeControl( CTRL_TOOLBAR, PART_BUTTON,
- aCtrlRegion, nState, aControlValue, rtl::OUString() );
+ rRect, nState, aControlValue, rtl::OUString() );
}
if( !bNativeOk )
@@ -3454,6 +3451,8 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay
MetricVector* pVector = bLayout ? &mpData->m_pLayoutData->m_aUnicodeBoundRects : NULL;
String* pDisplayText = bLayout ? &mpData->m_pLayoutData->m_aDisplayText : NULL;
+ bHighlight = bHighlight && pItem->mbEnabled;
+
// Falls Rechteck ausserhalb des sichbaren Bereichs liegt
if ( pItem->maRect.IsEmpty() )
return;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index ebeb5c94d68a..35641ab8d6f9 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -243,18 +243,17 @@ void Window::ImplInitAppFontData( Window* pWindow )
// of control sizes, if yes, make app font scalings larger
// so dialog positioning is not completely off
ImplControlValue aControlValue;
- Region aCtrlRegion( (const Rectangle&)Rectangle( Point(), Size( nTextWidth < 10 ? 10 : nTextWidth, nTextHeight < 10 ? 10 : nTextHeight ) ) );
- Region aBoundingRgn( aCtrlRegion );
- Region aContentRgn( aCtrlRegion );
+ Rectangle aCtrlRegion( Point(), Size( nTextWidth < 10 ? 10 : nTextWidth, nTextHeight < 10 ? 10 : nTextHeight ) );
+ Rectangle aBoundingRgn( aCtrlRegion );
+ Rectangle aContentRgn( aCtrlRegion );
if( pWindow->GetNativeControlRegion( CTRL_EDITBOX, PART_ENTIRE_CONTROL, aCtrlRegion,
CTRL_STATE_ENABLED, aControlValue, rtl::OUString(),
aBoundingRgn, aContentRgn ) )
{
- Rectangle aContentRect( aContentRgn.GetBoundRect() );
// comment: the magical +6 is for the extra border in bordered
// (which is the standard) edit fields
- if( aContentRect.GetHeight() - nTextHeight > (nTextHeight+4)/4 )
- pSVData->maGDIData.mnAppFontY = (aContentRect.GetHeight()-4) * 10;
+ if( aContentRgn.GetHeight() - nTextHeight > (nTextHeight+4)/4 )
+ pSVData->maGDIData.mnAppFontY = (aContentRgn.GetHeight()-4) * 10;
}
}
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 2679f4a29c02..1f1c469bf9a1 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -630,9 +630,10 @@ void GtkXLib::Init()
* the clipboard build another connection
* to the xserver using $DISPLAY
*/
- char *pPutEnvIsBroken = g_strdup_printf( "DISPLAY=%s",
- gdk_display_get_name( pGdkDisp ) );
- putenv( pPutEnvIsBroken );
+ rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("DISPLAY"));
+ const gchar *name = gdk_display_get_name( pGdkDisp );
+ rtl::OUString envValue(name, strlen(name), aEnc);
+ osl_setEnvironment(envVar.pData, envValue.pData);
Display *pDisp = gdk_x11_display_get_xdisplay( pGdkDisp );
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index cdc72485ae6c..9d3ce6b137cd 100644
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -617,7 +617,7 @@ BOOL GtkSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
*/
BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
const Point& aPos,
BOOL& rIsInside )
{
@@ -654,8 +654,8 @@ BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType,
else if ( nPart == PART_BUTTON_RIGHT )
nCounterPart = PART_BUTTON_LEFT;
- aBackward = NWGetScrollButtonRect( m_nScreen, nPart, rControlRegion.GetBoundRect() );
- aForward = NWGetScrollButtonRect( m_nScreen, nCounterPart, rControlRegion.GetBoundRect() );
+ aBackward = NWGetScrollButtonRect( m_nScreen, nPart, rControlRegion );
+ aForward = NWGetScrollButtonRect( m_nScreen, nCounterPart, rControlRegion );
if ( has_backward && has_forward2 )
{
@@ -727,7 +727,7 @@ BOOL GtkSalGraphics::hitTestNativeControl( ControlType nType,
*/
BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const OUString& rCaption )
@@ -753,7 +753,7 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
GtkSalGraphics::bThemeChanged = FALSE;
}
- Rectangle aCtrlRect = rControlRegion.GetBoundRect();
+ Rectangle aCtrlRect( rControlRegion );
Region aClipRegion( m_aClipRegion );
if( aClipRegion.IsNull() )
aClipRegion = aCtrlRect;
@@ -897,7 +897,7 @@ BOOL GtkSalGraphics::drawNativeControl( ControlType nType,
BOOL GtkSalGraphics::drawNativeMixedStateCheck( ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const OUString& rCaption )
@@ -908,7 +908,7 @@ BOOL GtkSalGraphics::drawNativeMixedStateCheck( ControlType nType,
bool bOldNeedPixmapPaint = bNeedPixmapPaint;
bNeedPixmapPaint = true;
- Rectangle aCtrlRect = rControlRegion.GetBoundRect();
+ Rectangle aCtrlRect = rControlRegion;
BOOL returnVal = FALSE;
SelectFont();
@@ -956,7 +956,7 @@ BOOL GtkSalGraphics::drawNativeMixedStateCheck( ControlType nType,
*/
BOOL GtkSalGraphics::drawNativeControlText( ControlType,
ControlPart,
- const Region&,
+ const Rectangle&,
ControlState,
const ImplControlValue&,
const OUString& )
@@ -980,20 +980,20 @@ BOOL GtkSalGraphics::drawNativeControlText( ControlType,
*/
BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const OUString& rCaption,
- Region &rNativeBoundingRegion,
- Region &rNativeContentRegion )
+ Rectangle &rNativeBoundingRegion,
+ Rectangle &rNativeContentRegion )
{
BOOL returnVal = FALSE;
if ( (nType==CTRL_PUSHBUTTON) && (nPart==PART_ENTIRE_CONTROL)
- && (rControlRegion.GetBoundRect().GetWidth() > 16)
- && (rControlRegion.GetBoundRect().GetHeight() > 16) )
+ && (rControlRegion.GetWidth() > 16)
+ && (rControlRegion.GetHeight() > 16) )
{
- rNativeBoundingRegion = NWGetButtonArea( m_nScreen, nType, nPart, rControlRegion.GetBoundRect(),
+ rNativeBoundingRegion = NWGetButtonArea( m_nScreen, nType, nPart, rControlRegion,
nState, aValue, rCaption );
rNativeContentRegion = rControlRegion;
@@ -1001,7 +1001,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
}
if ( (nType==CTRL_COMBOBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
{
- rNativeBoundingRegion = NWGetComboBoxButtonRect( m_nScreen, nType, nPart, rControlRegion.GetBoundRect(), nState,
+ rNativeBoundingRegion = NWGetComboBoxButtonRect( m_nScreen, nType, nPart, rControlRegion, nState,
aValue, rCaption );
rNativeContentRegion = rNativeBoundingRegion;
@@ -1010,7 +1010,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
if ( (nType==CTRL_SPINBOX) && ((nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
{
- rNativeBoundingRegion = NWGetSpinButtonRect( m_nScreen, nType, nPart, rControlRegion.GetBoundRect(), nState,
+ rNativeBoundingRegion = NWGetSpinButtonRect( m_nScreen, nType, nPart, rControlRegion, nState,
aValue, rCaption );
rNativeContentRegion = rNativeBoundingRegion;
@@ -1018,7 +1018,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
}
if ( (nType==CTRL_LISTBOX) && ((nPart==PART_BUTTON_DOWN) || (nPart==PART_SUB_EDIT)) )
{
- rNativeBoundingRegion = NWGetListBoxButtonRect( m_nScreen, nType, nPart, rControlRegion.GetBoundRect(), nState,
+ rNativeBoundingRegion = NWGetListBoxButtonRect( m_nScreen, nType, nPart, rControlRegion, nState,
aValue, rCaption );
rNativeContentRegion = rNativeBoundingRegion;
@@ -1032,14 +1032,14 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
(nPart==PART_BUTTON)
))
{
- rNativeBoundingRegion = NWGetToolbarRect( m_nScreen, nType, nPart, rControlRegion.GetBoundRect(), nState, aValue, rCaption );
+ rNativeBoundingRegion = NWGetToolbarRect( m_nScreen, nType, nPart, rControlRegion, nState, aValue, rCaption );
rNativeContentRegion = rNativeBoundingRegion;
returnVal = TRUE;
}
if ( (nType==CTRL_SCROLLBAR) && ((nPart==PART_BUTTON_LEFT) || (nPart==PART_BUTTON_RIGHT) ||
(nPart==PART_BUTTON_UP) || (nPart==PART_BUTTON_DOWN) ) )
{
- rNativeBoundingRegion = NWGetScrollButtonRect( m_nScreen, nPart, rControlRegion.GetBoundRect() );
+ rNativeBoundingRegion = NWGetScrollButtonRect( m_nScreen, nPart, rControlRegion );
rNativeContentRegion = rNativeBoundingRegion;
returnVal = TRUE;
@@ -1049,10 +1049,10 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
NWEnsureGTKMenubar( m_nScreen );
GtkRequisition aReq;
gtk_widget_size_request( gWidgetData[m_nScreen].gMenubarWidget, &aReq );
- Rectangle aMenuBarRect = rControlRegion.GetBoundRect();
+ Rectangle aMenuBarRect = rControlRegion;
aMenuBarRect = Rectangle( aMenuBarRect.TopLeft(),
Size( aMenuBarRect.GetWidth(), aReq.height+1 ) );
- rNativeBoundingRegion = Region( aMenuBarRect );
+ rNativeBoundingRegion = aMenuBarRect;
rNativeContentRegion = rNativeBoundingRegion;
returnVal = TRUE;
}
@@ -1071,9 +1071,9 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
(char *)NULL );
rNativeBoundingRegion = rControlRegion;
Rectangle aIndicatorRect( Point( 0,
- (rControlRegion.GetBoundRect().GetHeight()-indicator_size)/2),
+ (rControlRegion.GetHeight()-indicator_size)/2),
Size( indicator_size, indicator_size ) );
- rNativeContentRegion = Region( aIndicatorRect );
+ rNativeContentRegion = aIndicatorRect;
returnVal = TRUE;
}
}
@@ -1090,9 +1090,9 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
indicator_size += 2*indicator_spacing; // guess overpaint of theme
rNativeBoundingRegion = rControlRegion;
Rectangle aIndicatorRect( Point( 0,
- (rControlRegion.GetBoundRect().GetHeight()-indicator_size)/2),
+ (rControlRegion.GetHeight()-indicator_size)/2),
Size( indicator_size, indicator_size ) );
- rNativeContentRegion = Region( aIndicatorRect );
+ rNativeContentRegion = aIndicatorRect;
returnVal = TRUE;
}
if( (nType == CTRL_EDITBOX || nType == CTRL_SPINBOX) && nPart == PART_ENTIRE_CONTROL )
@@ -1101,10 +1101,10 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
GtkWidget* widget = gWidgetData[m_nScreen].gEditBoxWidget;
GtkRequisition aReq;
gtk_widget_size_request( widget, &aReq );
- Rectangle aEditRect = rControlRegion.GetBoundRect();
+ Rectangle aEditRect = rControlRegion;
aEditRect = Rectangle( aEditRect.TopLeft(),
Size( aEditRect.GetWidth(), aReq.height+1 ) );
- rNativeBoundingRegion = Region( aEditRect );
+ rNativeBoundingRegion = aEditRect;
rNativeContentRegion = rNativeBoundingRegion;
returnVal = TRUE;
}
@@ -1118,7 +1118,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
"slider-width", &slider_width,
"slider-length", &slider_length,
(char *)NULL);
- Rectangle aRect( rControlRegion.GetBoundRect() );
+ Rectangle aRect( rControlRegion );
if( nPart == PART_THUMB_HORZ )
{
aRect.Right() = aRect.Left() + slider_length - 1;
@@ -1129,7 +1129,7 @@ BOOL GtkSalGraphics::getNativeControlRegion( ControlType nType,
aRect.Bottom() = aRect.Top() + slider_length - 1;
aRect.Right() = aRect.Left() + slider_width - 1;
}
- rNativeBoundingRegion = rNativeContentRegion = Region( aRect );
+ rNativeBoundingRegion = rNativeContentRegion = aRect;
returnVal = TRUE;
}
@@ -1432,7 +1432,8 @@ BOOL GtkSalGraphics::NWPaintGTKScrollbar( ControlType, ControlPart nPart,
const ImplControlValue& aValue,
const OUString& )
{
- ScrollbarValue* pScrollbarVal = (ScrollbarValue *)(aValue.getOptionalVal());
+ OSL_ASSERT( aValue.getType() == CTRL_SCROLLBAR );
+ const ScrollbarValue* pScrollbarVal = static_cast<const ScrollbarValue *>(&aValue);
GdkPixmap* pixmap = NULL;
Rectangle pixmapRect, scrollbarRect;
GtkStateType stateType;
@@ -1979,7 +1980,7 @@ BOOL GtkSalGraphics::NWPaintGTKSpinBox( ControlType nType, ControlPart nPart,
Rectangle pixmapRect;
GtkStateType stateType;
GtkShadowType shadowType;
- SpinbuttonValue * pSpinVal = (SpinbuttonValue *)(aValue.getOptionalVal());
+ const SpinbuttonValue * pSpinVal = (aValue.getType() == CTRL_SPINBUTTONS) ? static_cast<const SpinbuttonValue *>(&aValue) : NULL;
Rectangle upBtnRect;
ControlPart upBtnPart = PART_BUTTON_UP;
ControlState upBtnState = CTRL_STATE_ENABLED;
@@ -2290,10 +2291,11 @@ BOOL GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, ControlPart,
const ImplControlValue& aValue,
const OUString& )
{
+ OSL_ASSERT( aValue.getType() == CTRL_TAB_ITEM );
GdkPixmap * pixmap;
Rectangle pixmapRect;
Rectangle tabRect;
- TabitemValue * pTabitemValue = (TabitemValue *)(aValue.getOptionalVal());
+ const TabitemValue * pTabitemValue = static_cast<const TabitemValue *>(&aValue);
GtkStateType stateType;
GtkShadowType shadowType;
if( ! gWidgetData[ m_nScreen ].gCacheTabItems )
@@ -2571,9 +2573,9 @@ BOOL GtkSalGraphics::NWPaintGTKToolbar(
gtk_handle_box_set_shadow_type( GTK_HANDLE_BOX(gWidgetData[m_nScreen].gHandleBoxWidget), shadowType );
// evaluate grip rect
- ToolbarValue* pVal = (ToolbarValue*)aValue.getOptionalVal();
- if( pVal )
+ if( aValue.getType() == CTRL_TOOLBAR )
{
+ const ToolbarValue* pVal = static_cast<const ToolbarValue*>(&aValue);
g_x = pVal->maGripRect.Left();
g_y = pVal->maGripRect.Top();
g_w = pVal->maGripRect.GetWidth();
@@ -3044,20 +3046,19 @@ BOOL GtkSalGraphics::NWPaintGTKSlider(
ControlState nState, const ImplControlValue& rValue,
const OUString& )
{
+ OSL_ASSERT( rValue.getType() == CTRL_SLIDER );
NWEnsureGTKSlider( m_nScreen );
gint w, h;
w = rControlRectangle.GetWidth();
h = rControlRectangle.GetHeight();
- SliderValue* pVal = (SliderValue*)rValue.getOptionalVal();
+ const SliderValue* pVal = static_cast<const SliderValue*>(&rValue);
GdkPixmap* pixmap = NWGetPixmapFromScreen( rControlRectangle );
if( ! pixmap )
return FALSE;
- (void)pVal;
-
GdkDrawable* const &pixDrawable = GDK_DRAWABLE( pixmap );
GtkWidget* pWidget = (nPart == PART_TRACK_HORZ_AREA)
? GTK_WIDGET(gWidgetData[m_nScreen].gHScale)
diff --git a/vcl/unx/headless/svpgdi.hxx b/vcl/unx/headless/svpgdi.hxx
index ca1af87f8862..1ad9eca9d272 100644
--- a/vcl/unx/headless/svpgdi.hxx
+++ b/vcl/unx/headless/svpgdi.hxx
@@ -86,7 +86,7 @@ public:
virtual void SetTextColor( SalColor nSalColor );
virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
- virtual void GetFontMetric( ImplFontMetricData* );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
virtual ImplFontCharMap* GetImplFontCharMap() const;
virtual void GetDevFontList( ImplDevFontList* );
diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx
index 6da09b38023c..86f356031f52 100644
--- a/vcl/unx/headless/svppspgraphics.cxx
+++ b/vcl/unx/headless/svppspgraphics.cxx
@@ -792,7 +792,7 @@ void PspGraphics::GetDevFontSubstList( OutputDevice* pOutDev )
}
}
-void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric )
+void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int )
{
const psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
psp::PrintFontInfo aInfo;
diff --git a/vcl/unx/headless/svppspgraphics.hxx b/vcl/unx/headless/svppspgraphics.hxx
index 063dff34c3c2..987923eb40ff 100644
--- a/vcl/unx/headless/svppspgraphics.hxx
+++ b/vcl/unx/headless/svppspgraphics.hxx
@@ -105,7 +105,7 @@ public:
virtual void SetTextColor( SalColor nSalColor );
virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
- virtual void GetFontMetric( ImplFontMetricData* );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
virtual ImplFontCharMap* GetImplFontCharMap() const;
virtual void GetDevFontList( ImplDevFontList* );
diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx
index ecb8b11b7e04..34941fc777db 100644
--- a/vcl/unx/headless/svptext.cxx
+++ b/vcl/unx/headless/svptext.cxx
@@ -240,12 +240,15 @@ USHORT SvpSalGraphics::SetFont( ImplFontSelectData* pIFSD, int nFallbackLevel )
// ---------------------------------------------------------------------------
-void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric )
+void SvpSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel )
{
- if( m_pServerFont[0] != NULL )
+ if( nFallbackLevel >= MAX_FALLBACK )
+ return;
+
+ if( m_pServerFont[nFallbackLevel] != NULL )
{
long rDummyFactor;
- m_pServerFont[0]->FetchFontMetric( *pMetric, rDummyFactor );
+ m_pServerFont[nFallbackLevel]->FetchFontMetric( *pMetric, rDummyFactor );
}
}
diff --git a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
index 065b5435eeb0..7544a566d8ae 100644
--- a/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkgdi.hxx
@@ -63,17 +63,17 @@ public:
// native widget methods
virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
- virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+ virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
const Point& aPos, BOOL& rIsInside );
- virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+ virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& rCaption );
- virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+ virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& rCaption );
- virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState,
+ virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& rCaption,
- Region &rNativeBoundingRegion, Region &rNativeContentRegion );
+ Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
//helper methods for frame's UpdateSettings
void updateSettings( AllSettings& rSettings );
@@ -179,7 +179,7 @@ protected:
ControlState nState, const ImplControlValue& aValue,
const OUString& rCaption );
- BOOL drawNativeMixedStateCheck( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+ BOOL drawNativeMixedStateCheck( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& rCaption );
};
diff --git a/vcl/unx/inc/pspgraphics.h b/vcl/unx/inc/pspgraphics.h
index 4b1ac12116a3..a91029e34580 100644
--- a/vcl/unx/inc/pspgraphics.h
+++ b/vcl/unx/inc/pspgraphics.h
@@ -102,7 +102,7 @@ public:
virtual void SetTextColor( SalColor nSalColor );
virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
- virtual void GetFontMetric( ImplFontMetricData* );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* );
virtual ImplFontCharMap* GetImplFontCharMap() const;
virtual void GetDevFontList( ImplDevFontList* );
diff --git a/vcl/unx/inc/salframe.h b/vcl/unx/inc/salframe.h
index 6f962c9a13b3..ed173e61fe61 100644
--- a/vcl/unx/inc/salframe.h
+++ b/vcl/unx/inc/salframe.h
@@ -108,6 +108,8 @@ class VCL_DLLPUBLIC X11SalFrame : public SalFrame
bool m_bXEmbed;
int nVisibility_;
int m_nWorkArea;
+ bool m_bSetFocusOnMap;
+
int nScreenSaversTimeout_;
Rectangle maPaintRegion;
diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h
index 42d9c5592317..33e6be054d48 100644
--- a/vcl/unx/inc/salgdi.h
+++ b/vcl/unx/inc/salgdi.h
@@ -253,7 +253,7 @@ public:
virtual void SetTextColor( SalColor nSalColor );
virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
- virtual void GetFontMetric( ImplFontMetricData* );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
virtual ULONG GetKernPairs( ULONG nMaxPairs, ImplKernPairData* );
virtual ImplFontCharMap* GetImplFontCharMap() const;
virtual void GetDevFontList( ImplDevFontList* );
diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx
index 3adc9f5c679a..29d79f88ffb3 100644
--- a/vcl/unx/kde/salnativewidgets-kde.cxx
+++ b/vcl/unx/kde/salnativewidgets-kde.cxx
@@ -255,19 +255,19 @@ class WidgetPainter
@return valid push button.
*/
- QPushButton *pushButton( const Region& rControlRegion, BOOL bDefault );
+ QPushButton *pushButton( const Rectangle& rControlRegion, BOOL bDefault );
/** 'Get' method for radio button.
@see pushButton()
*/
- QRadioButton *radioButton( const Region& rControlRegion );
+ QRadioButton *radioButton( const Rectangle& rControlRegion );
/** 'Get' method for check box.
@see pushButton()
*/
- QCheckBox *checkBox( const Region& rControlRegion );
+ QCheckBox *checkBox( const Rectangle& rControlRegion );
/** 'Get' method for combo box.
@@ -276,74 +276,74 @@ class WidgetPainter
@see pushButton(), m_pEditableComboBox
*/
- QComboBox *comboBox( const Region& rControlRegion, BOOL bEditable );
+ QComboBox *comboBox( const Rectangle& rControlRegion, BOOL bEditable );
/** 'Get' method for line edit box.
@see pushButton()
*/
- QLineEdit *lineEdit( const Region& rControlRegion );
+ QLineEdit *lineEdit( const Rectangle& rControlRegion );
/** 'Get' method for spin box.
@see pushButton()
*/
- QSpinWidget *spinWidget( const Region& rControlRegion );
+ QSpinWidget *spinWidget( const Rectangle& rControlRegion );
/** 'Get' method for tab bar.
@see pushButton()
*/
- QTabBar *tabBar( const Region& rControlRegion );
+ QTabBar *tabBar( const Rectangle& rControlRegion );
/** 'Get' method for tab widget.
@see pushButton()
*/
- QTabWidget *tabWidget( const Region& rControlRegion );
+ QTabWidget *tabWidget( const Rectangle& rControlRegion );
/** 'Get' method for list view.
@see pushButton()
*/
- QListView *listView( const Region& rControlRegion );
+ QListView *listView( const Rectangle& rControlRegion );
/** 'Get' method for scroll bar.
@see pushButton()
*/
- QScrollBar *scrollBar( const Region& rControlRegion,
+ QScrollBar *scrollBar( const Rectangle& rControlRegion,
BOOL bHorizontal, const ImplControlValue& aValue );
/** 'Get' method for tool bar.
@see pushButton()
*/
- QToolBar *toolBar( const Region& rControlRegion, BOOL bHorizontal );
+ QToolBar *toolBar( const Rectangle& rControlRegion, BOOL bHorizontal );
/** 'Get' method for tool button.
@see pushButton()
*/
- QToolButton *toolButton( const Region& rControlRegion );
+ QToolButton *toolButton( const Rectangle& rControlRegion );
/** 'Get' method for menu bar.
@see pushButton()
*/
- QMenuBar *menuBar( const Region& rControlRegion );
+ QMenuBar *menuBar( const Rectangle& rControlRegion );
/** 'Get' method for popup menu.
@see pushButton()
*/
- QPopupMenu *popupMenu( const Region& rControlRegion );
+ QPopupMenu *popupMenu( const Rectangle& rControlRegion );
/** 'Get' method for progress bar
@see pushButton()
*/
- QProgressBar *progressBar( const Region& rControlRegion );
+ QProgressBar *progressBar( const Rectangle& rControlRegion );
// TODO other widgets
@@ -363,7 +363,7 @@ class WidgetPainter
QStyle::SFlags vclStateValue2SFlags( ControlState nState, const ImplControlValue& aValue );
public:
- /** Convert VCL Region to QRect.
+ /** Convert VCL Rectangle to QRect.
@param rControlRegion
The region to convert.
@@ -371,7 +371,7 @@ class WidgetPainter
@return
The bounding box of the region.
*/
- static QRect region2QRect( const Region& rControlRegion );
+ static QRect region2QRect( const Rectangle& rControlRegion );
};
WidgetPainter::WidgetPainter( void )
@@ -525,7 +525,7 @@ BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget,
}
else if ( strcmp( "QSpinWidget", pClassName ) == 0 )
{
- SpinbuttonValue *pValue = static_cast<SpinbuttonValue *> ( aValue.getOptionalVal() );
+ const SpinbuttonValue *pValue = static_cast<const SpinbuttonValue *> ( &aValue );
// Is any of the buttons pressed?
QStyle::SCFlags eActive = QStyle::SC_None;
@@ -576,7 +576,7 @@ BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget,
}
else if ( strcmp( "QTabBar", pClassName ) == 0 )
{
- TabitemValue *pValue = static_cast<TabitemValue *> ( aValue.getOptionalVal() );
+ const TabitemValue *pValue = static_cast<const TabitemValue *> ( &aValue );
QTab *pTab = NULL;
if ( pValue )
@@ -614,7 +614,7 @@ BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget,
}
else if ( strcmp( "QScrollBar", pClassName ) == 0 )
{
- ScrollbarValue *pValue = static_cast<ScrollbarValue *> ( aValue.getOptionalVal() );
+ const ScrollbarValue *pValue = static_cast<const ScrollbarValue *> ( &aValue );
QStyle::SCFlags eActive = QStyle::SC_None;
if ( pValue )
@@ -695,7 +695,7 @@ BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget,
if ( nPart == PART_THUMB_HORZ || nPart == PART_THUMB_VERT )
{
- ToolbarValue *pValue = static_cast< ToolbarValue * >( aValue.getOptionalVal() );
+ const ToolbarValue *pValue = static_cast< const ToolbarValue * >( &aValue );
QRect qThumbRect = region2QRect( pValue->maGripRect );
qThumbRect.moveBy( -qWidgetPos.x(), -qWidgetPos.y() );
@@ -795,7 +795,7 @@ BOOL WidgetPainter::drawStyledWidget( QWidget *pWidget,
return TRUE;
}
-QPushButton *WidgetPainter::pushButton( const Region& rControlRegion,
+QPushButton *WidgetPainter::pushButton( const Rectangle& rControlRegion,
BOOL bDefault )
{
if ( !m_pPushButton )
@@ -832,7 +832,7 @@ QPushButton *WidgetPainter::pushButton( const Region& rControlRegion,
return m_pPushButton;
}
-QRadioButton *WidgetPainter::radioButton( const Region& rControlRegion )
+QRadioButton *WidgetPainter::radioButton( const Rectangle& rControlRegion )
{
if ( !m_pRadioButton )
m_pRadioButton = new QRadioButton( NULL, "radio_button" );
@@ -861,7 +861,7 @@ QRadioButton *WidgetPainter::radioButton( const Region& rControlRegion )
return m_pRadioButton;
}
-QCheckBox *WidgetPainter::checkBox( const Region& rControlRegion )
+QCheckBox *WidgetPainter::checkBox( const Rectangle& rControlRegion )
{
if ( !m_pCheckBox )
m_pCheckBox = new QCheckBox( NULL, "check_box" );
@@ -890,7 +890,7 @@ QCheckBox *WidgetPainter::checkBox( const Region& rControlRegion )
return m_pCheckBox;
}
-QComboBox *WidgetPainter::comboBox( const Region& rControlRegion,
+QComboBox *WidgetPainter::comboBox( const Rectangle& rControlRegion,
BOOL bEditable )
{
QComboBox *pComboBox = NULL;
@@ -915,7 +915,7 @@ QComboBox *WidgetPainter::comboBox( const Region& rControlRegion,
return pComboBox;
}
-QLineEdit *WidgetPainter::lineEdit( const Region& rControlRegion )
+QLineEdit *WidgetPainter::lineEdit( const Rectangle& rControlRegion )
{
if ( !m_pLineEdit )
m_pLineEdit = new QLineEdit( NULL, "line_edit" );
@@ -928,7 +928,7 @@ QLineEdit *WidgetPainter::lineEdit( const Region& rControlRegion )
return m_pLineEdit;
}
-QSpinWidget *WidgetPainter::spinWidget( const Region& rControlRegion )
+QSpinWidget *WidgetPainter::spinWidget( const Rectangle& rControlRegion )
{
if ( !m_pSpinWidget )
{
@@ -947,7 +947,7 @@ QSpinWidget *WidgetPainter::spinWidget( const Region& rControlRegion )
return m_pSpinWidget;
}
-QTabBar *WidgetPainter::tabBar( const Region& rControlRegion )
+QTabBar *WidgetPainter::tabBar( const Rectangle& rControlRegion )
{
if ( !m_pTabBar )
{
@@ -976,7 +976,7 @@ QTabBar *WidgetPainter::tabBar( const Region& rControlRegion )
return m_pTabBar;
}
-QTabWidget *WidgetPainter::tabWidget( const Region& rControlRegion )
+QTabWidget *WidgetPainter::tabWidget( const Rectangle& rControlRegion )
{
if ( !m_pTabWidget )
m_pTabWidget = new QTabWidget( NULL, "tab_widget" );
@@ -990,7 +990,7 @@ QTabWidget *WidgetPainter::tabWidget( const Region& rControlRegion )
return m_pTabWidget;
}
-QListView *WidgetPainter::listView( const Region& rControlRegion )
+QListView *WidgetPainter::listView( const Rectangle& rControlRegion )
{
if ( !m_pListView )
m_pListView = new QListView( NULL, "list_view" );
@@ -1003,7 +1003,7 @@ QListView *WidgetPainter::listView( const Region& rControlRegion )
return m_pListView;
}
-QScrollBar *WidgetPainter::scrollBar( const Region& rControlRegion,
+QScrollBar *WidgetPainter::scrollBar( const Rectangle& rControlRegion,
BOOL bHorizontal, const ImplControlValue& aValue )
{
if ( !m_pScrollBar )
@@ -1019,7 +1019,7 @@ QScrollBar *WidgetPainter::scrollBar( const Region& rControlRegion,
m_pScrollBar->resize( qRect.size() );
m_pScrollBar->setOrientation( bHorizontal? Qt::Horizontal: Qt::Vertical );
- ScrollbarValue *pValue = static_cast<ScrollbarValue *> ( aValue.getOptionalVal() );
+ const ScrollbarValue *pValue = static_cast<const ScrollbarValue *> ( &aValue );
if ( pValue )
{
m_pScrollBar->setMinValue( pValue->mnMin );
@@ -1031,7 +1031,7 @@ QScrollBar *WidgetPainter::scrollBar( const Region& rControlRegion,
return m_pScrollBar;
}
-QToolBar *WidgetPainter::toolBar( const Region& rControlRegion, BOOL bHorizontal )
+QToolBar *WidgetPainter::toolBar( const Rectangle& rControlRegion, BOOL bHorizontal )
{
if ( !m_pMainWindow )
m_pMainWindow = new QMainWindow( NULL, "main_window" );
@@ -1064,7 +1064,7 @@ QToolBar *WidgetPainter::toolBar( const Region& rControlRegion, BOOL bHorizontal
return pToolBar;
}
-QToolButton *WidgetPainter::toolButton( const Region& rControlRegion)
+QToolButton *WidgetPainter::toolButton( const Rectangle& rControlRegion)
{
if ( !m_pToolButton )
m_pToolButton = new QToolButton( NULL, "tool_button" );
@@ -1077,7 +1077,7 @@ QToolButton *WidgetPainter::toolButton( const Region& rControlRegion)
return m_pToolButton;
}
-QMenuBar *WidgetPainter::menuBar( const Region& rControlRegion)
+QMenuBar *WidgetPainter::menuBar( const Rectangle& rControlRegion)
{
if ( !m_pMenuBar )
{
@@ -1098,7 +1098,7 @@ QMenuBar *WidgetPainter::menuBar( const Region& rControlRegion)
return m_pMenuBar;
}
-QPopupMenu *WidgetPainter::popupMenu( const Region& rControlRegion)
+QPopupMenu *WidgetPainter::popupMenu( const Rectangle& rControlRegion)
{
if ( !m_pPopupMenu )
{
@@ -1119,7 +1119,7 @@ QPopupMenu *WidgetPainter::popupMenu( const Region& rControlRegion)
return m_pPopupMenu;
}
-QProgressBar *WidgetPainter::progressBar( const Region& rControlRegion )
+QProgressBar *WidgetPainter::progressBar( const Rectangle& rControlRegion )
{
if ( !m_pProgressBar )
m_pProgressBar = new QProgressBar( NULL, "progress_bar" );
@@ -1155,12 +1155,10 @@ QStyle::SFlags WidgetPainter::vclStateValue2SFlags( ControlState nState,
return nStyle;
}
-QRect WidgetPainter::region2QRect( const Region& rControlRegion )
+QRect WidgetPainter::region2QRect( const Rectangle& rControlRegion )
{
- Rectangle aRect = rControlRegion.GetBoundRect();
-
- return QRect( QPoint( aRect.Left(), aRect.Top() ),
- QPoint( aRect.Right(), aRect.Bottom() ) );
+ return QRect( QPoint( rControlRegion.Left(), rControlRegion.Top() ),
+ QPoint( rControlRegion.Right(), rControlRegion.Bottom() ) );
}
/** Instance of WidgetPainter.
@@ -1176,21 +1174,21 @@ class KDESalGraphics : public X11SalGraphics
virtual ~KDESalGraphics() {}
virtual BOOL IsNativeControlSupported( ControlType nType, ControlPart nPart );
virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart,
- const Region& rControlRegion, const Point& aPos,
+ const Rectangle& rControlRegion, const Point& aPos,
BOOL& rIsInside );
virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart,
- const Region& rControlRegion, ControlState nState,
+ const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue,
const OUString& aCaption );
virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart,
- const Region& rControlRegion, ControlState nState,
+ const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue,
const OUString& aCaption );
virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart,
- const Region& rControlRegion, ControlState nState,
+ const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue,
const OUString& aCaption,
- Region &rNativeBoundingRegion, Region &rNativeContentRegion );
+ Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
};
/** What widgets can be drawn the native way.
@@ -1241,13 +1239,13 @@ BOOL KDESalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
nType/nPart combination.
*/
BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
- const Region& rControlRegion, const Point& rPos,
+ const Rectangle& rControlRegion, const Point& rPos,
BOOL& rIsInside )
{
if ( nType == CTRL_SCROLLBAR )
{
// make position relative to rControlRegion
- Point aPos = rPos - rControlRegion.GetBoundRect().TopLeft();
+ Point aPos = rPos - rControlRegion.TopLeft();
rIsInside = FALSE;
BOOL bHorizontal = ( nPart == PART_BUTTON_LEFT || nPart == PART_BUTTON_RIGHT );
@@ -1348,7 +1346,7 @@ BOOL KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
A caption or title string (like button text etc.)
*/
BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
- const Region& rControlRegion, ControlState nState,
+ const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue,
const OUString& )
{
@@ -1490,7 +1488,7 @@ BOOL KDESalGraphics::drawNativeControl( ControlType nType, ControlPart nPart,
A caption or title string (like button text etc.)
*/
BOOL KDESalGraphics::drawNativeControlText( ControlType, ControlPart,
- const Region&, ControlState,
+ const Rectangle&, ControlState,
const ImplControlValue&,
const OUString& )
{
@@ -1515,10 +1513,10 @@ BOOL KDESalGraphics::drawNativeControlText( ControlType, ControlPart,
A caption or title string (like button text etc.)
*/
BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart,
- const Region& rControlRegion, ControlState nState,
+ const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue&,
const OUString&,
- Region &rNativeBoundingRegion, Region &rNativeContentRegion )
+ Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion )
{
BOOL bReturn = FALSE;
QRect qBoundingRect = WidgetPainter::region2QRect( rControlRegion );
@@ -1697,12 +1695,12 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar
// Bounding region
Point aBPoint( qBoundingRect.x(), qBoundingRect.y() );
Size aBSize( qBoundingRect.width(), qBoundingRect.height() );
- rNativeBoundingRegion = Region( Rectangle( aBPoint, aBSize ) );
+ rNativeBoundingRegion = Rectangle( aBPoint, aBSize );
// Region of the content
Point aPoint( qRect.x(), qRect.y() );
Size aSize( qRect.width(), qRect.height() );
- rNativeContentRegion = Region( Rectangle( aPoint, aSize ) );
+ rNativeContentRegion = Rectangle( aPoint, aSize );
}
return bReturn;
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index 5f8b5d2ae59e..2c04af384c51 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -80,15 +80,13 @@ QStyle::State vclStateValue2StateFlag( ControlState nControlState,
}
/**
- Convert VCL Region to QRect.
- @param rControlRegion The region to convert.
- @return The bounding box of the region.
+ Convert VCL Rectangle to QRect.
+ @param rControlRegion The Rectangle to convert.
+ @return The matching QRect
*/
-QRect region2QRect( const Region& rControlRegion )
+QRect region2QRect( const Rectangle& rControlRegion )
{
- Rectangle aRect = rControlRegion.GetBoundRect();
-
- return QRect(aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight());
+ return QRect(rControlRegion.Left(), rControlRegion.Top(), rControlRegion.GetWidth(), rControlRegion.GetHeight());
}
KDESalGraphics::KDESalGraphics() :
@@ -157,7 +155,7 @@ BOOL KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart par
}
BOOL KDESalGraphics::hitTestNativeControl( ControlType, ControlPart,
- const Region&, const Point&,
+ const Rectangle&, const Point&,
BOOL& )
{
return FALSE;
@@ -195,6 +193,22 @@ namespace
kapp->style()->drawComplexControl(element, option, &painter);
}
+ int getFrameWidth()
+ {
+ static int s_nFrameWidth = -1;
+ if( s_nFrameWidth < 0 )
+ {
+ // fill in a default
+ s_nFrameWidth = 2;
+ QFrame aFrame( NULL );
+ aFrame.setFrameRect( QRect(0, 0, 100, 30) );
+ aFrame.setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
+ aFrame.ensurePolished();
+ s_nFrameWidth = aFrame.frameWidth();
+ }
+ return s_nFrameWidth;
+ }
+
void lcl_drawFrame(QStyle::PrimitiveElement element, QImage* image, QStyle::State state)
{
#if ( QT_VERSION >= QT_VERSION_CHECK( 4, 5, 0 ) )
@@ -219,7 +233,7 @@ namespace
}
BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
- const Region& rControlRegion, ControlState nControlState,
+ const Rectangle& rControlRegion, ControlState nControlState,
const ImplControlValue& value,
const OUString& )
{
@@ -236,7 +250,8 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
type = CTRL_SPINBUTTONS;
if( type == CTRL_SPINBUTTONS )
{
- SpinbuttonValue* pSpinVal = (SpinbuttonValue *)(value.getOptionalVal());
+ OSL_ASSERT( value.getType() != CTRL_SPINBUTTONS );
+ const SpinbuttonValue* pSpinVal = static_cast<const SpinbuttonValue *>(&value);
Rectangle aButtonRect( pSpinVal->maUpperRect);
aButtonRect.Union( pSpinVal->maLowerRect );;
widgetRect = QRect( aButtonRect.Left(), aButtonRect.Top(),
@@ -409,7 +424,8 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
if ((part == PART_DRAW_BACKGROUND_VERT) || (part == PART_DRAW_BACKGROUND_HORZ))
{
QStyleOptionSlider option;
- ScrollbarValue* sbVal = static_cast<ScrollbarValue *> ( value.getOptionalVal() );
+ OSL_ASSERT( value.getType() == CTRL_SCROLLBAR );
+ const ScrollbarValue* sbVal = static_cast<const ScrollbarValue *>(&value);
//if the scroll bar is active (aka not degenrate...allow for hover events
if (sbVal->mnVisibleSize < sbVal->mnMax)
@@ -445,9 +461,9 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
QStyleOptionSpinBox option;
// determine active control
- SpinbuttonValue* pSpinVal = (SpinbuttonValue *)(value.getOptionalVal());
- if( pSpinVal )
+ if( value.getType() == CTRL_SPINBUTTONS )
{
+ const SpinbuttonValue* pSpinVal = static_cast<const SpinbuttonValue *>(&value);
if( (pSpinVal->mnUpperState & CTRL_STATE_PRESSED) )
option.activeSubControls |= QStyle::SC_SpinBoxUp;
if( (pSpinVal->mnLowerState & CTRL_STATE_PRESSED) )
@@ -480,18 +496,25 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
lcl_drawFrame( QStyle::PE_Frame, m_image,
vclStateValue2StateFlag(nControlState, value) );
- int size = kapp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin);
+ // draw just the border, see http://qa.openoffice.org/issues/show_bug.cgi?id=107945
+ int nFrameWidth = getFrameWidth();
pTempClipRegion = XCreateRegion();
XRectangle xRect = { widgetRect.left(), widgetRect.top(), widgetRect.width(), widgetRect.height() };
XUnionRectWithRegion( &xRect, pTempClipRegion, pTempClipRegion );
- XLIB_Region pSubtract = XCreateRegion();
- xRect.x += size;
- xRect.y += size;
- xRect.width -= 2* size;
- xRect.height -= 2*size;
- XUnionRectWithRegion( &xRect, pSubtract, pSubtract );
- XSubtractRegion( pTempClipRegion, pSubtract, pTempClipRegion );
- XDestroyRegion( pSubtract );
+ xRect.x += nFrameWidth;
+ xRect.y += nFrameWidth;
+
+ // do not crash for too small widgets, see http://qa.openoffice.org/issues/show_bug.cgi?id=112102
+ if( xRect.width > 2*nFrameWidth && xRect.height > 2*nFrameWidth )
+ {
+ xRect.width -= 2*nFrameWidth;
+ xRect.height -= 2*nFrameWidth;
+
+ XLIB_Region pSubtract = XCreateRegion();
+ XUnionRectWithRegion( &xRect, pSubtract, pSubtract );
+ XSubtractRegion( pTempClipRegion, pSubtract, pTempClipRegion );
+ XDestroyRegion( pSubtract );
+ }
}
else if (type == CTRL_FIXEDBORDER)
{
@@ -513,7 +536,8 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
}
else if (type == CTRL_SLIDER && (part == PART_TRACK_HORZ_AREA || part == PART_TRACK_VERT_AREA))
{
- SliderValue* slVal = static_cast<SliderValue *> ( value.getOptionalVal() );
+ OSL_ASSERT( value.getType() == CTRL_SLIDER );
+ const SliderValue* slVal = static_cast<const SliderValue *>(&value);
QStyleOptionSlider option;
option.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
@@ -566,10 +590,10 @@ BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
}
BOOL KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
- const Region& controlRegion, ControlState controlState,
+ const Rectangle& controlRegion, ControlState controlState,
const ImplControlValue& val,
const OUString&,
- Region &nativeBoundingRegion, Region &nativeContentRegion )
+ Rectangle &nativeBoundingRegion, Rectangle &nativeContentRegion )
{
bool retVal = false;
@@ -744,14 +768,14 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
{
if( part == PART_BORDER )
{
- int size = kapp->style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
+ int nFrameWidth = getFrameWidth();
USHORT nStyle = val.getNumericVal();
if( nStyle & FRAME_DRAW_NODRAW )
{
// in this case the question is: how thick would a frame be
// see brdwin.cxx, decoview.cxx
// most probably the behavior in decoview.cxx is wrong.
- contentRect.adjust(size, size, -size, -size);
+ contentRect.adjust(nFrameWidth, nFrameWidth, -nFrameWidth, -nFrameWidth);
}
retVal = true;
}
@@ -869,12 +893,12 @@ BOOL KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
// Bounding region
Point aBPoint( boundingRect.x(), boundingRect.y() );
Size aBSize( boundingRect.width(), boundingRect.height() );
- nativeBoundingRegion = Region( Rectangle( aBPoint, aBSize ) );
+ nativeBoundingRegion = Rectangle( aBPoint, aBSize );
// Region of the content
Point aPoint( contentRect.x(), contentRect.y() );
Size aSize( contentRect.width(), contentRect.height() );
- nativeContentRegion = Region( Rectangle( aPoint, aSize ) );
+ nativeContentRegion = Rectangle( aPoint, aSize );
}
return retVal;
diff --git a/vcl/unx/kde4/KDESalGraphics.hxx b/vcl/unx/kde4/KDESalGraphics.hxx
index 5661d743e0cd..0bce1700f1fc 100644
--- a/vcl/unx/kde4/KDESalGraphics.hxx
+++ b/vcl/unx/kde4/KDESalGraphics.hxx
@@ -58,12 +58,12 @@ class KDESalGraphics : public X11SalGraphics
type/part combination.
*/
virtual BOOL hitTestNativeControl( ControlType type, ControlPart part,
- const Region& rControlRegion, const Point& aPos,
+ const Rectangle& rControlRegion, const Point& aPos,
BOOL& rIsInside );
/** Draw the requested control described by part/nControlState.
@param rControlRegion
- The bounding region of the complete control in VCL frame coordinates.
+ The bounding Rectangle of the complete control in VCL frame coordinates.
@param aValue
An optional value (tristate/numerical/string).
@@ -72,7 +72,7 @@ class KDESalGraphics : public X11SalGraphics
A caption or title string (like button text etc.)
*/
virtual BOOL drawNativeControl( ControlType type, ControlPart part,
- const Region& rControlRegion, ControlState nControlState,
+ const Rectangle& rControlRegion, ControlState nControlState,
const ImplControlValue& aValue,
const rtl::OUString& aCaption );
@@ -85,7 +85,7 @@ class KDESalGraphics : public X11SalGraphics
@param aCaption A caption or title string (like button text etc.)
*/
virtual BOOL drawNativeControlText( ControlType, ControlPart,
- const Region&, ControlState,
+ const Rectangle&, ControlState,
const ImplControlValue&,
const rtl::OUString& ) { return false; }
/** Check if the bounding regions match.
@@ -106,8 +106,8 @@ class KDESalGraphics : public X11SalGraphics
A caption or title string (like button text etc.)
*/
virtual BOOL getNativeControlRegion( ControlType type, ControlPart part,
- const Region& rControlRegion, ControlState nControlState,
+ const Rectangle& rControlRegion, ControlState nControlState,
const ImplControlValue& aValue,
const rtl::OUString& aCaption,
- Region &rNativeBoundingRegion, Region &rNativeContentRegion );
+ Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
}; \ No newline at end of file
diff --git a/vcl/unx/source/app/i18n_im.cxx b/vcl/unx/source/app/i18n_im.cxx
index 9f1ffee3d1c4..c797da34e76c 100644
--- a/vcl/unx/source/app/i18n_im.cxx
+++ b/vcl/unx/source/app/i18n_im.cxx
@@ -36,10 +36,6 @@
# endif
#endif
#include <poll.h>
-#ifdef SOLARIS
-// for SetSystemEnvironment()
-#include <sal/alloca.h>
-#endif
#include <tools/prex.h>
#include <X11/Xlocale.h>
@@ -53,6 +49,7 @@
#include <i18n_status.hxx>
#include <osl/thread.h>
+#include <osl/process.h>
using namespace vcl;
#include "i18n_cb.hxx"
@@ -179,21 +176,13 @@ SetSystemLocale( const char* p_inlocale )
#ifdef SOLARIS
static void
-SetSystemEnvironment( const char* p_locale )
+SetSystemEnvironment( const rtl::OUString& rLocale )
{
- const char *lc_all = "LC_ALL=%s";
- const char *lang = "LANG=%s";
-
- char *p_buffer;
+ rtl::OUString LC_ALL_Var(RTL_CONSTASCII_USTRINGPARAM("LC_ALL"));
+ osl_setEnvironment(LC_ALL_Var.pData, rLocale.pData);
- if (p_locale != NULL)
- {
- p_buffer = (char*)alloca(10 + strlen(p_locale));
- sprintf(p_buffer, lc_all, p_locale);
- putenv(strdup(p_buffer));
- sprintf(p_buffer, lang, p_locale);
- putenv(strdup(p_buffer));
- }
+ rtl::OUString LANG_Var(RTL_CONSTASCII_USTRINGPARAM("LANG"));
+ osl_setEnvironment(LANG_Var.pData, rLocale.pData);
}
#endif
@@ -249,13 +238,13 @@ SalI18N_InputMethod::SetLocale( const char* pLocale )
osl_setThreadTextEncoding (RTL_TEXTENCODING_ISO_8859_1);
locale = SetSystemLocale( "en_US" );
#ifdef SOLARIS
- SetSystemEnvironment( "en_US" );
+ SetSystemEnvironment( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en_US")) );
#endif
if (! IsXWindowCompatibleLocale(locale))
{
locale = SetSystemLocale( "C" );
#ifdef SOLARIS
- SetSystemEnvironment( "C" );
+ SetSystemEnvironment( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("C")) );
#endif
if (! IsXWindowCompatibleLocale(locale))
mbUseable = False;
@@ -440,7 +429,8 @@ SalI18N_InputMethod::CreateMethod ( Display *pDisplay )
if ((maMethod == (XIM)NULL) && (getenv("XMODIFIERS") != NULL))
{
- putenv (strdup("XMODIFIERS"));
+ rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("XMODIFIERS"));
+ osl_clearEnvironment(envVar.pData);
XSetLocaleModifiers("");
maMethod = XOpenIM(pDisplay, NULL, NULL, NULL);
mbMultiLingual = False;
diff --git a/vcl/unx/source/app/saldata.cxx b/vcl/unx/source/app/saldata.cxx
index 50ef71df8619..beb7b60a551c 100644
--- a/vcl/unx/source/app/saldata.cxx
+++ b/vcl/unx/source/app/saldata.cxx
@@ -425,10 +425,8 @@ void SalXLib::Init()
* the clipboard build another connection
* to the xserver using $DISPLAY
*/
- const char envpre[] = "DISPLAY=";
- char *envstr = new char[sizeof(envpre)+aDisplay.getLength()];
- snprintf(envstr, sizeof(envpre)+aDisplay.getLength(), "DISPLAY=%s", aDisplay.getStr());
- putenv(envstr);
+ rtl::OUString envVar(RTL_CONSTASCII_USTRINGPARAM("DISPLAY"));
+ osl_setEnvironment(envVar.pData, aParam.pData);
}
break;
}
diff --git a/vcl/unx/source/app/saldisp.cxx b/vcl/unx/source/app/saldisp.cxx
index aa2afab93657..13a0d1093c8e 100644
--- a/vcl/unx/source/app/saldisp.cxx
+++ b/vcl/unx/source/app/saldisp.cxx
@@ -59,9 +59,7 @@
#ifdef USE_XINERAMA
#ifdef USE_XINERAMA_XORG
-#if defined(X86) || defined(X86_64)
#include <X11/extensions/Xinerama.h>
-#endif
#elif defined USE_XINERAMA_XSUN
#if defined(SOLARIS) && defined(INTEL) // missing extension header in standard installation
#define MAXFRAMEBUFFERS 16
@@ -2638,7 +2636,7 @@ void SalDisplay::InitXinerama()
if( result > 0 && nFramebuffers > 1 )
{
m_bXinerama = true;
- m_aXineramaScreens = std::vector<Rectangle>( nFramebuffers );
+ m_aXineramaScreens = std::vector<Rectangle>();
for( int i = 0; i < nFramebuffers; i++ )
addXineramaScreenUnique( pFramebuffers[i].x,
pFramebuffers[i].y,
@@ -2647,7 +2645,6 @@ void SalDisplay::InitXinerama()
}
}
#elif defined(USE_XINERAMA_XORG)
-#if defined( X86 ) || defined( X86_64 )
if( XineramaIsActive( pDisp_ ) )
{
int nFramebuffers = 1;
@@ -2670,7 +2667,6 @@ if( XineramaIsActive( pDisp_ ) )
}
}
#endif
-#endif
#if OSL_DEBUG_LEVEL > 1
if( m_bXinerama )
{
diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx
index 3e24cd7c8e45..03816857f27c 100644
--- a/vcl/unx/source/fontmanager/fontconfig.cxx
+++ b/vcl/unx/source/fontmanager/fontconfig.cxx
@@ -854,19 +854,22 @@ bool PrintFontManager::addFontconfigDir( const rtl::OString& rDirName )
fprintf( stderr, "FcConfigAppFontAddDir( \"%s\") => %d\n", pDirName, bDirOk );
#endif
- if( bDirOk )
+ if( !bDirOk )
+ return false;
+
+ // load dir-specific fc-config file too if available
+ const rtl::OString aConfFileName = rDirName + "/fc_local.conf";
+ FILE* pCfgFile = fopen( aConfFileName.getStr(), "rb" );
+ if( pCfgFile )
{
- const rtl::OString aConfFileName = rDirName + "/fc_local.conf";
+ fclose( pCfgFile);
bool bCfgOk = rWrapper.FcConfigParseAndLoad( rWrapper.FcConfigGetCurrent(),
- (FcChar8*)aConfFileName.getStr(), FcTrue );
- (void)bCfgOk; // silence compiler warning
-
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "FcConfigParseAndLoad( \"%s\") => %d\n", aConfFileName.getStr(), bCfgOk );
-#endif
+ (FcChar8*)aConfFileName.getStr(), FcTrue );
+ if( !bCfgOk )
+ fprintf( stderr, "FcConfigParseAndLoad( \"%s\") => %d\n", aConfFileName.getStr(), bCfgOk );
}
- return bDirOk;
+ return true;
}
static void addtopattern(FontCfgWrapper& rWrapper, FcPattern *pPattern,
diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx
index d3eb103b9dd6..220d7bbcae87 100644
--- a/vcl/unx/source/gdi/pspgraphics.cxx
+++ b/vcl/unx/source/gdi/pspgraphics.cxx
@@ -885,7 +885,7 @@ void PspGraphics::GetDevFontSubstList( OutputDevice* pOutDev )
}
}
-void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric )
+void PspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int )
{
const psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
psp::PrintFontInfo aInfo;
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx
index 6024b66f6010..16529d3ce78f 100644
--- a/vcl/unx/source/gdi/salgdi3.cxx
+++ b/vcl/unx/source/gdi/salgdi3.cxx
@@ -1763,16 +1763,19 @@ bool GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize,
// ----------------------------------------------------------------------------
void
-X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric )
+X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric, int nFallbackLevel )
{
- if( mpServerFont[0] != NULL )
+ if( nFallbackLevel >= MAX_FALLBACK )
+ return;
+
+ if( mpServerFont[nFallbackLevel] != NULL )
{
long rDummyFactor;
- mpServerFont[0]->FetchFontMetric( *pMetric, rDummyFactor );
+ mpServerFont[nFallbackLevel]->FetchFontMetric( *pMetric, rDummyFactor );
}
- else if( mXFont[0] != NULL )
+ else if( mXFont[nFallbackLevel] != NULL )
{
- mXFont[0]->ToImplFontMetricData( pMetric );
+ mXFont[nFallbackLevel]->ToImplFontMetricData( pMetric );
if ( bFontVertical_ )
pMetric->mnOrientation = 0;
}
diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx
index 90c6a196143e..8617bc4e5bfa 100644
--- a/vcl/unx/source/gdi/salprnpsp.cxx
+++ b/vcl/unx/source/gdi/salprnpsp.cxx
@@ -617,6 +617,7 @@ BOOL PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
// copy everything to job setup
copyJobDataToJobSetup( pJobSetup, aInfo );
+ JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, m_aJobData );
return TRUE;
}
return FALSE;
diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx
index 6d243e41db8c..b0248662a2a2 100644
--- a/vcl/unx/source/window/salframe.cxx
+++ b/vcl/unx/source/window/salframe.cxx
@@ -665,6 +665,7 @@ X11SalFrame::X11SalFrame( SalFrame *pParent, ULONG nSalFrameStyle, SystemParentD
mhStackingWindow = None;
mhForeignParent = None;
mhBackgroundPixmap = None;
+ m_bSetFocusOnMap = false;
pGraphics_ = NULL;
pFreeGraphics_ = NULL;
@@ -1226,14 +1227,11 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate )
}
XLIB_Time nUserTime = 0;
- if( ! bNoActivate && (nStyle_ & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_TOOLWINDOW)) == 0 )
- {
- if( GetDisplay()->getWMAdaptor()->getWindowManagerName().EqualsAscii("Metacity") )
- nUserTime = pDisplay_->GetLastUserEventTime( true );
- else
- nUserTime = pDisplay_->GetLastUserEventTime();
- }
+ if( ! bNoActivate && (nStyle_ & (SAL_FRAME_STYLE_OWNERDRAWDECORATION)) == 0 )
+ nUserTime = pDisplay_->GetLastUserEventTime( true );
GetDisplay()->getWMAdaptor()->setUserTime( this, nUserTime );
+ if( ! bNoActivate && (nStyle_ & SAL_FRAME_STYLE_TOOLWINDOW) )
+ m_bSetFocusOnMap = true;
// actually map the window
if( m_bXEmbed )
@@ -4172,6 +4170,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
&aEvent );
}
+ bool bSetFocus = m_bSetFocusOnMap;
/* #99570# another workaround for sawfish: if a transient window for the same parent is shown
* sawfish does not set the focus to it. Applies only for click to focus mode.
*/
@@ -4181,7 +4180,7 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
// since this will lead to a parent loose-focus, close status,
// reget focus, open status, .... flicker loop
if ( (I18NStatus::get().getStatusFrame() != this) )
- XSetInputFocus( GetXDisplay(), GetShellWindow(), RevertToParent, CurrentTime );
+ bSetFocus = true;
}
/*
@@ -4219,10 +4218,21 @@ long X11SalFrame::Dispatch( XEvent *pEvent )
mpParent->GetShellWindow(),
RevertToParent,
CurrentTime );
+ bSetFocus = false;
+ }
+
+ if( bSetFocus )
+ {
+ XSetInputFocus( GetXDisplay(),
+ GetShellWindow(),
+ RevertToParent,
+ CurrentTime );
}
+
RestackChildren();
mbInShow = FALSE;
+ m_bSetFocusOnMap = false;
}
break;
diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk
index eb54531c375c..04bc3f13ce4d 100644
--- a/vcl/util/makefile.mk
+++ b/vcl/util/makefile.mk
@@ -312,7 +312,7 @@ SHL2STDLIBS=\
# prepare linking of Xinerama
.IF "$(USE_XINERAMA)" != "NO"
-.IF "$(OS)"=="MACOSX"
+.IF "$(OS)"=="MACOSX" || "$(OS)$(CPU)" == "LINUXX"
XINERAMALIBS=-lXinerama
.ELSE
.IF "$(OS)" != "SOLARIS" || "$(USE_XINERAMA_VERSION)" == "Xorg"
@@ -391,12 +391,18 @@ SHL4STDLIBS+= $(XRANDR_LIBS)
.ENDIF
.ENDIF
+.IF "$(OS)$(CPU)" == "LINUXX"
+EXTRALIBPATHS+=-L$(LIBRARY_PATH)
+.ENDIF # "$(OS)$(CPU)" == "LINUXX"
.ENDIF # "$(ENABLE_GTK)" != ""
# KDE plugin
.IF "$(ENABLE_KDE)" != ""
.IF "$(KDE_ROOT)"!=""
EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib
+.IF "$(OS)$(CPU)" == "LINUXX"
+EXTRALIBPATHS+=-L$(KDE_ROOT)$/lib64
+.ENDIF
.ENDIF
LIB5TARGET=$(SLB)$/ikde_plug_
LIB5FILES=$(SLB)$/kdeplug.lib
diff --git a/vcl/win/inc/salgdi.h b/vcl/win/inc/salgdi.h
index b1bfcbee96f4..5b8cfb099756 100644..100755
--- a/vcl/win/inc/salgdi.h
+++ b/vcl/win/inc/salgdi.h
@@ -227,17 +227,17 @@ protected:
virtual BOOL drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, ULONG nSize );
// native widget rendering methods that require mirroring
- virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+ virtual BOOL hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
const Point& aPos, BOOL& rIsInside );
- virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+ virtual BOOL drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Region& rControlRegion,
+ virtual BOOL drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
const rtl::OUString& aCaption );
- virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Region& rControlRegion, ControlState nState,
+ virtual BOOL getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const rtl::OUString& aCaption,
- Region &rNativeBoundingRegion, Region &rNativeContentRegion );
+ Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion );
virtual bool drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap,
@@ -282,7 +282,7 @@ public:
// set the font
virtual USHORT SetFont( ImplFontSelectData*, int nFallbackLevel );
// get the current font's etrics
- virtual void GetFontMetric( ImplFontMetricData* );
+ virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
// get kernign pairs of the current font
// return only PairCount if (pKernPairs == NULL)
virtual ULONG GetKernPairs( ULONG nPairs, ImplKernPairData* pKernPairs );
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index d1b5a9cfdeae..01fecec94b2f 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -1760,8 +1760,11 @@ USHORT WinSalGraphics::SetFont( ImplFontSelectData* pFont, int nFallbackLevel )
// -----------------------------------------------------------------------
-void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric )
+void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel )
{
+ // temporarily change the HDC to the font in the fallback level
+ HFONT hOldFont = SelectFont( mhDC, mhFonts[nFallbackLevel] );
+
if ( aSalShlData.mbWNT )
{
wchar_t aFaceName[LF_FACESIZE+60];
@@ -1775,8 +1778,12 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric )
pMetric->maName = ImplSalGetUniString( aFaceName );
}
+ // get the font metric
TEXTMETRICA aWinMetric;
- if( !GetTextMetricsA( mhDC, &aWinMetric ) )
+ const bool bOK = GetTextMetricsA( mhDC, &aWinMetric );
+ // restore the HDC to the font in the base level
+ SelectFont( mhDC, hOldFont );
+ if( !bOK )
return;
// device independent font attributes
@@ -1815,7 +1822,7 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric )
// #107888# improved metric compatibility for Asian fonts...
// TODO: assess workaround below for CWS >= extleading
// TODO: evaluate use of aWinMetric.sTypo* members for CJK
- if( mpWinFontData[0] && mpWinFontData[0]->SupportsCJK() )
+ if( mpWinFontData[nFallbackLevel] && mpWinFontData[nFallbackLevel]->SupportsCJK() )
{
pMetric->mnIntLeading += pMetric->mnExtLeading;
@@ -1836,7 +1843,7 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricData* pMetric )
// #109280# HACK korean only: increase descent for wavelines and impr
if( !aSalShlData.mbWNT )
- if( mpWinFontData[0]->SupportsKorean() )
+ if( mpWinFontData[nFallbackLevel]->SupportsKorean() )
pMetric->mnDescent += pMetric->mnExtLeading;
}
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index be5d7f8360bc..8197fb37cd6d 100644..100755
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -317,7 +317,7 @@ BOOL WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
*/
BOOL WinSalGraphics::hitTestNativeControl( ControlType,
ControlPart,
- const Region&,
+ const Rectangle&,
const Point&,
BOOL& )
{
@@ -553,9 +553,9 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
}
if( nType == CTRL_SPINBUTTONS && nPart == PART_ALL_BUTTONS )
{
- SpinbuttonValue *pValue = (SpinbuttonValue*) aValue.getOptionalVal();
- if( pValue )
+ if( aValue.getType() == CTRL_SPINBUTTONS )
{
+ const SpinbuttonValue *pValue = static_cast<const SpinbuttonValue*>(&aValue);
BOOL bOk = FALSE;
RECT rect;
@@ -578,9 +578,9 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
//rc.bottom--;
if( nPart == PART_ALL_BUTTONS )
{
- SpinbuttonValue *pValue = (SpinbuttonValue*) aValue.getOptionalVal();
- if( pValue )
+ if( aValue.getType() == CTRL_SPINBUTTONS )
{
+ const SpinbuttonValue *pValue = static_cast<const SpinbuttonValue*>(&aValue);
BOOL bOk = FALSE;
RECT rect;
@@ -787,20 +787,19 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
iPart = TABP_TABITEMLEFTEDGE;
rc.bottom--;
- TabitemValue *pValue = (TabitemValue*) aValue.getOptionalVal();
- if( pValue )
+ OSL_ASSERT( aValue.getType() == CTRL_TAB_ITEM );
+
+ const TabitemValue *pValue = static_cast<const TabitemValue*>(&aValue);
+ if( pValue->isBothAligned() )
{
- if( pValue->isBothAligned() )
- {
- iPart = TABP_TABITEMLEFTEDGE;
- rc.right--;
- }
- else if( pValue->isLeftAligned() )
- iPart = TABP_TABITEMLEFTEDGE;
- else if( pValue->isRightAligned() )
- iPart = TABP_TABITEMRIGHTEDGE;
- else iPart = TABP_TABITEM;
+ iPart = TABP_TABITEMLEFTEDGE;
+ rc.right--;
}
+ else if( pValue->isLeftAligned() )
+ iPart = TABP_TABITEMLEFTEDGE;
+ else if( pValue->isRightAligned() )
+ iPart = TABP_TABITEMRIGHTEDGE;
+ else iPart = TABP_TABITEM;
if( !(nState & CTRL_STATE_ENABLED) )
iState = TILES_DISABLED;
@@ -856,9 +855,12 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
}
else if( nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT )
{
- ToolbarValue *pValue = (ToolbarValue*) aValue.getOptionalVal();
- if( pValue && pValue->mbIsTopDockingArea )
- rc.top = 0; // extend potential gradient to cover menu bar as well
+ if( aValue.getType() == CTRL_TOOLBAR )
+ {
+ const ToolbarValue *pValue = static_cast<const ToolbarValue*>(&aValue);
+ if( pValue->mbIsTopDockingArea )
+ rc.top = 0; // extend potential gradient to cover menu bar as well
+ }
return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
}
}
@@ -868,9 +870,11 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( nPart != PART_ENTIRE_CONTROL )
return FALSE;
- MenubarValue *pValue = (MenubarValue*) aValue.getOptionalVal();
- if( pValue )
+ if( aValue.getType() == CTRL_MENUBAR )
+ {
+ const MenubarValue *pValue = static_cast<const MenubarValue*>(&aValue);
rc.bottom += pValue->maTopDockingAreaHeight; // extend potential gradient to cover docking area as well
+ }
return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
}
@@ -918,7 +922,8 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
ImplDrawTheme( hTheme, hDC, iPart, iState, aTRect, aCaption );
RECT aThumbRect;
- SliderValue* pVal = (SliderValue*)aValue.getOptionalVal();
+ OSL_ASSERT( aValue.getType() == CTRL_SLIDER );
+ const SliderValue* pVal = static_cast<const SliderValue*>(&aValue);
aThumbRect.left = pVal->maThumbRect.Left();
aThumbRect.top = pVal->maThumbRect.Top();
aThumbRect.right = pVal->maThumbRect.Right();
@@ -963,7 +968,7 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
*/
BOOL WinSalGraphics::drawNativeControl( ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const OUString& aCaption )
@@ -1043,7 +1048,7 @@ BOOL WinSalGraphics::drawNativeControl( ControlType nType,
if( !hTheme )
return false;
- Rectangle buttonRect = rControlRegion.GetBoundRect();
+ Rectangle buttonRect = rControlRegion;
RECT rc;
rc.left = buttonRect.Left();
rc.right = buttonRect.Right()+1;
@@ -1080,7 +1085,7 @@ BOOL WinSalGraphics::drawNativeControl( ControlType nType,
*/
BOOL WinSalGraphics::drawNativeControlText( ControlType,
ControlPart,
- const Region&,
+ const Rectangle&,
ControlState,
const ImplControlValue&,
const OUString& )
@@ -1104,12 +1109,12 @@ BOOL WinSalGraphics::drawNativeControlText( ControlType,
*/
BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
ControlPart nPart,
- const Region& rControlRegion,
+ const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& rControlValue,
const OUString&,
- Region &rNativeBoundingRegion,
- Region &rNativeContentRegion )
+ Rectangle &rNativeBoundingRegion,
+ Rectangle &rNativeContentRegion )
{
BOOL bRet = FALSE;
@@ -1146,7 +1151,7 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
if( hTheme )
{
Rectangle aRect( ImplGetThemeRect( hTheme, hDC, TP_SPLITBUTTONDROPDOWN,
- TS_HOT, rControlRegion.GetBoundRect() ) );
+ TS_HOT, rControlRegion ) );
rNativeContentRegion = aRect;
rNativeBoundingRegion = rNativeContentRegion;
if( !rNativeContentRegion.IsEmpty() )
@@ -1160,7 +1165,7 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
if( hTheme )
{
Rectangle aRect( ImplGetThemeRect( hTheme, hDC, PP_BAR,
- 0, rControlRegion.GetBoundRect() ) );
+ 0, rControlRegion ) );
rNativeContentRegion = aRect;
rNativeBoundingRegion = rNativeContentRegion;
if( !rNativeContentRegion.IsEmpty() )
@@ -1172,12 +1177,9 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
HTHEME hTheme = getThemeHandle( mhWnd, L"Combobox");
if( hTheme )
{
- Rectangle aBoxRect( rControlRegion.GetBoundRect() );
+ Rectangle aBoxRect( rControlRegion );
Rectangle aRect( ImplGetThemeRect( hTheme, hDC, CP_DROPDOWNBUTTON,
CBXS_NORMAL, aBoxRect ) );
- Rectangle aBrdRect( ImplGetThemeRect( hTheme, hDC, CP_BORDER,
- CBB_HOT, aBoxRect ) );
- aRect.Top() -= aBrdRect.GetHeight();
if( aRect.GetHeight() > aBoxRect.GetHeight() )
aBoxRect.Bottom() = aBoxRect.Top() + aRect.GetHeight();
if( aRect.GetWidth() > aBoxRect.GetWidth() )
@@ -1195,7 +1197,7 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
if( hTheme )
{
// get borderr size
- Rectangle aBoxRect( rControlRegion.GetBoundRect() );
+ Rectangle aBoxRect( rControlRegion );
Rectangle aRect( ImplGetThemeRect( hTheme, hDC, EP_BACKGROUNDWITHBORDER,
EBWBS_HOT, aBoxRect ) );
// ad app font height
@@ -1234,7 +1236,7 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
if( nPart == PART_THUMB_HORZ )
{
long nW = aThumbRect.GetWidth();
- Rectangle aRect( rControlRegion.GetBoundRect() );
+ Rectangle aRect( rControlRegion );
aRect.Right() = aRect.Left() + nW - 1;
rNativeContentRegion = aRect;
rNativeBoundingRegion = rNativeContentRegion;
@@ -1242,7 +1244,7 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
else
{
long nH = aThumbRect.GetHeight();
- Rectangle aRect( rControlRegion.GetBoundRect() );
+ Rectangle aRect( rControlRegion );
aRect.Bottom() = aRect.Top() + nH - 1;
rNativeContentRegion = aRect;
rNativeBoundingRegion = rNativeContentRegion;
@@ -1253,30 +1255,30 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
if ( ( nType == CTRL_TAB_ITEM ) && ( nPart == PART_ENTIRE_CONTROL ) )
{
- Rectangle aControlRect( rControlRegion.GetBoundRect() );
+ Rectangle aControlRect( rControlRegion );
rNativeContentRegion = aControlRect;
--aControlRect.Bottom();
- TabitemValue *pValue = static_cast< TabitemValue* >( rControlValue.getOptionalVal() );
- if ( pValue )
+ if( rControlValue.getType() == CTRL_TAB_ITEM )
{
+ const TabitemValue *pValue = static_cast<const TabitemValue*>(&rControlValue);
if ( pValue->isBothAligned() )
--aControlRect.Right();
- }
- if ( nState & CTRL_STATE_SELECTED )
- {
- aControlRect.Left() -= 2;
- if ( pValue && !pValue->isBothAligned() )
+ if ( nState & CTRL_STATE_SELECTED )
{
- if ( pValue->isLeftAligned() || pValue->isNotAligned() )
- aControlRect.Right() += 2;
- if ( pValue->isRightAligned() )
- aControlRect.Right() += 1;
+ aControlRect.Left() -= 2;
+ if ( pValue && !pValue->isBothAligned() )
+ {
+ if ( pValue->isLeftAligned() || pValue->isNotAligned() )
+ aControlRect.Right() += 2;
+ if ( pValue->isRightAligned() )
+ aControlRect.Right() += 1;
+ }
+ aControlRect.Top() -= 2;
+ aControlRect.Bottom() += 2;
}
- aControlRect.Top() -= 2;
- aControlRect.Bottom() += 2;
}
rNativeBoundingRegion = aControlRect;
bRet = TRUE;
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index ba19f2255646..6f0c98279e7b 100644..100755
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -2821,7 +2821,7 @@ sal_GlyphId GraphiteLayoutWinImpl::getKashidaGlyph(int & rWidth)
class GraphiteWinLayout : public WinLayout
{
private:
- mutable gr::WinFont mpFont;
+ mutable GraphiteWinFont mpFont;
grutils::GrFeatureParser * mpFeatures;
mutable GraphiteLayoutWinImpl maImpl;
public: