summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/app/brand.cxx81
-rw-r--r--vcl/source/app/dbggui.cxx5
-rw-r--r--vcl/source/app/dndhelp.cxx2
-rw-r--r--vcl/source/app/help.cxx14
-rw-r--r--vcl/source/app/i18nhelp.cxx3
-rw-r--r--vcl/source/app/idlemgr.cxx88
-rw-r--r--vcl/source/app/makefile.mk2
-rw-r--r--vcl/source/app/salvtables.cxx2
-rw-r--r--vcl/source/app/session.cxx8
-rw-r--r--vcl/source/app/settings.cxx114
-rw-r--r--vcl/source/app/solarmutex.cxx57
-rw-r--r--vcl/source/app/sound.cxx7
-rw-r--r--vcl/source/app/stdtext.cxx5
-rw-r--r--vcl/source/app/svapp.cxx73
-rw-r--r--vcl/source/app/svdata.cxx26
-rw-r--r--vcl/source/app/svmain.cxx151
-rw-r--r--vcl/source/app/svmainhook.cxx11
-rw-r--r--vcl/source/app/timer.cxx7
-rw-r--r--vcl/source/app/unohelp.cxx32
-rw-r--r--vcl/source/app/unohelp2.cxx3
-rw-r--r--vcl/source/app/vclevent.cxx22
-rw-r--r--vcl/source/components/display.cxx3
-rw-r--r--vcl/source/components/dtranscomp.cxx22
-rw-r--r--vcl/source/components/factory.cxx7
-rw-r--r--vcl/source/components/fontident.cxx3
-rw-r--r--vcl/source/control/button.cxx198
-rw-r--r--vcl/source/control/combobox.cxx16
-rw-r--r--vcl/source/control/ctrl.cxx5
-rwxr-xr-xvcl/source/control/edit.cxx46
-rw-r--r--vcl/source/control/field.cxx92
-rw-r--r--vcl/source/control/field2.cxx15
-rw-r--r--vcl/source/control/fixbrd.cxx5
-rw-r--r--vcl/source/control/fixed.cxx63
-rw-r--r--vcl/source/control/group.cxx5
-rw-r--r--vcl/source/control/ilstbox.cxx94
-rw-r--r--vcl/source/control/imgctrl.cxx9
-rw-r--r--vcl/source/control/longcurr.cxx5
-rw-r--r--vcl/source/control/lstbox.cxx3
-rw-r--r--vcl/source/control/menubtn.cxx5
-rw-r--r--vcl/source/control/morebtn.cxx43
-rw-r--r--vcl/source/control/scrbar.cxx7
-rw-r--r--vcl/source/control/slider.cxx5
-rw-r--r--vcl/source/control/spinbtn.cxx5
-rw-r--r--vcl/source/control/spinfld.cxx3
-rw-r--r--vcl/source/control/tabctrl.cxx48
-rw-r--r--vcl/source/control/throbber.cxx2
-rw-r--r--vcl/source/fontsubset/cff.cxx64
-rw-r--r--vcl/source/fontsubset/fontsubset.cxx8
-rw-r--r--vcl/source/fontsubset/gsub.cxx7
-rw-r--r--vcl/source/fontsubset/gsub.h3
-rw-r--r--vcl/source/fontsubset/list.c274
-rw-r--r--vcl/source/fontsubset/sft.cxx679
-rw-r--r--vcl/source/fontsubset/ttcr.cxx16
-rw-r--r--vcl/source/fontsubset/ttcr.hxx3
-rw-r--r--vcl/source/fontsubset/xlat.cxx2
-rw-r--r--vcl/source/fontsubset/xlat.hxx2
-rw-r--r--vcl/source/gdi/alpha.cxx3
-rw-r--r--vcl/source/gdi/animate.cxx3
-rw-r--r--vcl/source/gdi/base14.cxx6
-rw-r--r--vcl/source/gdi/bitmap.cxx39
-rw-r--r--vcl/source/gdi/bitmap2.cxx56
-rw-r--r--vcl/source/gdi/bitmap3.cxx10
-rw-r--r--vcl/source/gdi/bitmap4.cxx14
-rw-r--r--vcl/source/gdi/bitmapex.cxx94
-rw-r--r--vcl/source/gdi/bmpacc.cxx5
-rw-r--r--vcl/source/gdi/bmpacc2.cxx3
-rw-r--r--vcl/source/gdi/bmpacc3.cxx3
-rw-r--r--vcl/source/gdi/bmpconv.cxx14
-rw-r--r--vcl/source/gdi/bmpfast.cxx60
-rw-r--r--vcl/source/gdi/configsettings.cxx14
-rw-r--r--vcl/source/gdi/cvtgrf.cxx5
-rw-r--r--vcl/source/gdi/cvtsvm.cxx12
-rw-r--r--vcl/source/gdi/extoutdevdata.cxx3
-rw-r--r--vcl/source/gdi/font.cxx6
-rw-r--r--vcl/source/gdi/gdimtf.cxx254
-rw-r--r--vcl/source/gdi/gfxlink.cxx3
-rw-r--r--vcl/source/gdi/gradient.cxx96
-rw-r--r--vcl/source/gdi/graph.cxx3
-rw-r--r--vcl/source/gdi/graphictools.cxx19
-rw-r--r--vcl/source/gdi/hatch.cxx5
-rw-r--r--vcl/source/gdi/image.cxx81
-rw-r--r--vcl/source/gdi/imagerepository.cxx15
-rw-r--r--vcl/source/gdi/impanmvw.cxx3
-rw-r--r--vcl/source/gdi/impanmvw.hxx3
-rw-r--r--vcl/source/gdi/impbmp.cxx5
-rw-r--r--vcl/source/gdi/impgraph.cxx13
-rw-r--r--vcl/source/gdi/impimage.cxx21
-rw-r--r--vcl/source/gdi/impimagetree.cxx48
-rw-r--r--vcl/source/gdi/impvect.cxx5
-rw-r--r--vcl/source/gdi/impvect.hxx3
-rw-r--r--vcl/source/gdi/jobset.cxx18
-rw-r--r--vcl/source/gdi/lineinfo.cxx3
-rwxr-xr-xvcl/source/gdi/makefile.mk82
-rw-r--r--vcl/source/gdi/mapmod.cxx3
-rw-r--r--vcl/source/gdi/metaact.cxx30
-rw-r--r--vcl/source/gdi/metric.cxx9
-rw-r--r--vcl/source/gdi/octree.cxx3
-rw-r--r--vcl/source/gdi/oldprintadaptor.cxx2
-rwxr-xr-xvcl/source/gdi/outdev.cxx26
-rw-r--r--[-rwxr-xr-x]vcl/source/gdi/outdev2.cxx5
-rw-r--r--vcl/source/gdi/outdev3.cxx89
-rw-r--r--vcl/source/gdi/outdev4.cxx94
-rw-r--r--vcl/source/gdi/outdev5.cxx5
-rw-r--r--vcl/source/gdi/outdev6.cxx16
-rwxr-xr-xvcl/source/gdi/outdevnative.cxx3
-rw-r--r--vcl/source/gdi/outmap.cxx94
-rw-r--r--vcl/source/gdi/pdfextoutdevdata.cxx9
-rw-r--r--vcl/source/gdi/pdffontcache.cxx2
-rw-r--r--vcl/source/gdi/pdffontcache.hxx3
-rw-r--r--vcl/source/gdi/pdfwriter.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx144
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx21
-rw-r--r--vcl/source/gdi/pngread.cxx35
-rw-r--r--vcl/source/gdi/pngwrite.cxx12
-rw-r--r--vcl/source/gdi/polyscan.cxx3
-rw-r--r--vcl/source/gdi/print.cxx13
-rw-r--r--vcl/source/gdi/print2.cxx9
-rw-r--r--[-rwxr-xr-x]vcl/source/gdi/print3.cxx52
-rw-r--r--vcl/source/gdi/regband.cxx3
-rwxr-xr-xvcl/source/gdi/region.cxx27
-rw-r--r--[-rwxr-xr-x]vcl/source/gdi/salgdilayout.cxx4
-rw-r--r--[-rwxr-xr-x]vcl/source/gdi/sallayout.cxx75
-rw-r--r--vcl/source/gdi/salmisc.cxx9
-rw-r--r--vcl/source/gdi/salnativewidgets-none.cxx4
-rw-r--r--vcl/source/gdi/svcompat.cxx3
-rwxr-xr-xvcl/source/gdi/textlayout.cxx3
-rw-r--r--vcl/source/gdi/virdev.cxx4
-rw-r--r--vcl/source/gdi/wall.cxx3
-rw-r--r--vcl/source/glyphs/gcach_ftyp.cxx62
-rw-r--r--vcl/source/glyphs/gcach_ftyp.hxx12
-rwxr-xr-xvcl/source/glyphs/gcach_layout.cxx51
-rwxr-xr-xvcl/source/glyphs/gcach_rbmp.cxx3
-rw-r--r--vcl/source/glyphs/gcach_vdev.cxx3
-rw-r--r--vcl/source/glyphs/gcach_vdev.hxx3
-rw-r--r--vcl/source/glyphs/glyphcache.cxx2
-rw-r--r--vcl/source/glyphs/graphite_adaptors.cxx9
-rw-r--r--vcl/source/glyphs/graphite_cache.cxx5
-rw-r--r--vcl/source/glyphs/graphite_features.cxx12
-rw-r--r--vcl/source/glyphs/graphite_layout.cxx20
-rw-r--r--vcl/source/glyphs/graphite_serverfont.cxx3
-rw-r--r--vcl/source/glyphs/graphite_textsrc.cxx13
-rw-r--r--vcl/source/glyphs/graphite_textsrc.hxx15
-rw-r--r--vcl/source/glyphs/makefile.mk2
-rw-r--r--vcl/source/helper/canvasbitmap.cxx65
-rw-r--r--vcl/source/helper/canvastools.cxx19
-rw-r--r--vcl/source/helper/evntpost.cxx3
-rw-r--r--vcl/source/helper/lazydelete.cxx2
-rw-r--r--vcl/source/helper/strhelper.cxx3
-rw-r--r--vcl/source/helper/threadex.cxx5
-rw-r--r--vcl/source/helper/xconnection.cxx24
-rw-r--r--vcl/source/salmain/salmain.cxx5
-rw-r--r--vcl/source/src/btntext.src1
-rw-r--r--vcl/source/src/helptext.src23
-rw-r--r--vcl/source/src/images.src242
-rw-r--r--vcl/source/src/makefile.mk1
-rw-r--r--vcl/source/src/print.src10
-rw-r--r--vcl/source/src/units.src3
-rw-r--r--vcl/source/window/abstdlg.cxx5
-rw-r--r--vcl/source/window/accel.cxx110
-rw-r--r--vcl/source/window/accmgr.cxx79
-rw-r--r--vcl/source/window/arrange.cxx2
-rw-r--r--vcl/source/window/brdwin.cxx51
-rw-r--r--vcl/source/window/btndlg.cxx213
-rw-r--r--vcl/source/window/cmdevt.cxx7
-rw-r--r--vcl/source/window/cursor.cxx3
-rw-r--r--vcl/source/window/decoview.cxx2
-rw-r--r--vcl/source/window/dialog.cxx20
-rw-r--r--vcl/source/window/dlgctrl.cxx5
-rw-r--r--vcl/source/window/dndevdis.cxx139
-rw-r--r--vcl/source/window/dndlcon.cxx3
-rw-r--r--vcl/source/window/dockingarea.cxx2
-rw-r--r--vcl/source/window/dockmgr.cxx7
-rw-r--r--vcl/source/window/dockwin.cxx7
-rw-r--r--vcl/source/window/floatwin.cxx14
-rw-r--r--vcl/source/window/introwin.cxx5
-rw-r--r--vcl/source/window/javachild.cxx3
-rw-r--r--vcl/source/window/keycod.cxx9
-rw-r--r--vcl/source/window/keyevent.cxx2
-rwxr-xr-xvcl/source/window/menu.cxx43
-rw-r--r--vcl/source/window/mnemonic.cxx3
-rw-r--r--vcl/source/window/mnemonicengine.cxx3
-rw-r--r--vcl/source/window/mouseevent.cxx3
-rw-r--r--vcl/source/window/msgbox.cxx94
-rw-r--r--vcl/source/window/popupmenuwindow.cxx2
-rw-r--r--vcl/source/window/printdlg.cxx198
-rw-r--r--vcl/source/window/scrwnd.cxx14
-rw-r--r--vcl/source/window/scrwnd.hxx3
-rw-r--r--vcl/source/window/seleng.cxx85
-rw-r--r--vcl/source/window/split.cxx5
-rw-r--r--vcl/source/window/splitwin.cxx48
-rw-r--r--vcl/source/window/status.cxx230
-rw-r--r--vcl/source/window/syschild.cxx3
-rw-r--r--vcl/source/window/syswin.cxx12
-rw-r--r--vcl/source/window/tabdlg.cxx4
-rw-r--r--vcl/source/window/tabpage.cxx12
-rw-r--r--vcl/source/window/taskpanelist.cxx22
-rw-r--r--vcl/source/window/toolbox.cxx208
-rw-r--r--vcl/source/window/toolbox2.cxx36
-rw-r--r--vcl/source/window/window.cxx288
-rw-r--r--vcl/source/window/window2.cxx118
-rw-r--r--vcl/source/window/window3.cxx3
-rw-r--r--vcl/source/window/winproc.cxx8
-rw-r--r--vcl/source/window/wrkwin.cxx21
203 files changed, 2815 insertions, 4289 deletions
diff --git a/vcl/source/app/brand.cxx b/vcl/source/app/brand.cxx
new file mode 100644
index 000000000000..1657be61c4ff
--- /dev/null
+++ b/vcl/source/app/brand.cxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell, Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Michael Meeks <michael.meeks@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"
+
+#include <rtl/ustring.hxx>
+#include <rtl/bootstrap.hxx>
+#include <rtl/locale.hxx>
+#include <osl/process.h>
+#include <tools/urlobj.hxx>
+#include <tools/stream.hxx>
+#include <vcl/pngread.hxx>
+#include <vcl/svapp.hxx>
+
+namespace {
+ static bool loadPng(const char *pPath, const rtl::OUString &rName, BitmapEx &rBitmap)
+ {
+ rtl::OUString uri = rtl::OUString::createFromAscii( pPath ) + rName;
+ rtl::Bootstrap::expandMacros( uri );
+ INetURLObject aObj( uri );
+ SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ );
+ if ( !aStrm.GetError() ) {
+ vcl::PNGReader aReader( aStrm );
+ rBitmap = aReader.Read();
+ return !rBitmap.IsEmpty();
+ }
+ else
+ return false;
+ }
+}
+
+bool Application::LoadBrandBitmap (const char* pName, BitmapEx &rBitmap)
+{
+ // TODO - if we want more flexibility we could add a branding path
+ // in an rc file perhaps fallback to "about.bmp"
+ rtl::OUString aBaseName = ( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) +
+ rtl::OUString::createFromAscii( pName ) );
+ rtl::OUString aPng( RTL_CONSTASCII_USTRINGPARAM(".png") );
+
+ rtl_Locale *pLoc = NULL;
+ osl_getProcessLocale (&pLoc);
+ rtl::OLocale aLoc( pLoc );
+
+ rtl::OUString aName = aBaseName + aPng;
+ rtl::OUString aLocaleName = ( aBaseName + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("-")) +
+ aLoc.getLanguage() +
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("_")) +
+ aLoc.getCountry() + aPng );
+
+ return ( loadPng ("$BRAND_BASE_DIR/program/edition", aLocaleName, rBitmap) ||
+ loadPng ("$BRAND_BASE_DIR/program", aLocaleName, rBitmap) ||
+ loadPng ("$BRAND_BASE_DIR/program/edition", aName, rBitmap) ||
+ loadPng ("$BRAND_BASE_DIR/program", aName, rBitmap) );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index a50c8aeec149..727911db36bd 100644
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -62,7 +63,7 @@
#include "vcl/unohelp.hxx"
#include "vcl/unohelp2.hxx"
-#include "vos/mutex.hxx"
+#include <osl/mutex.hxx>
#include "vcl/salinst.hxx"
#include <map>
@@ -2026,3 +2027,5 @@ sal_uInt16 DbgRegisterNamedUserChannel( const XubString& _rChannelUIName, DbgPri
}
#endif // DBG_UTIL
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/dndhelp.cxx b/vcl/source/app/dndhelp.cxx
index d1eb2014b4df..ceaa8f904816 100644
--- a/vcl/source/app/dndhelp.cxx
+++ b/vcl/source/app/dndhelp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -180,3 +181,4 @@ void vcl::unohelper::DragAndDropWrapper::dropActionChanged( const ::com::sun::st
mpClient->dropActionChanged( rDTDE );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 13fb2d3c0893..41263675840f 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -379,12 +380,6 @@ HelpTextWindow::~HelpTextWindow()
if( this == ImplGetSVData()->maHelpData.mpHelpWin )
ImplGetSVData()->maHelpData.mpHelpWin = NULL;
-
- if ( maStatusText.Len() )
- {
- ImplSVData* pSVData = ImplGetSVData();
- pSVData->mpApp->HideHelpStatusText();
- }
}
// -----------------------------------------------------------------------
@@ -433,11 +428,6 @@ void HelpTextWindow::SetHelpText( const String& rHelpText )
void HelpTextWindow::ImplShow()
{
ImplDelData aDogTag( this );
- if ( maStatusText.Len() )
- {
- ImplSVData* pSVData = ImplGetSVData();
- pSVData->mpApp->ShowHelpStatusText( maStatusText );
- }
Show( sal_True, SHOW_NOACTIVATE );
if( !aDogTag.IsDelete() )
Update();
@@ -799,3 +789,5 @@ void ImplSetHelpWindowPos( Window* pHelpWin, sal_uInt16 nHelpWinStyle, sal_uInt1
aPos = pWindow->AbsoluteScreenToOutputPixel( aPos );
pHelpWin->SetPosPixel( aPos );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/i18nhelp.cxx b/vcl/source/app/i18nhelp.cxx
index 5b2f302adaa7..0f9a8df94255 100644
--- a/vcl/source/app/i18nhelp.cxx
+++ b/vcl/source/app/i18nhelp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -185,3 +186,5 @@ String vcl::I18nHelper::GetNum( long nNumber, sal_uInt16 nDecimals, sal_Bool bUs
{
return ImplGetLocaleDataWrapper().getNum( nNumber, nDecimals, bUseThousandSep, bTrailingZeros );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/idlemgr.cxx b/vcl/source/app/idlemgr.cxx
index 42e4cf09fdb0..cc6502a74896 100644
--- a/vcl/source/app/idlemgr.cxx
+++ b/vcl/source/app/idlemgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <tools/list.hxx>
#include <vcl/idlemgr.hxx>
#include <vcl/svapp.hxx>
@@ -40,15 +40,13 @@ struct ImplIdleData
sal_Bool mbTimeout;
};
-DECLARE_LIST( ImplIdleList, ImplIdleData* )
-
#define IMPL_IDLETIMEOUT 350
// =======================================================================
ImplIdleMgr::ImplIdleMgr()
{
- mpIdleList = new ImplIdleList( 8, 8, 8 );
+ mpIdleList = new ImplIdleList();
maTimer.SetTimeout( IMPL_IDLETIMEOUT );
maTimer.SetTimeoutHdl( LINK( this, ImplIdleMgr, TimeoutHdl ) );
@@ -59,13 +57,10 @@ ImplIdleMgr::ImplIdleMgr()
ImplIdleMgr::~ImplIdleMgr()
{
// Liste loeschen
- ImplIdleData* pIdleData = mpIdleList->First();
- while ( pIdleData )
- {
- delete pIdleData;
- pIdleData = mpIdleList->Next();
+ for ( size_t i = 0, n = mpIdleList->size(); i < n; ++i ) {
+ delete (*mpIdleList)[ i ];
}
-
+ mpIdleList->clear();
delete mpIdleList;
}
@@ -73,30 +68,30 @@ ImplIdleMgr::~ImplIdleMgr()
sal_Bool ImplIdleMgr::InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority )
{
- sal_uLong nPos = LIST_APPEND;
- ImplIdleData* pIdleData = mpIdleList->First();
- while ( pIdleData )
- {
- // Wenn Link schon existiert, dann gebe sal_False zurueck
- if ( pIdleData->maIdleHdl == rLink )
+ size_t nPos = (size_t)-1;
+ size_t n = mpIdleList->size();
+ for ( size_t i = 0; i < n; ++i ) {
+ // we need to check each element to verify that rLink isn't in the array
+ if ( (*mpIdleList)[ i ]->maIdleHdl == rLink ) {
return sal_False;
-
- // Nach Prioritaet sortieren
- if ( nPriority <= pIdleData->mnPriority )
- nPos = mpIdleList->GetCurPos();
-
- // Schleife nicht beenden, da noch
- // geprueft werden muss, ob sich der Link
- // schon in der Liste befindet
-
- pIdleData = mpIdleList->Next();
+ }
+ if ( nPriority <= (*mpIdleList)[ i ]->mnPriority ) {
+ nPos = i;
+ }
}
- pIdleData = new ImplIdleData;
+ ImplIdleData* pIdleData = new ImplIdleData;
pIdleData->maIdleHdl = rLink;
pIdleData->mnPriority = nPriority;
pIdleData->mbTimeout = sal_False;
- mpIdleList->Insert( pIdleData, nPos );
+
+ if ( nPos < mpIdleList->size() ) {
+ ImplIdleList::iterator it = mpIdleList->begin();
+ ::std::advance( it, nPos );
+ mpIdleList->insert( it, pIdleData );
+ } else {
+ mpIdleList->push_back( pIdleData );
+ }
// Wenn Timer noch nicht gestartet ist, dann starten
if ( !maTimer.IsActive() )
@@ -109,21 +104,16 @@ sal_Bool ImplIdleMgr::InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority )
void ImplIdleMgr::RemoveIdleHdl( const Link& rLink )
{
- ImplIdleData* pIdleData = mpIdleList->First();
- while ( pIdleData )
- {
- if ( pIdleData->maIdleHdl == rLink )
- {
- mpIdleList->Remove();
- delete pIdleData;
+ for ( ImplIdleList::iterator it = mpIdleList->begin(); it < mpIdleList->end(); ++it ) {
+ if ( (*it)->maIdleHdl == rLink ) {
+ delete *it;
+ mpIdleList->erase( it );
break;
}
-
- pIdleData = mpIdleList->Next();
}
// keine Handdler mehr da
- if ( !mpIdleList->Count() )
+ if ( mpIdleList->empty() )
maTimer.Stop();
}
@@ -131,20 +121,22 @@ void ImplIdleMgr::RemoveIdleHdl( const Link& rLink )
IMPL_LINK( ImplIdleMgr, TimeoutHdl, Timer*, EMPTYARG )
{
- ImplIdleData* pIdleData = mpIdleList->First();
- while ( pIdleData )
- {
- if ( !pIdleData->mbTimeout )
- {
+ for ( size_t i = 0; i < mpIdleList->size(); ++i ) {
+ ImplIdleData* pIdleData = (*mpIdleList)[ i ];
+ if ( !pIdleData->mbTimeout ) {
pIdleData->mbTimeout = sal_True;
pIdleData->maIdleHdl.Call( GetpApp() );
- // Kann im Handler entfernt worden sein
- if ( mpIdleList->GetPos( pIdleData ) != LIST_ENTRY_NOTFOUND )
- pIdleData->mbTimeout = sal_False;
+ // May have been removed in the handler
+ for ( size_t j = 0; j < mpIdleList->size(); ++j ) {
+ if ( (*mpIdleList)[ j ] == pIdleData ) {
+ pIdleData->mbTimeout = sal_False;
+ break;
+ }
+ }
}
-
- pIdleData = mpIdleList->Next();
}
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/makefile.mk b/vcl/source/app/makefile.mk
index 5d14f0032b4a..6e9c91f3c2e7 100644
--- a/vcl/source/app/makefile.mk
+++ b/vcl/source/app/makefile.mk
@@ -43,6 +43,7 @@ CDEFS+=-DDLLPOSTFIX=$(DLLPOSTFIX)
# --- Files --------------------------------------------------------
SLOFILES= $(SLO)$/dbggui.obj \
+ $(SLO)$/brand.obj \
$(SLO)$/help.obj \
$(SLO)$/idlemgr.obj \
$(SLO)$/settings.obj \
@@ -59,6 +60,7 @@ SLOFILES= $(SLO)$/dbggui.obj \
$(SLO)$/vclevent.obj \
$(SLO)$/i18nhelp.obj \
$(SLO)$/salvtables.obj \
+ $(SLO)$/solarmutex.obj \
$(SLO)$/session.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 8ee732acf981..8cbd1d816f8c 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -161,3 +162,4 @@ SalMenuItem::~SalMenuItem()
{
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/session.cxx b/vcl/source/app/session.cxx
index c8d55d109134..89aaf9026312 100644
--- a/vcl/source/app/session.cxx
+++ b/vcl/source/app/session.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,7 +49,8 @@ namespace css = com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::frame;
-using namespace rtl;
+
+using ::rtl::OUString;
SalSession::~SalSession()
{
@@ -361,7 +363,7 @@ OUString SAL_CALL vcl_session_getImplementationName()
Sequence< rtl::OUString > SAL_CALL vcl_session_getSupportedServiceNames()
{
Sequence< OUString > aRet(1);
- aRet[0] = OUString::createFromAscii("com.sun.star.frame.SessionManagerClient");
+ aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.SessionManagerClient"));
return aRet;
}
@@ -373,3 +375,5 @@ css::uno::Reference< XInterface > SAL_CALL vcl_session_createInstance( const css
return css::uno::Reference< XInterface >(pSVData->xSMClient, UNO_QUERY );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 480817f26b37..84b8d7cc9154 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,13 +48,11 @@
#include <unotools/syslocaleoptions.hxx>
#ifdef WNT
-#include "tools/prewin.h"
-#include <windows.h>
-#include "tools/postwin.h"
+#include <prewin.h>
+#include <postwin.h>
#endif
-using namespace rtl;
-
+using ::rtl::OUString;
// =======================================================================
DBG_NAME( AllSettings )
@@ -431,6 +430,7 @@ ImplStyleData::ImplStyleData()
mnAutoMnemonic = 1;
mnToolbarIconSize = STYLE_TOOLBAR_ICONSIZE_UNKNOWN;
mnSymbolsStyle = STYLE_SYMBOLS_AUTO;
+ mnUseImagesInMenus = STYLE_MENUIMAGES_AUTO;
mnPreferredSymbolsStyle = STYLE_SYMBOLS_AUTO;
mpFontOptions = NULL;
@@ -531,6 +531,7 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
mnUseFlatMenues = rData.mnUseFlatMenues;
mnAutoMnemonic = rData.mnAutoMnemonic;
mnUseImagesInMenus = rData.mnUseImagesInMenus;
+ mbPreferredUseImagesInMenus = rData.mbPreferredUseImagesInMenus;
mnSkipDisabledInMenus = rData.mnSkipDisabledInMenus;
mnToolbarIconSize = rData.mnToolbarIconSize;
mnSymbolsStyle = rData.mnSymbolsStyle;
@@ -557,8 +558,8 @@ void ImplStyleData::SetStandardStyles()
maPushButtonFont = aStdFont;
maFieldFont = aStdFont;
maIconFont = aStdFont;
- maFloatTitleFont = aStdFont;
aStdFont.SetWeight( WEIGHT_BOLD );
+ maFloatTitleFont = aStdFont;
maTitleFont = aStdFont;
maFaceColor = Color( COL_LIGHTGRAY );
@@ -618,7 +619,7 @@ void ImplStyleData::SetStandardStyles()
mnUseSystemUIFonts = 1;
mnUseFlatBorders = 0;
mnUseFlatMenues = 0;
- mnUseImagesInMenus = (sal_uInt16)sal_True;
+ mbPreferredUseImagesInMenus = sal_True;
mnSkipDisabledInMenus = (sal_uInt16)sal_False;
Gradient aGrad( GRADIENT_LINEAR, DEFAULT_WORKSPACE_GRADIENT_START_COLOR, DEFAULT_WORKSPACE_GRADIENT_END_COLOR );
@@ -691,36 +692,39 @@ void StyleSettings::Set3DColors( const Color& rColor )
{
switch ( nStyle )
{
- case STYLE_SYMBOLS_DEFAULT: return ::rtl::OUString::createFromAscii( "default" );
- case STYLE_SYMBOLS_HICONTRAST: return ::rtl::OUString::createFromAscii( "hicontrast" );
- case STYLE_SYMBOLS_INDUSTRIAL: return ::rtl::OUString::createFromAscii( "industrial" );
- case STYLE_SYMBOLS_CRYSTAL: return ::rtl::OUString::createFromAscii( "crystal" );
- case STYLE_SYMBOLS_TANGO: return ::rtl::OUString::createFromAscii( "tango" );
- case STYLE_SYMBOLS_OXYGEN: return ::rtl::OUString::createFromAscii( "oxygen" );
- case STYLE_SYMBOLS_CLASSIC: return ::rtl::OUString::createFromAscii( "classic" );
+ case STYLE_SYMBOLS_DEFAULT: return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("default"));
+ case STYLE_SYMBOLS_HICONTRAST: return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("hicontrast"));
+ case STYLE_SYMBOLS_INDUSTRIAL: return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("tango")); // industrial is dead
+ case STYLE_SYMBOLS_CRYSTAL: return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("crystal"));
+ case STYLE_SYMBOLS_TANGO: return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("tango"));
+ case STYLE_SYMBOLS_OXYGEN: return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("oxygen"));
+ case STYLE_SYMBOLS_CLASSIC: return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("classic"));
+ case STYLE_SYMBOLS_HUMAN: return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("human"));
}
- return ::rtl::OUString::createFromAscii( "auto" );
+ return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("auto"));
}
// -----------------------------------------------------------------------
sal_uLong StyleSettings::ImplNameToSymbolsStyle( const ::rtl::OUString &rName ) const
{
- if ( rName == ::rtl::OUString::createFromAscii( "default" ) )
+ if ( rName == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("default")) )
return STYLE_SYMBOLS_DEFAULT;
- else if ( rName == ::rtl::OUString::createFromAscii( "hicontrast" ) )
+ else if ( rName == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("hicontrast")) )
return STYLE_SYMBOLS_HICONTRAST;
- else if ( rName == ::rtl::OUString::createFromAscii( "industrial" ) )
- return STYLE_SYMBOLS_INDUSTRIAL;
- else if ( rName == ::rtl::OUString::createFromAscii( "crystal" ) )
+ else if ( rName == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("industrial")) )
+ return STYLE_SYMBOLS_TANGO; // industrial is dead
+ else if ( rName == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("crystal")) )
return STYLE_SYMBOLS_CRYSTAL;
- else if ( rName == ::rtl::OUString::createFromAscii( "tango" ) )
+ else if ( rName == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("tango")) )
return STYLE_SYMBOLS_TANGO;
- else if ( rName == ::rtl::OUString::createFromAscii( "oxygen" ) )
+ else if ( rName == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("oxygen")) )
return STYLE_SYMBOLS_OXYGEN;
- else if ( rName == ::rtl::OUString::createFromAscii( "classic" ) )
+ else if ( rName == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("classic")) )
return STYLE_SYMBOLS_CLASSIC;
+ else if ( rName == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("human")) )
+ return STYLE_SYMBOLS_HUMAN;
return STYLE_SYMBOLS_AUTO;
}
@@ -806,7 +810,8 @@ sal_uLong StyleSettings::GetAutoSymbolsStyle() const
if( bCont )
{
- if( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "gnome" ) )
+ if( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "gnome" ) ||
+ rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "windows" ) )
nRet = STYLE_SYMBOLS_TANGO;
else if( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde" ) )
nRet = STYLE_SYMBOLS_CRYSTAL;
@@ -846,12 +851,28 @@ sal_uLong StyleSettings::GetAutoSymbolsStyle() const
bool StyleSettings::CheckSymbolStyle( sal_uLong nStyle ) const
{
+ if ( nStyle == STYLE_SYMBOLS_INDUSTRIAL )
+ return false; // industrial is dead
+
static ImplImageTreeSingletonRef aImageTree;
return aImageTree->checkStyle( ImplSymbolsStyleToName( nStyle ) );
}
// -----------------------------------------------------------------------
+sal_Bool StyleSettings::GetUseImagesInMenus() const
+{
+ // icon mode selected in Tools -> Options... -> OpenOffice.org -> View
+ sal_uInt16 nStyle = mpData->mnUseImagesInMenus;
+
+ if ( nStyle == STYLE_MENUIMAGES_AUTO )
+ return GetPreferredUseImagesInMenus();
+
+ return (sal_Bool)nStyle;
+}
+
+// -----------------------------------------------------------------------
+
void StyleSettings::SetStandardStyles()
{
CopyData();
@@ -1058,6 +1079,7 @@ sal_Bool StyleSettings::operator ==( const StyleSettings& rSet ) const
(mpData->maFieldFont == rSet.mpData->maFieldFont) &&
(mpData->maIconFont == rSet.mpData->maIconFont) &&
(mpData->mnUseImagesInMenus == rSet.mpData->mnUseImagesInMenus) &&
+ (mpData->mbPreferredUseImagesInMenus == rSet.mpData->mbPreferredUseImagesInMenus) &&
(mpData->mnSkipDisabledInMenus == rSet.mpData->mnSkipDisabledInMenus) &&
(mpData->maFontColor == rSet.mpData->maFontColor ))
return sal_True;
@@ -1248,7 +1270,7 @@ void MiscSettings::SetDisablePrinting( sal_Bool bEnable )
vcl::SettingsConfigItem::get()->
setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DesktopManagement" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisablePrinting" ) ),
- rtl::OUString::createFromAscii( bEnable ? "true" : "false" ) );
+ bEnable ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("true")) : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("false" )) );
mpData->mnDisablePrinting = bEnable ? 1 : 0;
}
}
@@ -1304,7 +1326,7 @@ void MiscSettings::SetEnableATToolSupport( sal_Bool bEnable )
vcl::SettingsConfigItem::get()->
setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Accessibility" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableATToolSupport" ) ),
- rtl::OUString::createFromAscii( bEnable ? "true" : "false" ) );
+ bEnable ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("true")) : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("false" )) );
mpData->mnEnableATT = bEnable ? 1 : 0;
}
}
@@ -1520,8 +1542,6 @@ ImplAllSettingsData::ImplAllSettingsData()
meUILanguage = LANGUAGE_SYSTEM;
mpLocaleDataWrapper = NULL;
mpUILocaleDataWrapper = NULL;
- mpCollatorWrapper = NULL;
- mpUICollatorWrapper = NULL;
mpI18nHelper = NULL;
mpUII18nHelper = NULL;
maMiscSettings.SetEnableLocalizedDecimalSep( maSysLocale.GetOptions().IsDecimalSeparatorAsLocale() );
@@ -1547,8 +1567,6 @@ ImplAllSettingsData::ImplAllSettingsData( const ImplAllSettingsData& rData ) :
// called
mpLocaleDataWrapper = NULL;
mpUILocaleDataWrapper = NULL;
- mpCollatorWrapper = NULL;
- mpUICollatorWrapper = NULL;
mpI18nHelper = NULL;
mpUII18nHelper = NULL;
}
@@ -1561,10 +1579,6 @@ ImplAllSettingsData::~ImplAllSettingsData()
delete mpLocaleDataWrapper;
if ( mpUILocaleDataWrapper )
delete mpUILocaleDataWrapper;
- if ( mpCollatorWrapper )
- delete mpCollatorWrapper;
- if ( mpUICollatorWrapper )
- delete mpUICollatorWrapper;
if ( mpI18nHelper )
delete mpI18nHelper;
if ( mpUII18nHelper )
@@ -1885,11 +1899,11 @@ sal_Bool AllSettings::GetLayoutRTL() const
nUIMirroring = 0; // ask configuration only once
utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
vcl::unohelper::GetMultiServiceFactory(),
- OUString::createFromAscii( "org.openoffice.Office.Common/I18N/CTL" ) ); // note: case sensisitive !
+ OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/I18N/CTL")) ); // note: case sensisitive !
if ( aNode.isValid() )
{
sal_Bool bTmp = sal_Bool();
- ::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString::createFromAscii( "UIMirroring" ) );
+ ::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString(RTL_CONSTASCII_USTRINGPARAM("UIMirroring")) );
if( aValue >>= bTmp )
{
// found true or false; if it was nil, nothing is changed
@@ -1992,32 +2006,6 @@ const vcl::I18nHelper& AllSettings::GetUILocaleI18nHelper() const
return *mpData->mpUII18nHelper;
}
-
-// -----------------------------------------------------------------------
-/*
-const CollatorWrapper& AllSettings::GetCollatorWrapper() const
-{
- if ( !mpData->mpCollatorWrapper )
- {
- ((AllSettings*)this)->mpData->mpCollatorWrapper = new CollatorWrapper( vcl::unohelper::GetMultiServiceFactory() );
- ((AllSettings*)this)->mpData->mpCollatorWrapper->loadDefaultCollator( GetLocale(), 0 );
- }
- return *mpData->mpCollatorWrapper;
-}
-*/
-// -----------------------------------------------------------------------
-/*
-const CollatorWrapper& AllSettings::GetUICollatorWrapper() const
-{
- if ( !mpData->mpUICollatorWrapper )
- {
- ((AllSettings*)this)->mpData->mpUICollatorWrapper = new CollatorWrapper( vcl::unohelper::GetMultiServiceFactory() );
- ((AllSettings*)this)->mpData->mpUICollatorWrapper->loadDefaultCollator( GetUILocale(), 0 );
- }
- return *mpData->mpUICollatorWrapper;
-}
-*/
-
void AllSettings::LocaleSettingsChanged( sal_uInt32 nHint )
{
AllSettings aAllSettings( Application::GetSettings() );
@@ -2037,3 +2025,5 @@ void AllSettings::LocaleSettingsChanged( sal_uInt32 nHint )
Application::SetSettings( aAllSettings );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/solarmutex.cxx b/vcl/source/app/solarmutex.cxx
new file mode 100644
index 000000000000..6423a74e6c61
--- /dev/null
+++ b/vcl/source/app/solarmutex.cxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * 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 <vcl/solarmutex.hxx>
+
+using namespace vcl;
+
+SolarMutexObject::SolarMutexObject() : m_solarMutex( osl_createMutex() )
+{
+}
+
+SolarMutexObject::~SolarMutexObject()
+{
+ osl_destroyMutex( m_solarMutex );
+}
+
+void SolarMutexObject::acquire()
+{
+ osl_acquireMutex( m_solarMutex );
+}
+
+sal_Bool SolarMutexObject::tryToAcquire()
+{
+ return osl_tryToAcquireMutex( m_solarMutex );
+}
+
+void SolarMutexObject::release()
+{
+ osl_releaseMutex( m_solarMutex );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/vcl/source/app/sound.cxx b/vcl/source/app/sound.cxx
index d180f2647135..13f832339977 100644
--- a/vcl/source/app/sound.cxx
+++ b/vcl/source/app/sound.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,12 +30,8 @@
#include "precompiled_vcl.hxx"
#include <tools/urlobj.hxx>
#include <unotools/localfilehelper.hxx>
-#ifndef _UNOTOOLS_UCBSTREAMHELPER_HXX
#include <unotools/ucbstreamhelper.hxx>
-#endif
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/salframe.hxx>
#include <tools/debug.hxx>
#include <vcl/svdata.hxx>
@@ -58,3 +55,5 @@ void Sound::Beep( SoundType eType, Window* pWindow )
else
pWindow->ImplGetFrame()->Beep( eType );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/stdtext.cxx b/vcl/source/app/stdtext.cxx
index 7411baaf470e..3fc2e67cc488 100644
--- a/vcl/source/app/stdtext.cxx
+++ b/vcl/source/app/stdtext.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVIDS_HRC
#include <vcl/svids.hrc>
-#endif
#include <vcl/svdata.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/stdtext.hxx>
@@ -66,3 +65,5 @@ void ShowServiceNotAvailableError( Window* pParent,
aBox.Execute();
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index c61ddc0af6ae..e4cf7bf32330 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,8 +33,6 @@
#include "vcl/salinst.hxx"
#include "vcl/salframe.hxx"
#include "vcl/salsys.hxx"
-#include "vos/process.hxx"
-#include "vos/mutex.hxx"
#include "tools/tools.h"
#include "tools/debug.hxx"
#include "tools/time.hxx"
@@ -65,7 +64,8 @@
#include "osl/module.h"
#include "osl/file.hxx"
-
+#include "osl/mutex.hxx"
+#include "osl/process.h"
#include "osl/thread.h"
#include "rtl/tencinfo.h"
#include "rtl/instance.hxx"
@@ -139,7 +139,6 @@ namespace
}
-// #include <usr/refl.hxx>
class Reflection;
@@ -266,12 +265,6 @@ void Application::ShowStatusText( const XubString& )
// -----------------------------------------------------------------------
-void Application::ShowHelpStatusText( const XubString& )
-{
-}
-
-// -----------------------------------------------------------------------
-
void Application::ActivateExtHelp()
{
}
@@ -290,24 +283,23 @@ void Application::HideStatusText()
// -----------------------------------------------------------------------
-void Application::HideHelpStatusText()
+void Application::FocusChanged()
{
}
// -----------------------------------------------------------------------
-void Application::FocusChanged()
+void Application::DataChanged( const DataChangedEvent& )
{
}
// -----------------------------------------------------------------------
-
-void Application::DataChanged( const DataChangedEvent& )
+void Application::Init()
{
}
// -----------------------------------------------------------------------
-void Application::Init()
+void Application::InitFinished()
{
}
@@ -321,18 +313,16 @@ void Application::DeInit()
sal_uInt16 Application::GetCommandLineParamCount()
{
- vos::OStartupInfo aStartInfo;
- return (sal_uInt16)aStartInfo.getCommandArgCount();
+ return (sal_uInt16)osl_getCommandArgCount();
}
// -----------------------------------------------------------------------
XubString Application::GetCommandLineParam( sal_uInt16 nParam )
{
- vos::OStartupInfo aStartInfo;
- rtl::OUString aParam;
- aStartInfo.getCommandArg( nParam, aParam );
- return XubString( aParam );
+ rtl::OUString aParam;
+ osl_getCommandArg( nParam, &aParam.pData );
+ return aParam;
}
// -----------------------------------------------------------------------
@@ -351,10 +341,8 @@ const XubString& Application::GetAppFileName()
static String aAppFileName;
if( !aAppFileName.Len() )
{
- vos::OStartupInfo aStartInfo;
- ::rtl::OUString aExeFileName;
-
- aStartInfo.getExecutableFile( aExeFileName );
+ rtl::OUString aExeFileName;
+ osl_getExecutableFile( &aExeFileName.pData );
// convert path to native file format
rtl::OUString aNativeFileName;
@@ -521,7 +509,7 @@ void Application::Quit()
// -----------------------------------------------------------------------
-vos::IMutex& Application::GetSolarMutex()
+osl::SolarMutex& Application::GetSolarMutex()
{
ImplSVData* pSVData = ImplGetSVData();
return *(pSVData->mpDefInst->GetYieldMutex());
@@ -529,7 +517,7 @@ vos::IMutex& Application::GetSolarMutex()
// -----------------------------------------------------------------------
-vos::OThread::TThreadIdentifier Application::GetMainThreadIdentifier()
+oslThreadIdentifier Application::GetMainThreadIdentifier()
{
return ImplGetSVData()->mnMainThreadId;
}
@@ -844,8 +832,7 @@ void Application::ImplCallEventListeners( sal_uLong nEvent, Window *pWin, void*
VclWindowEvent aEvent( pWin, nEvent, pData );
if ( pSVData->maAppData.mpEventListeners )
- if ( !pSVData->maAppData.mpEventListeners->empty() )
- pSVData->maAppData.mpEventListeners->Call( &aEvent );
+ pSVData->maAppData.mpEventListeners->Call( &aEvent );
}
// -----------------------------------------------------------------------
@@ -855,8 +842,7 @@ void Application::ImplCallEventListeners( VclSimpleEvent* pEvent )
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->maAppData.mpEventListeners )
- if ( !pSVData->maAppData.mpEventListeners->empty() )
- pSVData->maAppData.mpEventListeners->Call( pEvent );
+ pSVData->maAppData.mpEventListeners->Call( pEvent );
}
// -----------------------------------------------------------------------
@@ -866,7 +852,7 @@ void Application::AddEventListener( const Link& rEventListener )
ImplSVData* pSVData = ImplGetSVData();
if( !pSVData->maAppData.mpEventListeners )
pSVData->maAppData.mpEventListeners = new VclEventListeners;
- pSVData->maAppData.mpEventListeners->push_back( rEventListener );
+ pSVData->maAppData.mpEventListeners->addListener( rEventListener );
}
// -----------------------------------------------------------------------
@@ -875,7 +861,7 @@ void Application::RemoveEventListener( const Link& rEventListener )
{
ImplSVData* pSVData = ImplGetSVData();
if( pSVData->maAppData.mpEventListeners )
- pSVData->maAppData.mpEventListeners->remove( rEventListener );
+ pSVData->maAppData.mpEventListeners->removeListener( rEventListener );
}
// -----------------------------------------------------------------------
@@ -884,7 +870,7 @@ void Application::AddKeyListener( const Link& rKeyListener )
ImplSVData* pSVData = ImplGetSVData();
if( !pSVData->maAppData.mpKeyListeners )
pSVData->maAppData.mpKeyListeners = new VclEventListeners;
- pSVData->maAppData.mpKeyListeners->push_back( rKeyListener );
+ pSVData->maAppData.mpKeyListeners->addListener( rKeyListener );
}
// -----------------------------------------------------------------------
@@ -893,7 +879,7 @@ void Application::RemoveKeyListener( const Link& rKeyListener )
{
ImplSVData* pSVData = ImplGetSVData();
if( pSVData->maAppData.mpKeyListeners )
- pSVData->maAppData.mpKeyListeners->remove( rKeyListener );
+ pSVData->maAppData.mpKeyListeners->removeListener( rKeyListener );
}
// -----------------------------------------------------------------------
@@ -907,8 +893,7 @@ sal_Bool Application::HandleKey( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyE
sal_Bool bProcessed = sal_False;
if ( pSVData->maAppData.mpKeyListeners )
- if ( !pSVData->maAppData.mpKeyListeners->empty() )
- bProcessed = pSVData->maAppData.mpKeyListeners->Process( &aEvent );
+ bProcessed = pSVData->maAppData.mpKeyListeners->Process( &aEvent );
return bProcessed;
}
@@ -917,7 +902,7 @@ sal_Bool Application::HandleKey( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyE
sal_uLong Application::PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* pKeyEvent )
{
- const ::vos::OGuard aGuard( GetSolarMutex() );
+ const SolarMutexGuard aGuard;
sal_uLong nEventId = 0;
if( pWin && pKeyEvent )
@@ -944,7 +929,7 @@ sal_uLong Application::PostKeyEvent( sal_uLong nEvent, Window *pWin, KeyEvent* p
sal_uLong Application::PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEvent* pMouseEvent )
{
- const ::vos::OGuard aGuard( GetSolarMutex() );
+ const SolarMutexGuard aGuard;
sal_uLong nEventId = 0;
if( pWin && pMouseEvent )
@@ -979,7 +964,7 @@ sal_uLong Application::PostMouseEvent( sal_uLong nEvent, Window *pWin, MouseEven
IMPL_STATIC_LINK_NOINSTANCE( Application, PostEventHandler, void*, pCallData )
{
- const ::vos::OGuard aGuard( GetSolarMutex() );
+ const SolarMutexGuard aGuard;
ImplPostEventData* pData = static_cast< ImplPostEventData * >( pCallData );
const void* pEventData;
sal_uLong nEvent;
@@ -1042,7 +1027,7 @@ IMPL_STATIC_LINK_NOINSTANCE( Application, PostEventHandler, void*, pCallData )
void Application::RemoveMouseAndKeyEvents( Window* pWin )
{
- const ::vos::OGuard aGuard( GetSolarMutex() );
+ const SolarMutexGuard aGuard;
// remove all events for specific window, watch for destruction of internal data
::std::list< ImplPostEventPair >::iterator aIter( aPostedEventList.begin() );
@@ -1066,7 +1051,7 @@ void Application::RemoveMouseAndKeyEvents( Window* pWin )
sal_Bool Application::IsProcessedMouseOrKeyEvent( sal_uLong nEventId )
{
- const ::vos::OGuard aGuard( GetSolarMutex() );
+ const SolarMutexGuard aGuard;
// find event
::std::list< ImplPostEventPair >::iterator aIter( aPostedEventList.begin() );
@@ -1595,7 +1580,7 @@ Window* Application::GetDefDialogParent()
// check for corrupted window hierarchy, #122232#, may be we now crash somewhere else
if( !pWin->mpWindowImpl )
{
- DBG_ERROR( "Window hierarchy corrupted!" );
+ OSL_FAIL( "Window hierarchy corrupted!" );
pSVData->maWinData.mpFocusWin = NULL; // avoid further access
return NULL;
}
@@ -2085,3 +2070,5 @@ void Application::SetPropertyHandler( PropertyHandler* p )
void Application::AppEvent( const ApplicationEvent& /*rAppEvent*/ )
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index b749fa78ea59..ee46f14acae0 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,11 +31,11 @@
#include <string.h>
-#include "rtl/instance.hxx"
-#include "osl/process.h"
-#include "osl/file.hxx"
+#include <boost/ptr_container/ptr_vector.hpp>
-#include "svsys.h"
+#include <osl/file.hxx>
+#include <osl/mutex.hxx>
+#include <rtl/process.h>
#include "tools/debug.hxx"
#include "tools/resary.hxx"
@@ -57,8 +58,6 @@
#include "unotools/fontcfg.hxx"
-#include "vos/mutex.hxx"
-
#include "cppuhelper/implbase1.hxx"
#include "uno/current_context.hxx"
@@ -81,7 +80,7 @@ namespace css = com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::awt;
-using namespace rtl;
+using ::rtl::OUString;
// =======================================================================
@@ -130,7 +129,7 @@ void ImplInitSVData()
{
rtl::OUString aArg;
osl_getCommandArg( i, &aArg.pData );
- if( aArg.equalsAscii( "-enableautomation" ) )
+ if( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-enableautomation" ) ) )
{
pImplSVData->mbIsTestTool = true;
break;
@@ -331,7 +330,7 @@ com::sun::star::uno::Any AccessBridgeCurrentContext::getValueByName( const rtl::
throw (com::sun::star::uno::RuntimeException)
{
com::sun::star::uno::Any ret;
- if( Name.equalsAscii( "java-vm.interaction-handler" ) )
+ if( Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "java-vm.interaction-handler" ) ) )
{
// Currently, for accessbility no interaction handler shall be offered.
// There may be introduced later on a handler using native toolkits
@@ -392,14 +391,14 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
new AccessBridgeCurrentContext( com::sun::star::uno::getCurrentContext() ) );
pSVData->mxAccessBridge = xFactory->createInstanceWithArguments(
- OUString::createFromAscii( "com.sun.star.accessibility.AccessBridge" ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.accessibility.AccessBridge")),
arguments
);
}
else
{
pSVData->mxAccessBridge = xFactory->createInstanceWithArguments(
- OUString::createFromAscii( "com.sun.star.accessibility.AccessBridge" ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.accessibility.AccessBridge")),
arguments
);
}
@@ -521,11 +520,11 @@ bool ImplInitAccessBridge(sal_Bool bAllowCancel, sal_Bool &rCancelled)
String aTitle;
String aMessage(ResId(SV_ACCESSERROR_BRIDGE_MSG, *pResMgr));
- if( 0 == e.Message.compareTo(::rtl::OUString::createFromAscii("ClassNotFound"), 13) )
+ if( 0 == e.Message.compareTo(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ClassNotFound")), 13) )
{
aTitle = String(ResId(SV_ACCESSERROR_MISSING_BRIDGE, *pResMgr));
}
- else if( 0 == e.Message.compareTo(::rtl::OUString::createFromAscii("NoSuchMethod"), 12) )
+ else if( 0 == e.Message.compareTo(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("NoSuchMethod")), 12) )
{
aTitle = String(ResId(SV_ACCESSERROR_WRONG_VERSION, *pResMgr));
}
@@ -599,3 +598,4 @@ void LocaleConfigurationListener::ConfigurationChanged( utl::ConfigurationBroadc
AllSettings::LocaleSettingsChanged( nHint );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index c075e1b108f3..cc1ccc45facf 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,10 +30,10 @@
#include "precompiled_vcl.hxx"
#ifdef WNT
-#include <tools/prewin.h>
+#include <prewin.h>
#include <process.h> // for _beginthreadex
#include <ole2.h> // for _beginthreadex
-#include <tools/postwin.h>
+#include <postwin.h>
#endif
// [ed 5/14/02 Add in explicit check for quartz graphics. OS X will define
@@ -46,7 +47,7 @@
#include "svsys.h"
#include "vcl/salinst.hxx"
#include "vcl/salwtype.hxx"
-#include "vos/signal.hxx"
+#include "osl/signal.h"
#include "tools/tools.h"
#include "tools/debug.hxx"
#include "tools/unqid.hxx"
@@ -70,8 +71,8 @@
#include "vcl/impimagetree.hxx"
#include "vcl/xconnection.hxx"
-#include "vos/process.hxx"
#include "osl/file.hxx"
+#include "osl/process.h"
#include "comphelper/processfactory.hxx"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/lang/XComponent.hpp"
@@ -89,31 +90,14 @@
#include "rtl/strbuf.hxx"
#endif
-namespace {
-
-namespace css = com::sun::star;
-
-}
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-
-
+using ::rtl::OUString;
+using namespace ::com::sun::star;
// =======================================================================
-class ImplVCLExceptionHandler : public ::vos::OSignalHandler
-{
-public:
- virtual ::vos::OSignalHandler::TSignalAction SAL_CALL signal( ::vos::OSignalHandler::TSignalInfo* pInfo );
-};
-
-// -----------------------------------------------------------------------
-
-::vos::OSignalHandler::TSignalAction SAL_CALL ImplVCLExceptionHandler::signal( ::vos::OSignalHandler::TSignalInfo* pInfo )
+oslSignalAction SAL_CALL VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo* pInfo)
{
- static sal_Bool bIn = sal_False;
+ static bool bIn = false;
// Wenn wir nocheinmal abstuerzen, verabschieden wir uns gleich
if ( !bIn )
@@ -144,9 +128,9 @@ public:
if ( nVCLException )
{
- bIn = sal_True;
+ bIn = true;
- ::vos::OGuard aLock(&Application::GetSolarMutex());
+ SolarMutexGuard aLock;
// Timer nicht mehr anhalten, da ansonsten die UAE-Box
// auch nicht mehr gepaintet wird
@@ -158,17 +142,18 @@ public:
pSVData->mpApp->Exception( nVCLException );
Application::SetSystemWindowMode( nOldMode );
}
- bIn = sal_False;
+ bIn = false;
- return vos::OSignalHandler::TAction_CallNextHandler;
+ return osl_Signal_ActCallNextHdl;
}
}
- return vos::OSignalHandler::TAction_CallNextHandler;
+ return osl_Signal_ActCallNextHdl;
+
}
// =======================================================================
-sal_Bool ImplSVMain()
+int ImplSVMain()
{
// The 'real' SVMain()
RTL_LOGFILE_CONTEXT( aLog, "vcl (ss112471) ::SVMain" );
@@ -177,8 +162,9 @@ sal_Bool ImplSVMain()
DBG_ASSERT( pSVData->mpApp, "no instance of class Application" );
- css::uno::Reference<XMultiServiceFactory> xMS;
+ uno::Reference<lang::XMultiServiceFactory> xMS;
+ int nReturn = EXIT_FAILURE;
sal_Bool bInit = InitVCL( xMS );
@@ -186,7 +172,7 @@ sal_Bool ImplSVMain()
{
// Application-Main rufen
pSVData->maAppData.mbInAppMain = sal_True;
- pSVData->mpApp->Main();
+ nReturn = pSVData->mpApp->Main();
pSVData->maAppData.mbInAppMain = sal_False;
}
@@ -201,7 +187,7 @@ sal_Bool ImplSVMain()
// be some events in the AWT EventQueue, which need the SolarMutex which
// - on the other hand - is destroyed in DeInitVCL(). So empty the queue
// here ..
- css::uno::Reference< XComponent > xComponent(pSVData->mxAccessBridge, UNO_QUERY);
+ uno::Reference< lang::XComponent > xComponent(pSVData->mxAccessBridge, uno::UNO_QUERY);
if( xComponent.is() )
{
sal_uLong nCount = Application::ReleaseSolarMutex();
@@ -211,17 +197,17 @@ sal_Bool ImplSVMain()
}
DeInitVCL();
- return bInit;
+ return nReturn;
}
-sal_Bool SVMain()
+int SVMain()
{
// #i47888# allow for alternative initialization as required for e.g. MacOSX
- extern sal_Bool ImplSVMainHook( sal_Bool* );
+ extern sal_Bool ImplSVMainHook( int* );
- sal_Bool bInit;
- if( ImplSVMainHook( &bInit ) )
- return bInit;
+ int nRet;
+ if( ImplSVMainHook( &nRet ) )
+ return nRet;
else
return ImplSVMain();
}
@@ -229,12 +215,12 @@ sal_Bool SVMain()
// before SVInit is called
static Application * pOwnSvApp = NULL;
// Exception handler. pExceptionHandler != NULL => VCL already inited
-ImplVCLExceptionHandler * pExceptionHandler = NULL;
+oslSignalHandler pExceptionHandler = NULL;
class Application_Impl : public Application
{
public:
- void Main(){};
+ int Main() { return EXIT_SUCCESS; };
};
class DesktopEnvironmentContext: public cppu::WeakImplHelper1< com::sun::star::uno::XCurrentContext >
@@ -251,13 +237,13 @@ private:
com::sun::star::uno::Reference< com::sun::star::uno::XCurrentContext > m_xNextContext;
};
-Any SAL_CALL DesktopEnvironmentContext::getValueByName( const rtl::OUString& Name) throw (RuntimeException)
+uno::Any SAL_CALL DesktopEnvironmentContext::getValueByName( const rtl::OUString& Name) throw (uno::RuntimeException)
{
- Any retVal;
+ uno::Any retVal;
- if ( 0 == Name.compareToAscii( "system.desktop-environment" ) )
+ if (Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("system.desktop-environment")))
{
- retVal = makeAny( Application::GetDesktopEnvironment() );
+ retVal = uno::makeAny( Application::GetDesktopEnvironment() );
}
else if( m_xNextContext.is() )
{
@@ -295,11 +281,7 @@ sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang
pSVData->maAppData.mxMSF = rSMgr;
// Main-Thread-Id merken
- pSVData->mnMainThreadId = ::vos::OThread::getCurrentIdentifier();
-
- vos::OStartupInfo aStartInfo;
- rtl::OUString aExeFileName;
-
+ pSVData->mnMainThreadId = ::osl::Thread::getCurrentIdentifier();
// Sal initialisieren
RTL_LOGFILE_CONTEXT_TRACE( aLog, "{ ::CreateSalInstance" );
@@ -320,7 +302,8 @@ sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang
// Den AppFileName gleich holen und absolut machen, bevor das
// WorkingDirectory sich aendert...
- aStartInfo.getExecutableFile( aExeFileName );
+ rtl::OUString aExeFileName;
+ osl_getExecutableFile( &aExeFileName.pData );
// convert path to native file format
rtl::OUString aNativeFileName;
@@ -333,7 +316,7 @@ sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang
pSVData->maGDIData.mpGrfConverter = new GraphicConverter;
// Exception-Handler setzen
- pExceptionHandler = new ImplVCLExceptionHandler();
+ pExceptionHandler = osl_addSignalHandler(VCLExceptionSignal_impl, NULL);
// Debug-Daten initialisieren
DBGGUI_INIT();
@@ -341,6 +324,33 @@ sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang
return sal_True;
}
+namespace
+{
+
+/** Serves for destroying the VCL UNO wrapper as late as possible. This avoids
+ crash at exit in some special cases when a11y is enabled (e.g., when
+ a bundled extension is registered/deregistered during startup, forcing exit
+ while the app is still in splash screen.)
+ */
+class VCLUnoWrapperDeleter : public cppu::WeakImplHelper1<com::sun::star::lang::XEventListener>
+{
+ virtual void SAL_CALL disposing(lang::EventObject const& rSource) throw(uno::RuntimeException);
+};
+
+void
+VCLUnoWrapperDeleter::disposing(lang::EventObject const& /* rSource */)
+ throw(uno::RuntimeException)
+{
+ ImplSVData* const pSVData = ImplGetSVData();
+ if (pSVData && pSVData->mpUnoWrapper)
+ {
+ pSVData->mpUnoWrapper->Destroy();
+ pSVData->mpUnoWrapper = NULL;
+ }
+}
+
+}
+
void DeInitVCL()
{
ImplSVData* pSVData = ImplGetSVData();
@@ -378,7 +388,7 @@ void DeInitVCL()
ImplImageTreeSingletonRef()->shutDown();
- delete pExceptionHandler;
+ osl_removeSignalHandler( pExceptionHandler);
pExceptionHandler = NULL;
// Debug Daten zuruecksetzen
@@ -403,11 +413,6 @@ void DeInitVCL()
delete pSVData->maWinData.mpMsgBoxImgList;
pSVData->maWinData.mpMsgBoxImgList = NULL;
}
- if ( pSVData->maWinData.mpMsgBoxHCImgList )
- {
- delete pSVData->maWinData.mpMsgBoxHCImgList;
- pSVData->maWinData.mpMsgBoxHCImgList = NULL;
- }
if ( pSVData->maCtrlData.mpCheckImgList )
{
delete pSVData->maCtrlData.mpCheckImgList;
@@ -448,32 +453,32 @@ void DeInitVCL()
delete pSVData->maCtrlData.mpDisclosurePlus;
pSVData->maCtrlData.mpDisclosurePlus = NULL;
}
- if ( pSVData->maCtrlData.mpDisclosurePlusHC )
- {
- delete pSVData->maCtrlData.mpDisclosurePlusHC;
- pSVData->maCtrlData.mpDisclosurePlusHC = NULL;
- }
if ( pSVData->maCtrlData.mpDisclosureMinus )
{
delete pSVData->maCtrlData.mpDisclosureMinus;
pSVData->maCtrlData.mpDisclosureMinus = NULL;
}
- if ( pSVData->maCtrlData.mpDisclosureMinusHC )
- {
- delete pSVData->maCtrlData.mpDisclosureMinusHC;
- pSVData->maCtrlData.mpDisclosureMinusHC = NULL;
- }
if ( pSVData->mpDefaultWin )
{
delete pSVData->mpDefaultWin;
pSVData->mpDefaultWin = NULL;
}
- // #114285# Moved here from ImplDeInitSVData...
if ( pSVData->mpUnoWrapper )
{
- pSVData->mpUnoWrapper->Destroy();
- pSVData->mpUnoWrapper = NULL;
+ try
+ {
+ uno::Reference<lang::XComponent> const xDesktop(
+ comphelper::createProcessComponent(
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))),
+ uno::UNO_QUERY_THROW)
+ ;
+ xDesktop->addEventListener(new VCLUnoWrapperDeleter());
+ }
+ catch (uno::Exception const&)
+ {
+ // ignore
+ }
}
pSVData->maAppData.mxMSF.clear();
@@ -638,3 +643,5 @@ void JoinMainLoopThread()
#endif
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/svmainhook.cxx b/vcl/source/app/svmainhook.cxx
index 789af7efbe2b..dd446125a7aa 100644
--- a/vcl/source/app/svmainhook.cxx
+++ b/vcl/source/app/svmainhook.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,7 @@
#ifndef MACOSX
-sal_Bool ImplSVMainHook( sal_Bool * )
+sal_Bool ImplSVMainHook( int * )
{
return sal_False; // indicate that ImplSVMainHook is not implemented
}
@@ -56,7 +57,7 @@ static void SourceContextCallBack( void *pInfo )
struct ThreadContext
{
- sal_Bool* pRet;
+ int* pRet;
CFRunLoopRef* pRunLoopRef;
};
@@ -75,7 +76,7 @@ static void RunSVMain(void *pData)
_exit( 0 );
}
-sal_Bool ImplSVMainHook( sal_Bool *pbInit )
+sal_Bool ImplSVMainHook( int *pnInit )
{
// Mac OS X requires that any Cocoa code have a CFRunLoop started in the
// primordial thread. Since all of the AWT classes in Java 1.4 and higher
@@ -86,7 +87,7 @@ sal_Bool ImplSVMainHook( sal_Bool *pbInit )
CFRunLoopRef runLoopRef = CFRunLoopGetCurrent();
ThreadContext tcx;
- tcx.pRet = pbInit; // the return value
+ tcx.pRet = pnInit; // the return value
tcx.pRunLoopRef = &runLoopRef;
oslThread hThreadID = osl_createThread(RunSVMain, &tcx);
@@ -114,3 +115,5 @@ sal_Bool ImplSVMainHook( sal_Bool *pbInit )
#endif // MACOSX
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/timer.cxx b/vcl/source/app/timer.cxx
index f31779f759c6..6c2d08b18659 100644
--- a/vcl/source/app/timer.cxx
+++ b/vcl/source/app/timer.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/saltimer.hxx>
#include <tools/time.hxx>
#include <vcl/svdata.hxx>
@@ -320,7 +319,7 @@ void Timer::Start()
}
else if( !mpTimerData->mpSVTimer ) // TODO: remove when guilty found
{
- DBG_ERROR( "Timer::Start() on a destroyed Timer!" );
+ OSL_FAIL( "Timer::Start() on a destroyed Timer!" );
}
else
{
@@ -378,3 +377,5 @@ AutoTimer& AutoTimer::operator=( const AutoTimer& rTimer )
Timer::operator=( rTimer );
return *this;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/unohelp.cxx b/vcl/source/app/unohelp.cxx
index 711f9fb06ae1..00fbaaeef3c4 100644
--- a/vcl/source/app/unohelp.cxx
+++ b/vcl/source/app/unohelp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,14 +36,9 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/processfactory.hxx>
-#ifndef _COM_SUN_STAR_TEXT_XBREAKITERATOR_HPP_
#include <com/sun/star/i18n/XBreakIterator.hpp>
-#endif
#include <com/sun/star/i18n/XCharacterClassification.hpp>
-#ifndef _COM_SUN_STAR_UTIL_XCOLLATOR_HPP_
-#include <com/sun/star/i18n/XCollator.hpp>
-#endif
#include <com/sun/star/awt/XExtendedToolkit.hpp>
#include <com/sun/star/accessibility/AccessibleEventObject.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
@@ -109,7 +105,7 @@ uno::Reference< lang::XMultiServiceFactory > vcl::unohelper::GetMultiServiceFact
{
pSVData->maAppData.mxMSF = ::cppu::createRegistryServiceFactory( aTempFileName, rtl::OUString(), sal_False );
uno::Reference < registry::XImplementationRegistration > xReg(
- pSVData->maAppData.mxMSF->createInstance( OUString::createFromAscii( "com.sun.star.registry.ImplementationRegistration" )), uno::UNO_QUERY );
+ pSVData->maAppData.mxMSF->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.ImplementationRegistration"))), uno::UNO_QUERY );
if( xReg.is() )
{
@@ -122,7 +118,7 @@ uno::Reference< lang::XMultiServiceFactory > vcl::unohelper::GetMultiServiceFact
try
{
xReg->registerImplementation(
- OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ),aComponentPathString, NULL );
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")),aComponentPathString, NULL );
}
catch( ::com::sun::star::uno::Exception & )
{
@@ -148,7 +144,7 @@ uno::Reference < i18n::XBreakIterator > vcl::unohelper::CreateBreakIterator()
uno::Reference< lang::XMultiServiceFactory > xMSF = GetMultiServiceFactory();
if ( xMSF.is() )
{
- uno::Reference < uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.i18n.BreakIterator" ) );
+ uno::Reference < uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) );
if ( xI.is() )
{
uno::Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XBreakIterator >*)0) );
@@ -164,7 +160,7 @@ uno::Reference < i18n::XCharacterClassification > vcl::unohelper::CreateCharacte
uno::Reference< lang::XMultiServiceFactory > xMSF = GetMultiServiceFactory();
if ( xMSF.is() )
{
- uno::Reference < uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.i18n.CharacterClassification" ) );
+ uno::Reference < uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.CharacterClassification")) );
if ( xI.is() )
{
uno::Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XCharacterClassification >*)0) );
@@ -174,22 +170,6 @@ uno::Reference < i18n::XCharacterClassification > vcl::unohelper::CreateCharacte
return xB;
}
-uno::Reference < i18n::XCollator > vcl::unohelper::CreateCollator()
-{
- uno::Reference < i18n::XCollator > xB;
- uno::Reference< lang::XMultiServiceFactory > xMSF = GetMultiServiceFactory();
- if ( xMSF.is() )
- {
- uno::Reference < uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.i18n.Collator" ) );
- if ( xI.is() )
- {
- uno::Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XCollator >*)0) );
- x >>= xB;
- }
- }
- return xB;
-}
-
::rtl::OUString vcl::unohelper::CreateLibraryName( const sal_Char* pModName, sal_Bool bSUPD )
{
// create variable library name suffixes
@@ -240,3 +220,5 @@ void vcl::unohelper::NotifyAccessibleStateEventGlobally( const ::com::sun::star:
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/unohelp2.cxx b/vcl/source/app/unohelp2.cxx
index 514d95032d6f..1fe4158433a0 100644
--- a/vcl/source/app/unohelp2.cxx
+++ b/vcl/source/app/unohelp2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -110,3 +111,5 @@ namespace vcl { namespace unohelper {
}
}} // namespace vcl::unohelper
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx
index 1ae5f7537ca6..f7614c99046b 100644
--- a/vcl/source/app/vclevent.cxx
+++ b/vcl/source/app/vclevent.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,8 +58,11 @@ Reference<XAccessible> VclAccessibleEvent::GetAccessible() const
void VclEventListeners::Call( VclSimpleEvent* pEvent ) const
{
+ if ( m_aListeners.empty() )
+ return;
+
// Copy the list, because this can be destroyed when calling a Link...
- std::list<Link> aCopy( *this );
+ std::list<Link> aCopy( m_aListeners );
std::list<Link>::iterator aIter( aCopy.begin() );
if( pEvent->IsA( VclWindowEvent::StaticType() ) )
{
@@ -82,9 +86,12 @@ void VclEventListeners::Call( VclSimpleEvent* pEvent ) const
sal_Bool VclEventListeners::Process( VclSimpleEvent* pEvent ) const
{
+ if ( m_aListeners.empty() )
+ return sal_False;
+
sal_Bool bProcessed = sal_False;
// Copy the list, because this can be destroyed when calling a Link...
- std::list<Link> aCopy( *this );
+ std::list<Link> aCopy( m_aListeners );
std::list<Link>::iterator aIter( aCopy.begin() );
while ( aIter != aCopy.end() )
{
@@ -98,6 +105,16 @@ sal_Bool VclEventListeners::Process( VclSimpleEvent* pEvent ) const
return bProcessed;
}
+void VclEventListeners::addListener( const Link& rListener )
+{
+ m_aListeners.push_back( rListener );
+}
+
+void VclEventListeners::removeListener( const Link& rListener )
+{
+ m_aListeners.remove( rListener );
+}
+
VclEventListeners2::VclEventListeners2()
{
}
@@ -149,3 +166,4 @@ void VclEventListeners2::callListeners( VclSimpleEvent* i_pEvent )
m_aIterators.pop_back();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/components/display.cxx b/vcl/source/components/display.cxx
index 6d7653968229..39f2613ac6b5 100644
--- a/vcl/source/components/display.cxx
+++ b/vcl/source/components/display.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -343,3 +344,5 @@ Sequence< OUString > SAL_CALL DisplayAccess::getSupportedServiceNames( ) throw
}
} // namespace vcl
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/components/dtranscomp.cxx b/vcl/source/components/dtranscomp.cxx
index 9c88deccec23..cd1fbec0502b 100644
--- a/vcl/source/components/dtranscomp.cxx
+++ b/vcl/source/components/dtranscomp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,7 +45,7 @@
#include "vcl/svapp.hxx"
#include "vcl/svdata.hxx"
#include "vcl/salinst.hxx"
-#include "vos/mutex.hxx"
+#include "osl/mutex.hxx"
#include "osl/mutex.hxx"
#include "cppuhelper/compbase1.hxx"
@@ -144,7 +145,7 @@ rtl::OUString GenericClipboard::getImplementationName_static()
Sequence< rtl::OUString > GenericClipboard::getSupportedServiceNames_static()
{
Sequence< OUString > aRet(1);
- aRet[0] = OUString::createFromAscii("com.sun.star.datatransfer.clipboard.SystemClipboard");
+ aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard"));
return aRet;
}
@@ -271,7 +272,7 @@ Reference< XInterface > ClipboardFactory::createInstance() throw()
Reference< XInterface > ClipboardFactory::createInstanceWithArguments( const Sequence< Any >& arguments ) throw()
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
Reference< XInterface > xResult = ImplGetSVData()->mpDefInst->CreateClipboard( arguments );
return xResult;
}
@@ -281,7 +282,7 @@ Reference< XInterface > ClipboardFactory::createInstanceWithArguments( const Seq
Sequence< OUString > SAL_CALL Clipboard_getSupportedServiceNames()
{
Sequence< OUString > aRet(1);
- aRet[0] = OUString::createFromAscii("com.sun.star.datatransfer.clipboard.SystemClipboard");
+ aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard"));
return aRet;
}
@@ -334,13 +335,13 @@ public:
static Sequence< OUString > getSupportedServiceNames_static()
{
Sequence< OUString > aRet( 1 );
- aRet[0] = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.GenericDragSource" );
+ aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.GenericDragSource"));
return aRet;
}
static OUString getImplementationName_static()
{
- return OUString::createFromAscii( "com.sun.star.datatransfer.dnd.VclGenericDragSource" );
+ return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.VclGenericDragSource"));
}
};
@@ -409,7 +410,7 @@ OUString SAL_CALL DragSource_getImplementationName()
Reference< XInterface > SAL_CALL DragSource_createInstance( const Reference< XMultiServiceFactory >& )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
Reference< XInterface > xResult = ImplGetSVData()->mpDefInst->CreateDragSource();
return xResult;
}
@@ -446,13 +447,13 @@ public:
static Sequence< OUString > getSupportedServiceNames_static()
{
Sequence< OUString > aRet( 1 );
- aRet[0] = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.GenericDropTarget" );
+ aRet[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.GenericDropTarget"));
return aRet;
}
static OUString getImplementationName_static()
{
- return OUString::createFromAscii( "com.sun.star.datatransfer.dnd.VclGenericDropTarget" );
+ return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.VclGenericDropTarget"));
}
};
@@ -524,7 +525,7 @@ OUString SAL_CALL DropTarget_getImplementationName()
Reference< XInterface > SAL_CALL DropTarget_createInstance( const Reference< XMultiServiceFactory >& )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
Reference< XInterface > xResult = ImplGetSVData()->mpDefInst->CreateDropTarget();
return xResult;
}
@@ -550,3 +551,4 @@ Reference< XInterface > SalInstance::CreateDropTarget()
return Reference< XInterface >( ( cppu::OWeakObject * )new vcl::GenericDropTarget() );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/components/factory.cxx b/vcl/source/components/factory.cxx
index 7cfdecbfdb00..9325c047b5d7 100644
--- a/vcl/source/components/factory.cxx
+++ b/vcl/source/components/factory.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,12 +29,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
#include <tools/debug.hxx>
-#ifndef _OSL_MUTEX_HXX
#include <osl/mutex.hxx>
-#endif
-#ifndef _RTL_USTRBUF_HXX
#include <rtl/ustrbuf.hxx>
-#endif
#include <uno/dispatcher.h> // declaration of generic uno interface
#include <uno/mapping.hxx> // mapping stuff
#include <cppuhelper/factory.hxx>
@@ -152,3 +149,5 @@ extern "C" {
}
} /* extern "C" */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/components/fontident.cxx b/vcl/source/components/fontident.cxx
index ad309e4f2560..e411dcf49aba 100644
--- a/vcl/source/components/fontident.cxx
+++ b/vcl/source/components/fontident.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -209,3 +210,5 @@ Sequence< OUString > SAL_CALL FontIdentificator::getSupportedServiceNames() thro
}
} // namespace vcl
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 5ffe94212d20..7efaf732da34 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,13 +31,9 @@
#include <tools/debug.hxx>
-#ifndef _SV_SVIDS_HRC
#include <vcl/svids.hrc>
-#endif
#include <vcl/svdata.hxx>
-#ifndef _SV_IAMGE_HXX
#include <vcl/image.hxx>
-#endif
#include <vcl/bitmap.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/decoview.hxx>
@@ -48,14 +45,10 @@
#include <vcl/button.hxx>
#include <vcl/window.h>
#include <vcl/controldata.hxx>
-#ifndef _SV_NATIVEWIDGET_HXX
#include <vcl/salnativewidgets.hxx>
-#endif
#include <vcl/edit.hxx>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
@@ -88,9 +81,7 @@ public:
sal_Bool mbSmallSymbol;
Image maImage;
- Image maImageHC;
BitmapEx* mpBitmapEx;
- BitmapEx* mpBitmapExHC;
ImageAlign meImageAlign;
SymbolAlign meSymbolAlign;
@@ -106,7 +97,6 @@ ImplCommonButtonData::ImplCommonButtonData()
mbSmallSymbol = sal_False;
mpBitmapEx = NULL;
- mpBitmapExHC = NULL;
meImageAlign = IMAGEALIGN_TOP;
meSymbolAlign = SYMBOLALIGN_LEFT;
}
@@ -115,7 +105,6 @@ ImplCommonButtonData::ImplCommonButtonData()
ImplCommonButtonData::~ImplCommonButtonData()
{
delete mpBitmapEx;
- delete mpBitmapExHC;
}
// =======================================================================
@@ -210,51 +199,24 @@ XubString Button::GetStandardHelpText( StandardButtonType /* eButton */ )
return aHelpText;
}
// -----------------------------------------------------------------------
-sal_Bool Button::SetModeImage( const Image& rImage, BmpColorMode eMode )
+sal_Bool Button::SetModeImage( const Image& rImage )
{
- if( eMode == BMP_COLOR_NORMAL )
+ if ( rImage != mpButtonData->maImage )
{
- if ( rImage != mpButtonData->maImage )
- {
- delete mpButtonData->mpBitmapEx;
-
- mpButtonData->mpBitmapEx = NULL;
- mpButtonData->maImage = rImage;
-
- StateChanged( STATE_CHANGE_DATA );
- }
- }
- else if( eMode == BMP_COLOR_HIGHCONTRAST )
- {
- if( rImage != mpButtonData->maImageHC )
- {
- delete mpButtonData->mpBitmapExHC;
+ delete mpButtonData->mpBitmapEx;
- mpButtonData->mpBitmapExHC = NULL;
- mpButtonData->maImageHC = rImage;
+ mpButtonData->mpBitmapEx = NULL;
+ mpButtonData->maImage = rImage;
- StateChanged( STATE_CHANGE_DATA );
- }
+ StateChanged( STATE_CHANGE_DATA );
}
- else
- return sal_False;
-
return sal_True;
}
// -----------------------------------------------------------------------
-const Image Button::GetModeImage( BmpColorMode eMode ) const
+const Image Button::GetModeImage( ) const
{
- if( eMode == BMP_COLOR_NORMAL )
- {
- return mpButtonData->maImage;
- }
- else if( eMode == BMP_COLOR_HIGHCONTRAST )
- {
- return mpButtonData->maImageHC;
- }
- else
- return Image();
+ return mpButtonData->maImage;
}
// -----------------------------------------------------------------------
@@ -280,43 +242,24 @@ ImageAlign Button::GetImageAlign() const
}
// -----------------------------------------------------------------------
-sal_Bool Button::SetModeBitmap( const BitmapEx& rBitmap, BmpColorMode eMode )
+sal_Bool Button::SetModeBitmap( const BitmapEx& rBitmap )
{
- if ( SetModeImage( rBitmap, eMode ) )
+ if ( SetModeImage( rBitmap ) )
{
- if( eMode == BMP_COLOR_NORMAL )
- {
- if ( !mpButtonData->mpBitmapEx )
- mpButtonData->mpBitmapEx = new BitmapEx( rBitmap );
- }
- else if ( eMode == BMP_COLOR_HIGHCONTRAST )
- {
- if ( !mpButtonData->mpBitmapExHC )
- mpButtonData->mpBitmapExHC = new BitmapEx( rBitmap );
- }
- else
- return sal_False;
-
+ if ( !mpButtonData->mpBitmapEx )
+ mpButtonData->mpBitmapEx = new BitmapEx( rBitmap );
return sal_True;
}
return sal_False;
}
// -----------------------------------------------------------------------
-BitmapEx Button::GetModeBitmap( BmpColorMode eMode ) const
+BitmapEx Button::GetModeBitmap( ) const
{
BitmapEx aBmp;
- if ( eMode == BMP_COLOR_NORMAL )
- {
- if ( mpButtonData->mpBitmapEx )
- aBmp = *( mpButtonData->mpBitmapEx );
- }
- else if ( eMode == BMP_COLOR_HIGHCONTRAST )
- {
- if ( mpButtonData->mpBitmapExHC )
- aBmp = *( mpButtonData->mpBitmapExHC );
- }
+ if ( mpButtonData->mpBitmapEx )
+ aBmp = *( mpButtonData->mpBitmapEx );
return aBmp;
}
@@ -430,15 +373,6 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
Image *pImage = &(mpButtonData->maImage);
BitmapEx *pBitmapEx = mpButtonData->mpBitmapEx;
- if( !!(mpButtonData->maImageHC) )
- {
- if( GetSettings().GetStyleSettings().GetHighContrastMode() )
- {
- pImage = &(mpButtonData->maImageHC);
- pBitmapEx = mpButtonData->mpBitmapExHC;
- }
- }
-
if ( pBitmapEx && ( pDev->GetOutDevType() == OUTDEV_PRINTER ) )
{
// Die Groesse richtet sich nach dem Bildschirm, soll auf
@@ -490,21 +424,21 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
if ( bDrawText )
{
- if ( ( eImageAlign == IMAGEALIGN_LEFT_TOP ) ||
- ( eImageAlign == IMAGEALIGN_LEFT ) ||
- ( eImageAlign == IMAGEALIGN_LEFT_BOTTOM ) ||
- ( eImageAlign == IMAGEALIGN_RIGHT_TOP ) ||
- ( eImageAlign == IMAGEALIGN_RIGHT ) ||
- ( eImageAlign == IMAGEALIGN_RIGHT_BOTTOM ) )
+ if ( ( eImageAlign == IMAGEALIGN_LEFT_TOP ) ||
+ ( eImageAlign == IMAGEALIGN_LEFT ) ||
+ ( eImageAlign == IMAGEALIGN_LEFT_BOTTOM ) ||
+ ( eImageAlign == IMAGEALIGN_RIGHT_TOP ) ||
+ ( eImageAlign == IMAGEALIGN_RIGHT ) ||
+ ( eImageAlign == IMAGEALIGN_RIGHT_BOTTOM ) )
{
aRect.Right() -= ( aImageSize.Width() + nImageSep );
}
- else if ( ( eImageAlign == IMAGEALIGN_TOP_LEFT ) ||
- ( eImageAlign == IMAGEALIGN_TOP ) ||
- ( eImageAlign == IMAGEALIGN_TOP_RIGHT ) ||
- ( eImageAlign == IMAGEALIGN_BOTTOM_LEFT ) ||
- ( eImageAlign == IMAGEALIGN_BOTTOM ) ||
- ( eImageAlign == IMAGEALIGN_BOTTOM_RIGHT ) )
+ else if ( ( eImageAlign == IMAGEALIGN_TOP_LEFT ) ||
+ ( eImageAlign == IMAGEALIGN_TOP ) ||
+ ( eImageAlign == IMAGEALIGN_TOP_RIGHT ) ||
+ ( eImageAlign == IMAGEALIGN_BOTTOM_LEFT ) ||
+ ( eImageAlign == IMAGEALIGN_BOTTOM ) ||
+ ( eImageAlign == IMAGEALIGN_BOTTOM_RIGHT ) )
{
aRect.Bottom() -= ( aImageSize.Height() + nImageSep );
}
@@ -525,7 +459,7 @@ void Button::ImplDrawAlignedImage( OutputDevice* pDev, Point& rPos,
}
}
- aMax.Width() = aTSSize.Width() > aImageSize.Width() ? aTSSize.Width() : aImageSize.Width();
+ aMax.Width() = aTSSize.Width() > aImageSize.Width() ? aTSSize.Width() : aImageSize.Width();
aMax.Height() = aTSSize.Height() > aImageSize.Height() ? aTSSize.Height() : aImageSize.Height();
// Now calculate the output area for the image and the text acording to the image align flags
@@ -691,9 +625,9 @@ void Button::ImplSetFocusRect( const Rectangle &rFocusRect )
aFocusRect.Bottom()++;
}
- if ( aFocusRect.Left() < aOutputRect.Left() ) aFocusRect.Left() = aOutputRect.Left();
- if ( aFocusRect.Top() < aOutputRect.Top() ) aFocusRect.Top() = aOutputRect.Top();
- if ( aFocusRect.Right() > aOutputRect.Right() ) aFocusRect.Right() = aOutputRect.Right();
+ if ( aFocusRect.Left() < aOutputRect.Left() ) aFocusRect.Left() = aOutputRect.Left();
+ if ( aFocusRect.Top() < aOutputRect.Top() ) aFocusRect.Top() = aOutputRect.Top();
+ if ( aFocusRect.Right() > aOutputRect.Right() ) aFocusRect.Right() = aOutputRect.Right();
if ( aFocusRect.Bottom() > aOutputRect.Bottom() ) aFocusRect.Bottom() = aOutputRect.Bottom();
mpButtonData->maFocusRect = aFocusRect;
@@ -732,6 +666,7 @@ SymbolAlign Button::ImplGetSymbolAlign() const
{
return mpButtonData->meSymbolAlign;
}
+
// -----------------------------------------------------------------------
void Button::ImplSetSmallSymbol( sal_Bool bSmall )
{
@@ -821,10 +756,10 @@ WinBits PushButton::ImplInitStyle( const Window* pPrevWindow, WinBits nStyle )
if ( !(nStyle & WB_NOGROUP) &&
(!pPrevWindow ||
- ((pPrevWindow->GetType() != WINDOW_PUSHBUTTON) &&
- (pPrevWindow->GetType() != WINDOW_OKBUTTON) &&
+ ((pPrevWindow->GetType() != WINDOW_PUSHBUTTON ) &&
+ (pPrevWindow->GetType() != WINDOW_OKBUTTON ) &&
(pPrevWindow->GetType() != WINDOW_CANCELBUTTON) &&
- (pPrevWindow->GetType() != WINDOW_HELPBUTTON)) ) )
+ (pPrevWindow->GetType() != WINDOW_HELPBUTTON )) ) )
nStyle |= WB_GROUP;
return nStyle;
}
@@ -2157,9 +2092,6 @@ void RadioButton::ImplInitSettings( sal_Bool bFont,
}
}
-//---------------------------------------------------------------------
-//--- 12.03.2003 18:46:14 ---------------------------------------------
-
void RadioButton::DrawRadioButtonState( )
{
ImplDrawRadioButtonState( );
@@ -2183,7 +2115,6 @@ void RadioButton::ImplInvalidateOrDrawRadioButtonState()
void RadioButton::ImplDrawRadioButtonState()
{
- sal_uInt16 nButtonStyle = 0;
sal_Bool bNativeOK = sal_False;
// no native drawing for image radio buttons
@@ -2231,12 +2162,12 @@ if ( bNativeOK == sal_False )
Rectangle aImageRect = maStateRect;
Size aImageSize = maImage.GetSizePixel();
sal_Bool bEnabled = IsEnabled();
+ sal_uInt16 nButtonStyle = FRAME_DRAW_DOUBLEIN;
aImageSize.Width() = CalcZoom( aImageSize.Width() );
aImageSize.Height() = CalcZoom( aImageSize.Height() );
// Border und Selektionsstatus ausgeben
- nButtonStyle = FRAME_DRAW_DOUBLEIN;
aImageRect = aDecoView.DrawFrame( aImageRect, nButtonStyle );
if ( (ImplGetButtonState() & BUTTON_DRAW_PRESSED) || !bEnabled )
SetFillColor( rStyleSettings.GetFaceColor() );
@@ -2250,13 +2181,7 @@ if ( bNativeOK == sal_False )
if ( !bEnabled )
nButtonStyle |= IMAGE_DRAW_DISABLE;
- // check for HC mode
Image *pImage = &maImage;
- if( !!maImageHC )
- {
- if( rStyleSettings.GetHighContrastMode() )
- pImage = &maImageHC;
- }
Point aImagePos( aImageRect.TopLeft() );
aImagePos.X() += (aImageRect.GetWidth()-aImageSize.Width())/2;
@@ -2814,7 +2739,7 @@ void RadioButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize
}
else
{
- DBG_ERROR( "RadioButton::Draw() - not implemented for RadioButton with Image" );
+ OSL_FAIL( "RadioButton::Draw() - not implemented for RadioButton with Image" );
}
}
@@ -2952,38 +2877,21 @@ void RadioButton::Toggle()
// -----------------------------------------------------------------------
-sal_Bool RadioButton::SetModeRadioImage( const Image& rImage, BmpColorMode eMode )
-{
- if( eMode == BMP_COLOR_NORMAL )
+sal_Bool RadioButton::SetModeRadioImage( const Image& rImage )
{
if ( rImage != maImage )
{
maImage = rImage;
StateChanged( STATE_CHANGE_DATA );
}
-}
- else if( eMode == BMP_COLOR_HIGHCONTRAST )
- {
- if( maImageHC != rImage )
- {
- maImageHC = rImage;
- StateChanged( STATE_CHANGE_DATA );
- }
- }
- else
- return sal_False;
-
return sal_True;
}
// -----------------------------------------------------------------------
-const Image& RadioButton::GetModeRadioImage( BmpColorMode eMode ) const
+const Image& RadioButton::GetModeRadioImage( ) const
{
- if( eMode == BMP_COLOR_HIGHCONTRAST )
- return maImageHC;
- else
- return maImage;
+ return maImage;
}
// -----------------------------------------------------------------------
@@ -3136,10 +3044,11 @@ Image RadioButton::GetRadioImage( const AllSettings& rSettings, sal_uInt16 nFlag
ResMgr* pResMgr = ImplGetResMgr();
pSVData->maCtrlData.mpRadioImgList = new ImageList();
if( pResMgr )
- LoadThemedImageList( rStyleSettings,
+ LoadThemedImageList( rStyleSettings,
pSVData->maCtrlData.mpRadioImgList,
- ResId( SV_RESID_BITMAP_RADIO+nStyle, *pResMgr ), 6 );
- pSVData->maCtrlData.mnRadioStyle = nStyle;
+ ResId( SV_RESID_BITMAP_RADIO+nStyle, *pResMgr ), 6
+ );
+ pSVData->maCtrlData.mnRadioStyle = nStyle;
}
sal_uInt16 nId;
@@ -3223,13 +3132,13 @@ Size RadioButton::CalcMinimumSize( long nMaxWidth ) const
if ( aSize.Height() < aTextSize.Height() )
aSize.Height() = aTextSize.Height();
}
- else if ( !maImage )
- {
+// else if ( !maImage )
+// {
/* da ansonsten im Writer die Control zu weit oben haengen
aSize.Width() += 2;
aSize.Height() += 2;
*/
- }
+// }
return CalcWindowSize( aSize );
}
@@ -4310,18 +4219,11 @@ void DisclosureButton::ImplDrawCheckBoxState()
ImplSVCtrlData& rCtrlData( ImplGetSVData()->maCtrlData );
if( ! rCtrlData.mpDisclosurePlus )
rCtrlData.mpDisclosurePlus = new Image( BitmapEx( VclResId( SV_DISCLOSURE_PLUS ) ) );
- if( ! rCtrlData.mpDisclosurePlusHC )
- rCtrlData.mpDisclosurePlusHC = new Image( BitmapEx( VclResId( SV_DISCLOSURE_PLUS_HC ) ) );
if( ! rCtrlData.mpDisclosureMinus )
rCtrlData.mpDisclosureMinus = new Image( BitmapEx( VclResId( SV_DISCLOSURE_MINUS ) ) );
- if( ! rCtrlData.mpDisclosureMinusHC )
- rCtrlData.mpDisclosureMinusHC = new Image( BitmapEx( VclResId( SV_DISCLOSURE_MINUS_HC ) ) );
Image* pImg = NULL;
- if( GetSettings().GetStyleSettings().GetHighContrastMode() )
- pImg = IsChecked() ? rCtrlData.mpDisclosureMinusHC : rCtrlData.mpDisclosurePlusHC;
- else
- pImg = IsChecked() ? rCtrlData.mpDisclosureMinus : rCtrlData.mpDisclosurePlus;
+ pImg = IsChecked() ? rCtrlData.mpDisclosureMinus : rCtrlData.mpDisclosurePlus;
DBG_ASSERT( pImg, "no disclosure image" );
if( ! pImg )
@@ -4357,4 +4259,4 @@ void DisclosureButton::KeyInput( const KeyEvent& rKEvt )
Button::KeyInput( rKEvt );
}
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 2fd0ade0f65d..9881edd62ca3 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <tools/table.hxx>
#include <tools/debug.hxx>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/svdata.hxx>
#include <vcl/decoview.hxx>
#include <vcl/ilstbox.hxx>
@@ -46,7 +45,7 @@
// =======================================================================
-
+
inline sal_uLong ImplCreateKey( sal_uInt16 nPos )
{
// Key = Pos+1, wegen Pos 0
@@ -68,7 +67,7 @@ static void lcl_GetSelectedEntries( Table& rSelectedPos, const XubString& rText,
}
// =======================================================================
-
+
ComboBox::ComboBox( WindowType nType ) :
Edit( nType )
{
@@ -214,7 +213,7 @@ void ComboBox::ImplInit( Window* pParent, WinBits nStyle )
Window* pLBParent = this;
if ( mpFloatWin )
pLBParent = mpFloatWin;
- mpImplLB = new ImplListBox( pLBParent, nListStyle|WB_SIMPLEMODE );
+ mpImplLB = new ImplListBox( pLBParent, nListStyle|WB_SIMPLEMODE|WB_AUTOHSCROLL );
mpImplLB->SetPosPixel( Point() );
mpImplLB->SetSelectHdl( LINK( this, ComboBox, ImplSelectHdl ) );
mpImplLB->SetCancelHdl( LINK( this, ComboBox, ImplCancelHdl ) );
@@ -469,7 +468,10 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG )
mbSyntheticModify = sal_True;
Modify();
mbSyntheticModify = sal_False;
- Select();
+ if (ImplGetWindowImpl() != NULL) //liuchen 2009-7-28, resolve the problem that soffice get crashed if in ComboBox_Change event a Worksheets("SheetX").Activate sentence needs to be executed
+ {
+ Select();
+ }
}
return 0;
@@ -1589,3 +1591,5 @@ long ComboBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rPos ) const
return nIndex;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index 6bbe5bb32c38..99cd6b3cba60 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/svdata.hxx>
#include <vcl/svapp.hxx>
#include <vcl/event.hxx>
@@ -585,3 +584,5 @@ void Control::DrawControlText( OutputDevice& _rTargetDevice, Rectangle& _io_rRec
_rTargetDevice.Pop();
#endif
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 769614a9259b..41d5ca198cf2 100755
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,17 +29,13 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/svdata.hxx>
#include <vcl/decoview.hxx>
#include <vcl/event.hxx>
#include <vcl/cursor.hxx>
#include <vcl/virdev.hxx>
-#ifndef _SV_SVIDS_HRC
#include <vcl/svids.hrc>
-#endif
#include <vcl/menu.hxx>
#include <vcl/cmdevt.h>
#include <vcl/subedit.hxx>
@@ -48,7 +45,7 @@
#include <vcl/msgbox.hxx>
#include <vcl/window.h>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <com/sun/star/i18n/XBreakIterator.hpp>
@@ -59,15 +56,11 @@
#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#ifndef _COM_SUN_STAR_DATATRANSFER_DND_DNDCONSTANS_HPP_
#include <com/sun/star/datatransfer/dnd/DNDConstants.hpp>
-#endif
#include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
-#ifndef _COM_SUN_STAR_I18N_XEXTENDEDINPUTSEQUENCECHECKER_HDL_
#include <com/sun/star/i18n/XExtendedInputSequenceChecker.hpp>
-#endif
#include <com/sun/star/i18n/InputSequenceCheckMode.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -80,6 +73,7 @@
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
#include <rtl/memory.h>
+#include <sal/macros.h>
#include <vcl/unohelp.hxx>
#include <vcl/unohelp2.hxx>
@@ -517,7 +511,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
if( aText.Len() )
{
- if( 2*aText.Len() > xub_StrLen(sizeof(nDXBuffer)/sizeof(nDXBuffer[0])) )
+ if( 2*aText.Len() > xub_StrLen(SAL_N_ELEMENTS(nDXBuffer)) )
{
pDXBuffer = new sal_Int32[2*(aText.Len()+1)];
pDX = pDXBuffer;
@@ -804,7 +798,7 @@ uno::Reference < i18n::XBreakIterator > Edit::ImplGetBreakIterator() const
// if ( !xBI.is() )
{
uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- uno::Reference < XInterface > xI = xMSF->createInstance( OUString::createFromAscii( "com.sun.star.i18n.BreakIterator" ) );
+ uno::Reference < XInterface > xI = xMSF->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) );
if ( xI.is() )
{
Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XBreakIterator >*)0) );
@@ -824,7 +818,7 @@ uno::Reference < i18n::XExtendedInputSequenceChecker > Edit::ImplGetInputSequenc
// if ( !xISC.is() )
{
uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- uno::Reference < XInterface > xI = xMSF->createInstance( OUString::createFromAscii( "com.sun.star.i18n.InputSequenceChecker" ) );
+ uno::Reference < XInterface > xI = xMSF->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.InputSequenceChecker")) );
if ( xI.is() )
{
Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XExtendedInputSequenceChecker >*)0) );
@@ -886,12 +880,12 @@ void Edit::ImplInsertText( const XubString& rStr, const Selection* pNewSel, sal_
// determine if input-sequence-checking should be applied or not
//
- static OUString sModule( OUString::createFromAscii( "/org.openoffice.Office.Common/I18N" ) );
- static OUString sRelNode( OUString::createFromAscii( "CTL" ) );
- static OUString sCTLSequenceChecking( OUString::createFromAscii( "CTLSequenceChecking" ) );
- static OUString sCTLSequenceCheckingRestricted( OUString::createFromAscii( "CTLSequenceCheckingRestricted" ) );
- static OUString sCTLSequenceCheckingTypeAndReplace( OUString::createFromAscii( "CTLSequenceCheckingTypeAndReplace" ) );
- static OUString sCTLFont( OUString::createFromAscii( "CTLFont" ) );
+ static OUString sModule( RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.Common/I18N") );
+ static OUString sRelNode( RTL_CONSTASCII_USTRINGPARAM("CTL") );
+ static OUString sCTLSequenceChecking( RTL_CONSTASCII_USTRINGPARAM("CTLSequenceChecking") );
+ static OUString sCTLSequenceCheckingRestricted( RTL_CONSTASCII_USTRINGPARAM("CTLSequenceCheckingRestricted") );
+ static OUString sCTLSequenceCheckingTypeAndReplace( RTL_CONSTASCII_USTRINGPARAM("CTLSequenceCheckingTypeAndReplace") );
+ static OUString sCTLFont( RTL_CONSTASCII_USTRINGPARAM("CTLFont") );
//
sal_Bool bCTLSequenceChecking = sal_False;
sal_Bool bCTLSequenceCheckingRestricted = sal_False;
@@ -1181,7 +1175,7 @@ void Edit::ImplShowCursor( sal_Bool bOnlyIfVisible )
if( aText.Len() )
{
- if( 2*aText.Len() > xub_StrLen(sizeof(nDXBuffer)/sizeof(nDXBuffer[0])) )
+ if( 2*aText.Len() > xub_StrLen(SAL_N_ELEMENTS(nDXBuffer)) )
{
pDXBuffer = new sal_Int32[2*(aText.Len()+1)];
pDX = pDXBuffer;
@@ -1305,7 +1299,7 @@ xub_StrLen Edit::ImplGetCharPos( const Point& rWindowPos ) const
sal_Int32 nDXBuffer[256];
sal_Int32* pDXBuffer = NULL;
sal_Int32* pDX = nDXBuffer;
- if( 2*aText.Len() > xub_StrLen(sizeof(nDXBuffer)/sizeof(nDXBuffer[0])) )
+ if( 2*aText.Len() > xub_StrLen(SAL_N_ELEMENTS(nDXBuffer)) )
{
pDXBuffer = new sal_Int32[2*(aText.Len()+1)];
pDX = pDXBuffer;
@@ -2959,7 +2953,7 @@ void Edit::DeletePopupMenu( PopupMenu* pMenu )
// ::com::sun::star::datatransfer::dnd::XDragGestureListener
void Edit::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent& rDGE ) throw (::com::sun::star::uno::RuntimeException)
{
- vos::OGuard aVclGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aVclGuard;
if ( !IsTracking() && maSelection.Len() &&
!(GetStyle() & WB_PASSWORD) && (!mpDDInfo || mpDDInfo->bStarterOfDD == sal_False) ) // Kein Mehrfach D&D
@@ -2997,7 +2991,7 @@ void Edit::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::Dra
// ::com::sun::star::datatransfer::dnd::XDragSourceListener
void Edit::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent& rDSDE ) throw (::com::sun::star::uno::RuntimeException)
{
- vos::OGuard aVclGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aVclGuard;
if ( rDSDE.DropSuccess && ( rDSDE.DropAction & datatransfer::dnd::DNDConstants::ACTION_MOVE ) )
{
@@ -3023,7 +3017,7 @@ void Edit::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDro
// ::com::sun::star::datatransfer::dnd::XDropTargetListener
void Edit::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent& rDTDE ) throw (::com::sun::star::uno::RuntimeException)
{
- vos::OGuard aVclGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aVclGuard;
sal_Bool bChanges = sal_False;
if ( !mbReadOnly && mpDDInfo )
@@ -3092,14 +3086,14 @@ void Edit::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragE
void Edit::dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent& ) throw (::com::sun::star::uno::RuntimeException)
{
- vos::OGuard aVclGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aVclGuard;
ImplHideDDCursor();
}
void Edit::dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent& rDTDE ) throw (::com::sun::star::uno::RuntimeException)
{
- vos::OGuard aVclGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aVclGuard;
Point aMousePos( rDTDE.LocationX, rDTDE.LocationY );
@@ -3161,3 +3155,5 @@ Selection Edit::GetSurroundingTextSelection() const
{
return GetSelection();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 4a42abd3ea79..1d5b0c66b400 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,7 +48,6 @@
#include "rtl/math.hxx"
-
#include <unotools/localedatawrapper.hxx>
using namespace ::com::sun::star;
@@ -696,9 +696,15 @@ sal_Int64 NumericFormatter::Denormalize( sal_Int64 nValue ) const
{
sal_Int64 nFactor = ImplPower10( GetDecimalDigits() );
if( nValue < 0 )
- return ((nValue-(nFactor/2)) / nFactor );
+ {
+ sal_Int64 nHalf = nValue < ( SAL_MIN_INT64 + nFactor )? 0 : nFactor/2;
+ return ((nValue-nHalf) / nFactor );
+ }
else
- return ((nValue+(nFactor/2)) / nFactor );
+ {
+ sal_Int64 nHalf = nValue > ( SAL_MAX_INT64 - nFactor )? 0 : nFactor/2;
+ return ((nValue+nHalf) / nFactor );
+ }
}
// -----------------------------------------------------------------------
@@ -1173,29 +1179,32 @@ static FieldUnit ImplMetricGetUnit( const XubString& rStr )
}
#define K *1000L
-#define M *1000000L
+#define M *1000000LL
#define X *5280L
-static const sal_Int64 aImplFactor[FUNIT_MILE+1][FUNIT_MILE+1] =
+// twip in km = 254 / 14 400 000 000
+// expressions too big for default size 32 bit need LL to avoid overflow
+
+static const sal_Int64 aImplFactor[FUNIT_LINE+1][FUNIT_LINE+1] =
{ /*
-mm/100 mm cm m km twip point pica inch foot mile */
-{ 1, 100, 1 K, 100 K, 100 M, 2540, 2540, 2540, 2540,2540*12,2540*12 X },
-{ 1, 1, 10, 1 K, 1 M, 2540, 2540, 2540, 2540,2540*12,2540*12 X },
-{ 1, 1, 1, 100, 100 K, 254, 254, 254, 254, 254*12, 254*12 X },
-{ 1, 1, 1, 1, 1 K, 254, 254, 254, 254, 254*12, 254*12 X },
-{ 1, 1, 1, 1, 1, 0, 254, 254, 254, 254*12, 254*12 X },
-{ 1440,144 K,144 K,14400 K, 0, 1, 20, 240, 1440,1440*12,1440*12 X },
-{ 72, 7200, 7200, 720 K, 720 M, 1, 1, 12, 72, 72*12, 72*12 X },
-{ 6, 600, 600, 60 K, 60 M, 1, 1, 1, 6, 6*12, 6*12 X },
-{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 12, 12 X },
-{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 1, 1 X },
-{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 1, 1 }
+mm/100 mm cm m km twip point pica inch foot mile char line */
+{ 1, 100, 1 K, 100 K, 100 M, 2540, 2540, 2540, 2540,2540*12,2540*12 X , 53340, 396240},
+{ 1, 1, 10, 1 K, 1 M, 2540, 2540, 2540, 2540,2540*12,2540*12 X , 5334, 396240},
+{ 1, 1, 1, 100, 100 K, 254, 254, 254, 254, 254*12, 254*12 X , 5334, 39624},
+{ 1, 1, 1, 1, 1 K, 254, 254, 254, 254, 254*12, 254*12 X , 533400, 39624},
+{ 1, 1, 1, 1, 1, 254, 254, 254, 254, 254*12, 254*12 X ,533400 K, 39624},
+{ 1440,144 K,144 K,14400 K,14400LL M, 1, 20, 240, 1440,1440*12,1440*12 X , 210, 3120},
+{ 72, 7200, 7200, 720 K, 720 M, 1, 1, 12, 72, 72*12, 72*12 X , 210, 156},
+{ 6, 600, 600, 60 K, 60 M, 1, 1, 1, 6, 6*12, 6*12 X , 210, 10},
+{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 12, 12 X , 210, 45},
+{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 1, 1 X , 210, 45},
+{ 1, 100, 100, 10 K, 10 M, 1, 1, 1, 1, 1, 1 , 210, 45},
+{ 144, 1440,14400, 14400, 14400, 1, 20, 240, 1440,1440*12, 1440*12 X, 1, 156 },
+{ 720,72000,72000, 7200 K,7200LL M, 20, 10, 13, 11, 11*12, 11*12 X, 105, 1 }
};
-
#undef X
#undef M
#undef K
-// twip in km 254/14400 M
static FieldUnit eDefaultUnit = FUNIT_NONE;
@@ -1232,7 +1241,7 @@ static FieldUnit ImplMap2FieldUnit( MapUnit meUnit, long& nDecDigits )
case MAP_TWIP :
return FUNIT_TWIP;
default:
- DBG_ERROR( "default eInUnit" );
+ OSL_FAIL( "default eInUnit" );
break;
}
return FUNIT_NONE;
@@ -1248,13 +1257,18 @@ static double nonValueDoubleToValueDouble( double nValue )
sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
FieldUnit eInUnit, FieldUnit eOutUnit )
{
+ double nDouble = nonValueDoubleToValueDouble( ConvertDoubleValue(
+ (double)nValue, mnBaseValue, nDecDigits, eInUnit, eOutUnit ) );
+
// caution: precision loss in double cast
- return static_cast<sal_Int64>(
- // #150733# cast double to sal_Int64 can throw a
- // EXCEPTION_FLT_INVALID_OPERATION on Windows
- nonValueDoubleToValueDouble(
- ConvertDoubleValue( (double)nValue, mnBaseValue, nDecDigits,
- eInUnit, eOutUnit ) ) );
+ sal_Int64 nLong = static_cast<sal_Int64>( nDouble );
+
+ if ( nDouble >= (double)SAL_MAX_INT64 )
+ nLong = SAL_MAX_INT64;
+ else if ( nDouble <= (double)SAL_MIN_INT64 )
+ nLong = SAL_MIN_INT64;
+
+ return nLong;
}
// -----------------------------------------------------------------------
@@ -1263,8 +1277,6 @@ sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_uInt16 nDigits,
MapUnit eInUnit, FieldUnit eOutUnit )
{
return static_cast<sal_Int64>(
- // #150733# cast double to sal_Int64 can throw a
- // EXCEPTION_FLT_INVALID_OPERATION on Windows
nonValueDoubleToValueDouble(
ConvertDoubleValue( nValue, nDigits, eInUnit, eOutUnit ) ) );
}
@@ -1275,8 +1287,6 @@ sal_Int64 MetricField::ConvertValue( sal_Int64 nValue, sal_uInt16 nDigits,
FieldUnit eInUnit, MapUnit eOutUnit )
{
return static_cast<sal_Int64>(
- // #150733# cast double to sal_Int64 can throw a
- // EXCEPTION_FLT_INVALID_OPERATION on Windows
nonValueDoubleToValueDouble(
ConvertDoubleValue( nValue, nDigits, eInUnit, eOutUnit ) ) );
}
@@ -1345,7 +1355,7 @@ double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits,
eInUnit == MAP_APPFONT ||
eInUnit == MAP_RELATIVE )
{
- DBG_ERROR( "invalid parameters" );
+ OSL_FAIL( "invalid parameters" );
return nValue;
}
@@ -1402,7 +1412,7 @@ double MetricField::ConvertDoubleValue( double nValue, sal_uInt16 nDigits,
eOutUnit == MAP_APPFONT ||
eOutUnit == MAP_RELATIVE )
{
- DBG_ERROR( "invalid parameters" );
+ OSL_FAIL( "invalid parameters" );
return nValue;
}
@@ -1772,6 +1782,22 @@ MetricField::~MetricField()
{
}
+void MetricField::SetUnit( FieldUnit nNewUnit )
+{
+ sal_Int64 nRawMax = GetMax( nNewUnit );
+ sal_Int64 nMax = Denormalize( nRawMax );
+ sal_Int64 nMin = Denormalize( GetMin( nNewUnit ) );
+ sal_Int64 nFirst = Denormalize( GetFirst( nNewUnit ) );
+ sal_Int64 nLast = Denormalize( GetLast( nNewUnit ) );
+
+ MetricFormatter::SetUnit( nNewUnit );
+
+ SetMax( Normalize( nMax ), nNewUnit );
+ SetMin( Normalize( nMin ), nNewUnit );
+ SetFirst( Normalize( nFirst ), nNewUnit );
+ SetLast( Normalize( nLast ), nNewUnit );
+}
+
// -----------------------------------------------------------------------
void MetricField::SetFirst( sal_Int64 nNewFirst, FieldUnit eInUnit )
@@ -2505,3 +2531,5 @@ sal_Int64 CurrencyBox::GetValue() const
// Implementation not inline, because it is a virtual Function
return CurrencyFormatter::GetValue();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 4b14a5a4b199..65e8c8d91f82 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,13 +30,9 @@
#include "precompiled_vcl.hxx"
#include <tools/debug.hxx>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/svdata.hxx>
-#ifndef _SV_EVENT_HXX
#include <vcl/field.hxx>
-#endif
#include <vcl/svapp.hxx>
#include <vcl/sound.hxx>
#include <vcl/event.hxx>
@@ -1301,7 +1298,7 @@ static sal_Bool ImplDateGetValue( const XubString& rStr, Date& rDate, ExtDateFie
default:
{
- DBG_ERROR( "DateFormat???" );
+ OSL_FAIL( "DateFormat???" );
}
}
}
@@ -1437,7 +1434,7 @@ XubString DateFormatter::ImplGetDateAsText( const Date& rDate,
break;
default:
{
- DBG_ERROR( "DateFormat???" );
+ OSL_FAIL( "DateFormat???" );
}
}
@@ -1610,7 +1607,7 @@ void DateField::ImplDateSpinArea( sal_Bool bUp )
}
break;
default:
- DBG_ERROR( "invalid conversion" );
+ OSL_FAIL( "invalid conversion" );
break;
}
}
@@ -3303,7 +3300,7 @@ void TimeField::SetExtFormat( ExtTimeFieldFormat eFormat )
SetFormat( TIMEF_SEC );
}
break;
- default: DBG_ERROR( "ExtTimeFieldFormat unknown!" );
+ default: OSL_FAIL( "ExtTimeFieldFormat unknown!" );
}
if ( GetField() && GetField()->GetText().Len() )
@@ -3467,3 +3464,5 @@ sal_uInt16 TimeBox::GetTimePos( const Time& rTime ) const
bSec = b100Sec = sal_True;
return ComboBox::GetEntryPos( ImplGetLocaleDataWrapper().getTime( rTime, bSec, b100Sec ) );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/fixbrd.cxx b/vcl/source/control/fixbrd.cxx
index cc621e16175d..4efbbe2deee1 100644
--- a/vcl/source/control/fixbrd.cxx
+++ b/vcl/source/control/fixbrd.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/event.hxx>
#include <vcl/fixbrd.hxx>
@@ -234,3 +233,5 @@ void FixedBorder::SetBorderType( sal_uInt16 nType )
Invalidate();
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index db92cd0b09af..1828ded64a14 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -505,17 +506,14 @@ void FixedLine::ImplDraw( bool bLayout )
{
if( !pVector )
{
- long nX = 0;
- long nY = 0;
-
if ( nWinStyle & WB_VERT )
{
- nX = (aOutSize.Width()-1)/2;
+ long nX = (aOutSize.Width()-1)/2;
aDecoView.DrawSeparator( Point( nX, 0 ), Point( nX, aOutSize.Height()-1 ) );
}
else
{
- nY = (aOutSize.Height()-1)/2;
+ long nY = (aOutSize.Height()-1)/2;
aDecoView.DrawSeparator( Point( 0, nY ), Point( aOutSize.Width()-1, nY ), false );
}
}
@@ -782,11 +780,6 @@ void FixedBitmap::ImplDraw( OutputDevice* pDev, sal_uLong /* nDrawFlags */,
sal_uInt16 nStyle = 0;
Bitmap* pBitmap = &maBitmap;
Color aCol;
- if( !!maBitmapHC )
- {
- if( GetSettings().GetStyleSettings().GetHighContrastMode() )
- pBitmap = &maBitmapHC;
- }
if( nStyle & IMAGE_DRAW_COLORTRANSFORM )
{
@@ -908,28 +901,17 @@ void FixedBitmap::SetBitmap( const Bitmap& rBitmap )
// -----------------------------------------------------------------------
-sal_Bool FixedBitmap::SetModeBitmap( const Bitmap& rBitmap, BmpColorMode eMode )
+sal_Bool FixedBitmap::SetModeBitmap( const Bitmap& rBitmap )
{
- if( eMode == BMP_COLOR_NORMAL )
- SetBitmap( rBitmap );
- else if( eMode == BMP_COLOR_HIGHCONTRAST )
- {
- maBitmapHC = rBitmap;
- StateChanged( STATE_CHANGE_DATA );
- }
- else
- return sal_False;
+ SetBitmap( rBitmap );
return sal_True;
}
// -----------------------------------------------------------------------
-const Bitmap& FixedBitmap::GetModeBitmap( BmpColorMode eMode) const
+const Bitmap& FixedBitmap::GetModeBitmap( ) const
{
- if( eMode == BMP_COLOR_HIGHCONTRAST )
- return maBitmapHC;
- else
- return maBitmap;
+ return maBitmap;
}
// =======================================================================
@@ -1033,11 +1015,6 @@ void FixedImage::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
Image *pImage = &maImage;
Color aCol;
- if( !!maImageHC )
- {
- if( GetSettings().GetStyleSettings().GetHighContrastMode() )
- pImage = &maImageHC;
- }
// Haben wir ueberhaupt ein Image
if ( !(!(*pImage)) )
@@ -1068,7 +1045,7 @@ void FixedImage::Paint( const Rectangle& )
Size FixedImage::GetOptimalSize( WindowSizeType ) const
{
- const Image* pImage = GetSettings().GetStyleSettings().GetHighContrastMode() ? &maImageHC : &maImage;
+ const Image* pImage = &maImage;
return pImage->GetSizePixel();
}
@@ -1163,31 +1140,17 @@ void FixedImage::SetImage( const Image& rImage )
// -----------------------------------------------------------------------
-sal_Bool FixedImage::SetModeImage( const Image& rImage, BmpColorMode eMode )
+sal_Bool FixedImage::SetModeImage( const Image& rImage )
{
- if( eMode == BMP_COLOR_NORMAL )
- SetImage( rImage );
- else if( eMode == BMP_COLOR_HIGHCONTRAST )
- {
- if( maImageHC != rImage )
- {
- maImageHC = rImage;
- StateChanged( STATE_CHANGE_DATA );
- }
- }
- else
- return sal_False;
+ SetImage( rImage );
return sal_True;
}
// -----------------------------------------------------------------------
-const Image& FixedImage::GetModeImage( BmpColorMode eMode ) const
+const Image& FixedImage::GetModeImage( ) const
{
- if( eMode == BMP_COLOR_HIGHCONTRAST )
- return maImageHC;
- else
- return maImage;
+ return maImage;
}
// -----------------------------------------------------------------------
@@ -1197,3 +1160,5 @@ Point FixedImage::CalcImagePos( const Point& rPos,
{
return ImplCalcPos( GetStyle(), rPos, rObjSize, rWinSize );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/group.cxx b/vcl/source/control/group.cxx
index 5b09bf6bb3b5..52dd061e317e 100644
--- a/vcl/source/control/group.cxx
+++ b/vcl/source/control/group.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <vcl/group.hxx>
#include <vcl/controldata.hxx>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
@@ -136,6 +135,7 @@ GroupBox::GroupBox( Window* pParent, const ResId& rResId ) :
void GroupBox::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
const Point& rPos, const Size& rSize, bool bLayout )
{
+ OSL_TRACE("GroupBox::ImplDraw Y %d, X %d", rPos.Y(), rPos.X() );
long nTop;
long nTextOff;
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -322,3 +322,4 @@ void GroupBox::DataChanged( const DataChangedEvent& rDCEvt )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 670d6dad0ada..a288c3656317 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,17 +40,14 @@
#include <vcl/i18nhelp.hxx>
#include <vcl/controldata.hxx>
#include <vcl/unohelp.hxx>
-#ifndef _COM_SUN_STAR_UTIL_XCOLLATOR_HPP_
-#include <com/sun/star/i18n/XCollator.hpp>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_HDL_
#include <com/sun/star/accessibility/XAccessible.hpp>
-#endif
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEROLE_HPP_
#include <com/sun/star/accessibility/AccessibleRole.hpp>
-#endif
+
+#include <rtl/instance.hxx>
+#include <comphelper/string.hxx>
+#include <comphelper/processfactory.hxx>
#define MULTILINE_ENTRY_DRAW_FLAGS ( TEXT_DRAW_WORDBREAK | TEXT_DRAW_MULTILINE | TEXT_DRAW_VCENTER )
@@ -149,17 +147,29 @@ void ImplEntryList::SelectEntry( sal_uInt16 nPos, sal_Bool bSelect )
}
}
-// -----------------------------------------------------------------------
-
-uno::Reference< i18n::XCollator > ImplGetCollator (lang::Locale &rLocale)
+namespace
{
- static uno::Reference< i18n::XCollator > xCollator;
- if ( !xCollator.is() )
- xCollator = vcl::unohelper::CreateCollator();
- if( xCollator.is() )
- xCollator->loadDefaultCollator (rLocale, 0);
+ struct theSorter
+ : public rtl::StaticWithInit< comphelper::string::NaturalStringSorter, theSorter >
+ {
+ comphelper::string::NaturalStringSorter operator () ()
+ {
+ return comphelper::string::NaturalStringSorter(
+ ::comphelper::getProcessComponentContext(),
+ Application::GetSettings().GetLocale());
+ }
+ };
+}
- return xCollator;
+namespace vcl
+{
+ namespace unohelper
+ {
+ const comphelper::string::NaturalStringSorter& getNaturalStringSorterForAppLocale()
+ {
+ return theSorter::get();
+ }
+ }
}
sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry, sal_Bool bSort )
@@ -173,8 +183,7 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
}
else
{
- lang::Locale aLocale = Application::GetSettings().GetLocale();
- uno::Reference< i18n::XCollator > xCollator = ImplGetCollator(aLocale);
+ const comphelper::string::NaturalStringSorter &rSorter = theSorter::get();
const XubString& rStr = pNewEntry->maStr;
sal_uLong nLow, nHigh, nMid;
@@ -187,9 +196,7 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
{
// XXX even though XCollator::compareString returns a sal_Int32 the only
// defined values are {-1, 0, 1} which is compatible with StringCompare
- StringCompare eComp = xCollator.is() ?
- (StringCompare)xCollator->compareString (rStr, pTemp->maStr)
- : COMPARE_EQUAL;
+ StringCompare eComp = (StringCompare)rSorter.compare(rStr, pTemp->maStr);
// Schnelles Einfuegen bei sortierten Daten
if ( eComp != COMPARE_LESS )
@@ -201,7 +208,7 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
nLow = mnMRUCount;
pTemp = (ImplEntryType*)GetEntry( (sal_uInt16)nLow );
- eComp = (StringCompare)xCollator->compareString (rStr, pTemp->maStr);
+ eComp = (StringCompare)rSorter.compare(rStr, pTemp->maStr);
if ( eComp != COMPARE_GREATER )
{
Insert( pNewEntry, (sal_uLong)0 );
@@ -215,7 +222,7 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
nMid = (nLow + nHigh) / 2;
pTemp = (ImplEntryType*)GetObject( nMid );
- eComp = (StringCompare)xCollator->compareString (rStr, pTemp->maStr);
+ eComp = (StringCompare)rSorter.compare(rStr, pTemp->maStr);
if ( eComp == COMPARE_LESS )
nHigh = nMid-1;
@@ -238,8 +245,8 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
}
catch (uno::RuntimeException& )
{
- // XXX this is arguable, if the exception occured because pNewEntry is
- // garbage you wouldn't insert it. If the exception occured because the
+ // XXX this is arguable, if the exception occurred because pNewEntry is
+ // garbage you wouldn't insert it. If the exception occurred because the
// Collator implementation is garbage then give the user a chance to see
// his stuff
Insert( pNewEntry, (sal_uLong)0 );
@@ -2753,25 +2760,17 @@ ImplWin::ImplWin( Window* pParent, WinBits nWinStyle ) :
// -----------------------------------------------------------------------
-sal_Bool ImplWin::SetModeImage( const Image& rImage, BmpColorMode eMode )
+sal_Bool ImplWin::SetModeImage( const Image& rImage )
{
- if( eMode == BMP_COLOR_NORMAL )
- SetImage( rImage );
- else if( eMode == BMP_COLOR_HIGHCONTRAST )
- maImageHC = rImage;
- else
- return sal_False;
+ SetImage( rImage );
return sal_True;
}
// -----------------------------------------------------------------------
-const Image& ImplWin::GetModeImage( BmpColorMode eMode ) const
+const Image& ImplWin::GetModeImage( ) const
{
- if( eMode == BMP_COLOR_HIGHCONTRAST )
- return maImageHC;
- else
- return maImage;
+ return maImage;
}
// -----------------------------------------------------------------------
@@ -2788,7 +2787,6 @@ void ImplWin::MouseButtonDown( const MouseEvent& )
{
if( IsEnabled() )
{
-// Control::MouseButtonDown( rMEvt );
MBDown();
}
}
@@ -2950,12 +2948,6 @@ void ImplWin::DrawEntry( sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDraw
// check for HC mode
Image *pImage = &maImage;
- if( !!maImageHC )
- {
- if( GetSettings().GetStyleSettings().GetHighContrastMode() )
- pImage = &maImageHC;
- }
-
if ( !IsZoom() )
{
DrawImage( aPtImg, *pImage, nStyle );
@@ -3189,6 +3181,11 @@ Size ImplListBoxFloatingWindow::CalcFloatSize()
long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize();
aFloatSz.Width() += nSBWidth;
}
+
+ long nDesktopWidth = GetDesktopRectPixel().getWidth();
+ if (aFloatSz.Width() > nDesktopWidth)
+ // Don't exceed the desktop width.
+ aFloatSz.Width() = nDesktopWidth;
}
if ( aFloatSz.Height() > nMaxHeight )
@@ -3215,6 +3212,13 @@ Size ImplListBoxFloatingWindow::CalcFloatSize()
aFloatSz.Height() = nInnerHeight + nTop + nBottom;
}
+ if (aFloatSz.Width() < aSz.Width())
+ {
+ // The max width of list box entries exceeds the window width.
+ // Account for the scroll bar height.
+ long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize();
+ aFloatSz.Height() += nSBWidth;
+ }
return aFloatSz;
}
@@ -3268,3 +3272,5 @@ void ImplListBoxFloatingWindow::StartFloat( sal_Bool bStartTracking )
mpImplLB->GetMainWindow()->ImplClearLayoutData();
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx
index faeb460c46e4..7f304e335f54 100644
--- a/vcl/source/control/imgctrl.cxx
+++ b/vcl/source/control/imgctrl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -104,13 +105,8 @@ void ImageControl::ImplDraw( OutputDevice& rDev, sal_uLong nDrawFlags, const Poi
nStyle |= IMAGE_DRAW_DISABLE;
}
- const Image& rImage( GetModeImage( BMP_COLOR_NORMAL ) );
- const Image& rImageHC( GetModeImage( BMP_COLOR_HIGHCONTRAST ) );
-
+ const Image& rImage( GetModeImage() );
const Image* pImage = &rImage;
- if ( !!rImageHC && GetSettings().GetStyleSettings().GetHighContrastMode() )
- pImage = &rImageHC;
-
const Rectangle aDrawRect( rPos, rSize );
if ( !*pImage )
{
@@ -229,3 +225,4 @@ void ImageControl::LoseFocus()
GetWindow( WINDOW_BORDER )->Invalidate();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx
index aae78baa3fb7..e2d502026203 100644
--- a/vcl/source/control/longcurr.cxx
+++ b/vcl/source/control/longcurr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,9 +35,7 @@
#include <tools/debug.hxx>
#include <tools/bigint.hxx>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/event.hxx>
#include <vcl/svapp.hxx>
@@ -857,3 +856,5 @@ sal_uInt16 LongCurrencyBox::GetValuePos( BigInt nValue ) const
}
// =======================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index 594b76684a1a..88b583a3240d 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1642,3 +1643,5 @@ MultiListBox::MultiListBox( Window* pParent, const ResId& rResId ) :
Show();
EnableMultiSelection( sal_True );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx
index 5996a5b2d1b1..13513f62b719 100644
--- a/vcl/source/control/menubtn.cxx
+++ b/vcl/source/control/menubtn.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/decoview.hxx>
#include <vcl/event.hxx>
#include <vcl/menu.hxx>
@@ -238,3 +237,5 @@ void MenuButton::SetPopupMenu( PopupMenu* pNewMenu )
// diese Funktion zur 6.0 inline werden
mpMenu = pNewMenu;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx
index f03136394512..f40bc376d5e0 100644
--- a/vcl/source/control/morebtn.cxx
+++ b/vcl/source/control/morebtn.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,15 +30,12 @@
#include "precompiled_vcl.hxx"
#include <vcl/morebtn.hxx>
-#ifndef _SV_RD_H
#include <tools/rc.h>
-#endif
-
-
+#include <vector>
// =======================================================================
-DECLARE_LIST( ImplMoreWindowList, Window* )
+typedef ::std::vector< Window* > ImplMoreWindowList;
struct ImplMoreButtonData
{
@@ -150,7 +148,6 @@ void MoreButton::Click()
{
Window* pParent = GetParent();
Size aSize( pParent->GetSizePixel() );
- Window* pWindow = (mpMBData->mpItemList) ? mpMBData->mpItemList->First() : NULL;
long nDeltaPixel = LogicToPixel( Size( 0, mnDelta ), meUnit ).Height();
// Status aendern
@@ -165,10 +162,10 @@ void MoreButton::Click()
if ( mbState )
{
// Fenster anzeigen
- while ( pWindow )
- {
- pWindow->Show();
- pWindow = mpMBData->mpItemList->Next();
+ if ( mpMBData->mpItemList ) {
+ for ( size_t i = 0, n = mpMBData->mpItemList->size(); i < n; ++i ) {
+ (*mpMBData->mpItemList)[ i ]->Show();
+ }
}
// Dialogbox anpassen
@@ -195,10 +192,10 @@ void MoreButton::Click()
pParent->SetSizePixel( aSize );
// Fenster nicht mehr anzeigen
- while ( pWindow )
- {
- pWindow->Hide();
- pWindow = mpMBData->mpItemList->Next();
+ if ( mpMBData->mpItemList ) {
+ for ( size_t i = 0, n = mpMBData->mpItemList->size(); i < n; ++i ) {
+ (*mpMBData->mpItemList)[ i ]->Hide();
+ }
}
}
}
@@ -208,9 +205,9 @@ void MoreButton::Click()
void MoreButton::AddWindow( Window* pWindow )
{
if ( !mpMBData->mpItemList )
- mpMBData->mpItemList = new ImplMoreWindowList( 1024, 16, 16 );
+ mpMBData->mpItemList = new ImplMoreWindowList();
- mpMBData->mpItemList->Insert( pWindow, LIST_APPEND );
+ mpMBData->mpItemList->push_back( pWindow );
if ( mbState )
pWindow->Show();
@@ -222,8 +219,17 @@ void MoreButton::AddWindow( Window* pWindow )
void MoreButton::RemoveWindow( Window* pWindow )
{
- if ( mpMBData->mpItemList )
- mpMBData->mpItemList->Remove( pWindow );
+ if ( mpMBData->mpItemList ) {
+ for ( ImplMoreWindowList::iterator it = mpMBData->mpItemList->begin();
+ it < mpMBData->mpItemList->end();
+ ++it
+ ) {
+ if ( *it == pWindow ) {
+ mpMBData->mpItemList->erase( it );
+ break;
+ }
+ }
+ }
}
// -----------------------------------------------------------------------
@@ -278,3 +284,4 @@ XubString MoreButton::GetLessText() const
return PushButton::GetText();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index 9bc71f1a55e3..938b7831985c 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,10 +39,9 @@
#include "rtl/string.hxx"
#include "tools/rc.h"
+using ::rtl::OUString;
-using namespace rtl;
-
/* #i77549#
HACK: for scrollbars in case of thumb rect, page up and page down rect we
abuse the HitTestNativeControl interface. All theming engines but aqua
@@ -244,7 +244,6 @@ void ScrollBar::ImplUpdateRects( sal_Bool bUpdate )
}
else
{
- Size aScrBarSize = GetOutputSizePixel();
if ( GetStyle() & WB_HORZ )
{
const long nSpace = maTrackRect.Right() - maTrackRect.Left();
@@ -1589,3 +1588,5 @@ void ScrollBarBox::DataChanged( const DataChangedEvent& rDCEvt )
Invalidate();
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx
index 0058acc005c7..71eeeae665d4 100644
--- a/vcl/source/control/slider.cxx
+++ b/vcl/source/control/slider.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/event.hxx>
#include <vcl/decoview.hxx>
#include <vcl/slider.hxx>
@@ -1080,3 +1079,5 @@ Size Slider::CalcWindowSizePixel()
}
return aSize;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx
index 52b3fdca9730..50265e911f80 100644
--- a/vcl/source/control/spinbtn.cxx
+++ b/vcl/source/control/spinbtn.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -322,8 +323,6 @@ void SpinButton::MouseMove( const MouseEvent& rMEvt )
void SpinButton::KeyInput( const KeyEvent& rKEvt )
{
- KeyCode aCode = rKEvt.GetKeyCode();
-
if ( !rKEvt.GetKeyCode().GetModifier() )
{
switch ( rKEvt.GetKeyCode().GetCode() )
@@ -548,3 +547,5 @@ long SpinButton::PreNotify( NotifyEvent& rNEvt )
}
// -----------------------------------------------------------------------
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index d7501a6f99b6..f9215ab90835 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1090,3 +1091,5 @@ void SpinField::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
pDev->SetSettings( aOldSettings );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 3140d100aa86..bb60e7e5eea9 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,7 +46,7 @@
#include "vcl/window.h"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <vector>
// =======================================================================
@@ -75,8 +76,8 @@ struct ImplTabItem
struct ImplTabCtrlData
{
- std::hash_map< int, int > maLayoutPageIdToLine;
- std::hash_map< int, int > maLayoutLineToPageId;
+ boost::unordered_map< int, int > maLayoutPageIdToLine;
+ boost::unordered_map< int, int > maLayoutLineToPageId;
std::vector< Rectangle > maTabRectangles;
Point maItemsOffset; // offset of the tabitems
std::vector< ImplTabItem > maItemList;
@@ -160,6 +161,18 @@ const Color& TabControl::GetCanonicalTextColor( const StyleSettings& _rStyle ) c
// -----------------------------------------------------------------------
+WinBits TabControl::ImplInitStyle( WinBits nStyle )
+{
+ if ( !(nStyle & WB_NOTABSTOP) )
+ nStyle |= WB_TABSTOP;
+ if ( !(nStyle & WB_NOGROUP) )
+ nStyle |= WB_GROUP;
+
+ return nStyle;
+}
+
+// -----------------------------------------------------------------------
+
void TabControl::ImplInitSettings( sal_Bool bFont,
sal_Bool bForeground, sal_Bool bBackground )
{
@@ -214,6 +227,7 @@ TabControl::TabControl( Window* pParent, WinBits nStyle ) :
Control( WINDOW_TABCONTROL )
{
ImplInit( pParent, nStyle );
+ OSL_TRACE("*** TABCONTROL no notabs? %s", ( GetStyle() & WB_NOBORDER ) ? "true" : "false" );
}
// -----------------------------------------------------------------------
@@ -606,7 +620,13 @@ void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId )
if ( pPage )
{
- pPage->SetPosSizePixel( aRect.TopLeft(), aRect.GetSize() );
+ if ( ( GetStyle() & WB_NOBORDER ) )
+ {
+ Rectangle aRectNoTab( (const Point&)Point( 0, 0 ), GetSizePixel() );
+ pPage->SetPosSizePixel( aRectNoTab.TopLeft(), aRectNoTab.GetSize() );
+ }
+ else
+ pPage->SetPosSizePixel( aRect.TopLeft(), aRect.GetSize() );
// activate page here so the conbtrols can be switched
// also set the help id of the parent window to that of the tab page
@@ -661,6 +681,12 @@ sal_Bool TabControl::ImplPosCurTabPage()
ImplTabItem* pItem = ImplGetItem( GetCurPageId() );
if ( pItem && pItem->mpTabPage )
{
+ if ( ( GetStyle() & WB_NOBORDER ) )
+ {
+ Rectangle aRectNoTab( (const Point&)Point( 0, 0 ), GetSizePixel() );
+ pItem->mpTabPage->SetPosSizePixel( aRectNoTab.TopLeft(), aRectNoTab.GetSize() );
+ return sal_True;
+ }
Rectangle aRect = ImplGetTabRect( TAB_PAGERECT );
pItem->mpTabPage->SetPosSizePixel( aRect.TopLeft(), aRect.GetSize() );
return sal_True;
@@ -1054,7 +1080,8 @@ void TabControl::KeyInput( const KeyEvent& rKEvt )
void TabControl::Paint( const Rectangle& rRect )
{
- ImplPaint( rRect, false );
+ if ( !( GetStyle() & WB_NOBORDER ) )
+ ImplPaint( rRect, false );
}
// -----------------------------------------------------------------------
@@ -1082,7 +1109,6 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
// Draw the TabPage border
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Rectangle aCurRect;
- long nTopOff = 1;
aRect.Left() -= TAB_OFFSET;
aRect.Top() -= TAB_OFFSET;
aRect.Right() += TAB_OFFSET;
@@ -1124,6 +1150,7 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
}
else
{
+ long nTopOff = 1;
if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
SetLineColor( rStyleSettings.GetLightColor() );
else
@@ -1486,6 +1513,10 @@ void TabControl::StateChanged( StateChangedType nType )
ImplInitSettings( sal_False, sal_False, sal_True );
Invalidate();
}
+ else if ( nType == STATE_CHANGE_STYLE )
+ {
+ SetStyle( ImplInitStyle( GetStyle() ) );
+ }
}
// -----------------------------------------------------------------------
@@ -2082,7 +2113,7 @@ Rectangle TabControl::GetCharacterBounds( sal_uInt16 nPageId, long nIndex ) cons
if( HasLayoutData() )
{
- std::hash_map< int, int >::const_iterator it = mpTabCtrlData->maLayoutPageIdToLine.find( (int)nPageId );
+ boost::unordered_map< int, int >::const_iterator it = mpTabCtrlData->maLayoutPageIdToLine.find( (int)nPageId );
if( it != mpTabCtrlData->maLayoutPageIdToLine.end() )
{
Pair aPair = mpControlData->mpLayoutData->GetLineStartEnd( it->second );
@@ -2147,7 +2178,7 @@ Rectangle TabControl::GetTabPageBounds( sal_uInt16 nPage ) const
if( HasLayoutData() )
{
- std::hash_map< int, int >::const_iterator it = mpTabCtrlData->maLayoutPageIdToLine.find( (int)nPage );
+ boost::unordered_map< int, int >::const_iterator it = mpTabCtrlData->maLayoutPageIdToLine.find( (int)nPage );
if( it != mpTabCtrlData->maLayoutPageIdToLine.end() )
{
if( it->second >= 0 && it->second < static_cast<int>(mpTabCtrlData->maTabRectangles.size()) )
@@ -2213,3 +2244,4 @@ void TabControl::SetMinimumSizePixel( const Size& i_rSize )
// -----------------------------------------------------------------------
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/control/throbber.cxx b/vcl/source/control/throbber.cxx
index 6ebd02cb5de1..a55fdb3eb379 100644
--- a/vcl/source/control/throbber.cxx
+++ b/vcl/source/control/throbber.cxx
@@ -300,7 +300,7 @@ void Throbber::setImageList( const Sequence< Reference< XGraphic > >& rImageList
//----------------------------------------------------------------------------------------------------------------------
IMPL_LINK( Throbber, TimeOutHdl, void*, EMPTYARG )
{
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if ( maImageList.empty() )
return 0;
diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index cb565122ea63..b0c17df110b7 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -153,12 +154,6 @@ static const char* pStringIds[] = {
// --------------------------------------------------------------------
-#if 0 // TODO: use them
-static const char* pStdEncNames[] = {
- "ISOAdobe", "Expert", "ExpertSubSet"
-};
-#endif
-
// --------------------------------------------------------------------
// TOP DICT keywords (also covers PRIV DICT keywords)
@@ -616,15 +611,19 @@ void CffSubsetterContext::readDictOp( void)
const U8 c = *mpReadPtr;
if( c <= 21 ) {
int nOpId = *(mpReadPtr++);
- const char* pCmdName;
+ const char* pCmdName = 0;
if( nOpId != 12)
- pCmdName = pDictOps[ nOpId];
+ pCmdName = pDictOps[nOpId];
else {
const U8 nExtId = *(mpReadPtr++);
- pCmdName = pDictEscs[ nExtId];
+ if (nExtId < 39)
+ pCmdName = pDictEscs[nExtId];
nOpId = 900 + nExtId;
}
+ if (!pCmdName) // skip reserved operators
+ return;
+
//TODO: if( nStackIdx > 0)
switch( *pCmdName) {
default: fprintf( stderr, "unsupported DictOp.type=\'%c\'\n", *pCmdName); break;
@@ -1243,32 +1242,23 @@ void CffSubsetterContext::convertOneTypeEsc( void)
}
case TYPE2OP::HFLEX1: {
assert( mnStackIdx == 9);
-#if 0 // emulate hflex1 as straight line
- const ValType* pX = &mnValStack[ mnStackIdx];
- const ValType fDX = pX[-9] + pX[-7] + pX[-5] + pX[-4] + pX[-3] + pX[-1];
- writeType1Val( fDX);
- writeTypeOp( TYPE1OP::HLINETO);
-#else // emulate hflex1 as two curves
+
writeCurveTo( mnStackIdx, -9, -8, -7, -6, -5, 0);
writeCurveTo( mnStackIdx, -4, 0, -3, -2, -1, 0);
// TODO: emulate hflex1 using othersubr call
-#endif
+
mnStackIdx -= 9;
}
break;
case TYPE2OP::HFLEX: {
assert( mnStackIdx == 7);
ValType* pX = &mnValStack[ mnStackIdx];
-#if 0 // emulate hflex as straight line
- const ValType fDX = pX[-7] + pX[-6] + pX[-4] + pX[-3] + pX[-2] + pX[-1];
- writeType1Val( fDX);
- writeTypeOp( TYPE1OP::HLINETO);
-#else // emulate hflex as two curves
+
pX[+1] = -pX[-5]; // temp: +dy5==-dy2
writeCurveTo( mnStackIdx, -7, 0, -6, -5, -4, 0);
writeCurveTo( mnStackIdx, -3, 0, -2, +1, -1, 0);
// TODO: emulate hflex using othersubr call
-#endif
+
mnStackIdx -= 7;
}
break;
@@ -1316,13 +1306,12 @@ void CffSubsetterContext::callType2Subr( bool bGlobal, int nSubrNumber)
const U8* const pOldReadPtr = mpReadPtr;
const U8* const pOldReadEnd = mpReadEnd;
- int nLen = 0;
if( bGlobal ) {
nSubrNumber += mnGlobalSubrBias;
- nLen = seekIndexData( mnGlobalSubrBase, nSubrNumber);
+ seekIndexData( mnGlobalSubrBase, nSubrNumber);
} else {
nSubrNumber += mpCffLocal->mnLocalSubrBias;
- nLen = seekIndexData( mpCffLocal->mnLocalSubrBase, nSubrNumber);
+ seekIndexData( mpCffLocal->mnLocalSubrBase, nSubrNumber);
}
while( mpReadPtr < mpReadEnd)
@@ -1390,13 +1379,7 @@ if( mbSawError) {
writeType1Val( -350);
writeType1Val( 700);
writeTypeOp( TYPE1OP::RLINETO);
-#if 0
- writeType1Val( -300);
- writeType1Val( -800);
- writeTypeOp( TYPE1OP::RLINETO);
-#else
writeTypeOp( TYPE1OP::CLOSEPATH);
-#endif
writeTypeOp( TYPE1OP::ENDCHAR);
}
#else // useful for manually encoding charstrings
@@ -1770,6 +1753,7 @@ int CffSubsetterContext::getFDSelect( int nGlyphIndex) const
assert( nRangeCount <= mnCharStrCount);
U16 nPrev = (pReadPtr[2]<<8) + pReadPtr[3];
assert( nPrev == 0);
+ (void)nPrev;
pReadPtr += 4;
// TODO? binary search
for( int i = 0; i < nRangeCount; ++i) {
@@ -2064,7 +2048,7 @@ void Type1Emitter::emitValVector( const char* pLineHead, const char* pLineTail,
return;
// emit the line head
- mpPtr += sprintf( mpPtr, pLineHead);
+ mpPtr += sprintf( mpPtr, "%s", pLineHead);
// emit the vector values
ValVector::value_type aVal = 0;
for( ValVector::const_iterator it = rVector.begin();;) {
@@ -2077,7 +2061,7 @@ void Type1Emitter::emitValVector( const char* pLineHead, const char* pLineTail,
// emit the last value
mpPtr += dbl2str( mpPtr, aVal);
// emit the line tail
- mpPtr += sprintf( mpPtr, pLineTail);
+ mpPtr += sprintf( mpPtr, "%s", pLineTail);
}
// --------------------------------------------------------------------
@@ -2127,13 +2111,6 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
pOut += sprintf( pOut, "%%!FontType1-1.0: %s 001.003\n", rEmitter.maSubsetName);
// emit TOPDICT
-#if 0 // improve PS Type1 caching?
- nOfs += sprintf( &aT1Str[nOfs],
- "FontDirectory/%s known{/%s findfont dup/UniqueID known{dup\n"
- "/UniqueID get %d eq exch/FontType get 1 eq and}{pop false}ifelse\n"
- "{save true}{false}ifelse}\n{false}ifelse\n",
- pFamilyName, pFamilyName, nUniqueId);
-#endif
pOut += sprintf( pOut,
"11 dict begin\n" // TODO: dynamic entry count for TOPDICT
"/FontType 1 def\n"
@@ -2157,10 +2134,7 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
" /FamilyName (%s) readonly def\n"
"end readonly def\n",
pFullName, pFamilyName);
-#if 0 // TODO: use an standard Type1 encoding if possible
- pOut += sprintf( pOut,
- "/Encoding StandardEncoding def\n");
-#else
+
pOut += sprintf( pOut,
"/Encoding 256 array\n"
"0 1 255 {1 index exch /.notdef put} for\n");
@@ -2169,7 +2143,6 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
pOut += sprintf( pOut, "dup %d /%s put\n", pReqEncoding[i], pGlyphName);
}
pOut += sprintf( pOut, "readonly def\n");
-#endif
pOut += sprintf( pOut,
// TODO: more topdict entries
"currentdict end\n"
@@ -2415,3 +2388,4 @@ bool FontSubsetInfo::CreateFontSubsetFromCff( GlyphWidth* pOutGlyphWidths )
// ====================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/fontsubset/fontsubset.cxx b/vcl/source/fontsubset/fontsubset.cxx
index 64cf243c6a9d..889d46efe373 100644
--- a/vcl/source/fontsubset/fontsubset.cxx
+++ b/vcl/source/fontsubset/fontsubset.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -115,7 +116,7 @@ bool FontSubsetInfo::CreateFontSubset(
case NO_FONT:
// fall trough
default:
- DBG_ERROR( "unhandled type in CreateFontSubset()");
+ OSL_FAIL( "unhandled type in CreateFontSubset()");
break;
}
@@ -172,14 +173,11 @@ bool FontSubsetInfo::CreateFontSubsetFromSfnt( sal_Int32* pOutGlyphWidths )
// TODO: replace dummy implementation
bool FontSubsetInfo::CreateFontSubsetFromType1( sal_Int32* pOutGlyphWidths)
{
-#if 0
- // TODO: replace dummy implementation when someone needs this
-#else
(void)pOutGlyphWidths;
fprintf(stderr,"CreateFontSubsetFromType1: replace dummy implementation\n");
-#endif
return false;
}
// ====================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx
index 403e64768872..da0d84cec089 100644
--- a/vcl/source/fontsubset/gsub.cxx
+++ b/vcl/source/fontsubset/gsub.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,9 +48,9 @@ typedef sal_uInt8 FT_Byte;
typedef std::map<sal_uInt16,sal_uInt16> GlyphSubstitution;
-inline long NEXT_Long( const unsigned char* &p )
+inline sal_uInt32 NEXT_Long( const unsigned char* &p )
{
- long nVal = (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3];
+ sal_uInt32 nVal = (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3];
p += 4;
return nVal;
}
@@ -356,3 +357,5 @@ int HasVerticalGSUB( struct _TrueTypeFont* pTTFile )
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/fontsubset/gsub.h b/vcl/source/fontsubset/gsub.h
index 9d552ce45701..bb4543f372da 100644
--- a/vcl/source/fontsubset/gsub.h
+++ b/vcl/source/fontsubset/gsub.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -42,3 +43,5 @@ void ReleaseGSUB( struct vcl::_TrueTypeFont* pTTFile );
}
#endif /* _PSP_GSUB_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/fontsubset/list.c b/vcl/source/fontsubset/list.c
index 3b55b4dfee15..def5faa7b553 100644
--- a/vcl/source/fontsubset/list.c
+++ b/vcl/source/fontsubset/list.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,20 +35,12 @@
/*[]---------------------------------------------------[]*/
#include <stdlib.h>
-
-#if OSL_DEBUG_LEVEL == 0
-# ifndef NDEBUG
-# define NDEBUG
-# endif
-#endif
-
#include <assert.h>
#ifdef MALLOC_TRACE
#include <stdio.h>
#include </usr/local/include/malloc.h>
#endif
-/* #define TEST */
#include "list.h"
/*- private data types */
@@ -100,31 +93,6 @@ static lnode *appendPrim(list this, void *el)
this->aCount++;
return ptr;
}
-#ifdef TEST
-static lnode *prependPrim(list this, void *el)
-{
- lnode *ptr = newNode(el);
- lnode *flink, **blink;
-
- if (this->head != 0) {
- blink = &(this->head->prev);
- flink = this->head;
- } else {
- blink = &this->tail;
- flink = 0;
- this->cptr = ptr; /*- list was empty - set current to this element */
- }
-
- *blink = ptr;
- this->head = ptr;
-
- ptr->next = flink;
- ptr->prev = 0;
-
- this->aCount++;
- return ptr;
-}
-#endif
/*- public methods */
list listNewEmpty(void) /*- default ctor */
@@ -139,32 +107,6 @@ list listNewEmpty(void) /*- default ctor */
return this;
}
-#ifdef TEST
-list listNewCopy(list l) /*- copy ctor */
-{
- lnode *ptr, *c;
- list this;
- assert(l != 0);
-
- this = malloc(sizeof(struct _list));
- assert(this != 0);
-
- ptr = l->head;
-
- this->aCount = 0;
- this->eDtor = 0;
- this->head = this->tail = this->cptr = 0;
-
- while (ptr) {
- c = appendPrim(this, ptr->value);
- if (ptr == l->cptr) this->cptr = c;
- ptr = ptr->next;
- }
-
- return this;
-}
-#endif
-
void listDispose(list this) /*- dtor */
{
assert(this != 0);
@@ -198,36 +140,6 @@ int listIsEmpty(list this)
return this->aCount == 0;
}
-
-#ifdef TEST
-int listAtFirst(list this)
-{
- assert(this != 0);
- return this->cptr == this->head;
-}
-
-int listAtLast(list this)
-{
- assert(this != 0);
- return this->cptr == this->tail;
-}
-
-int listPosition(list this)
-{
- int res = 0;
- lnode *ptr;
- assert(this != 0);
-
- ptr = this->head;
-
- while (ptr != this->cptr) {
- ptr = ptr->next;
- res++;
- }
-
- return res;
-}
-#endif
int listFind(list this, void *el)
{
lnode *ptr;
@@ -311,59 +223,7 @@ list listAppend(list this, void *el)
appendPrim(this, el);
return this;
}
-#ifdef TEST
-list listPrepend(list this, void *el)
-{
- assert(this != 0);
-
- prependPrim(this, el);
- return this;
-}
-
-list listInsertAfter(list this, void *el)
-{
- lnode *ptr;
- assert(this != 0);
-
- if (this->cptr == 0) return listAppend(this, el);
-
- ptr = newNode(el);
-
- ptr->prev = this->cptr;
- ptr->next = this->cptr->next;
- this->cptr->next = ptr;
-
- if (ptr->next != 0) {
- ptr->next->prev = ptr;
- } else {
- this->tail = ptr;
- }
- this->aCount++;
- return this;
-}
-
-list listInsertBefore(list this, void *el)
-{
- lnode *ptr;
- assert(this != 0);
-
- if (this->cptr == 0) return listAppend(this, el);
-
- ptr = newNode(el);
- ptr->prev = this->cptr->prev;
- ptr->next = this->cptr;
- this->cptr->prev = ptr;
-
- if (ptr->prev != 0) {
- ptr->prev->next = ptr;
- } else {
- this->head = ptr;
- }
- this->aCount++;
- return this;
-}
-#endif
list listRemove(list this)
{
lnode *ptr = 0;
@@ -408,134 +268,4 @@ list listClear(list this)
return this;
}
-#ifdef TEST
-
-void listForAll(list this, void (*f)(void *))
-{
- lnode *ptr = this->head;
- while (ptr) {
- f(ptr->value);
- ptr = ptr->next;
- }
-}
-
-
-#include <stdio.h>
-
-void printlist(list l)
-{
- int saved;
- assert(l != 0);
- saved = listPosition(l);
-
- printf("[ ");
-
- if (!listIsEmpty(l)) {
- listToFirst(l);
- do {
- printf("%d ", (int) listCurrent(l));
- } while (listNext(l));
- }
-
- printf("]\n");
-
- listPositionAt(l, saved);
-}
-
-void printstringlist(list l)
-{
- int saved;
- assert(l != 0);
- saved = listPosition(l);
-
- printf("[ ");
-
- if (!listIsEmpty(l)) {
- listToFirst(l);
- do {
- printf("'%s' ", (char *) listCurrent(l));
- } while (listNext(l));
- }
-
- printf("]\n");
-
- listPositionAt(l, saved);
-}
-
-void printstat(list l)
-{
- printf("count: %d, position: %d, isEmpty: %d, atFirst: %d, atLast: %d.\n",
- listCount(l), listPosition(l), listIsEmpty(l), listAtFirst(l), listAtLast(l));
-}
-
-void allfunc(void *e)
-{
- printf("%d ", e);
-}
-
-void edtor(void *ptr)
-{
- printf("element dtor: 0x%08x\n", ptr);
- free(ptr);
-}
-
-int main()
-{
- list l1, l2;
- char *ptr;
- int i;
-
-#ifdef MALLOC_TRACE
- mal_leaktrace(1);
- mal_debug(2);
-#endif
-
- l1 = listNewEmpty();
- printstat(l1);
-
- listAppend(l1, 1);
- printstat(l1);
-
- listAppend(l1, 2);
- printstat(l1);
-
- listAppend(l1, 3);
- printstat(l1);
-
- printlist(l1);
-
- listToFirst(l1);
- listInsertBefore(l1, -5);
- printlist(l1);
-
- l2 = listNewCopy(l1);
- printlist(l2);
-
- listForAll(l2, allfunc);
- printf("\n");
-
- listClear(l1);
- listSetElementDtor(l1, edtor);
-
- for(i=0; i<10; i++) {
- ptr = malloc(20);
- snprintf(ptr, 20, "element # %d", i);
- listAppend(l1, ptr);
- }
-
- printstringlist(l1);
-
-
- listDispose(l1);
- listDispose(l2);
-
-#ifdef MALLOC_TRACE
- mal_dumpleaktrace(stdout);
-#endif
-
-
- return 0;
-}
-#endif
-
-
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index c94aad3cbab6..dd7d7f7ba375 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,11 +36,6 @@
*
*/
-#if OSL_DEBUG_LEVEL == 0
-# ifndef NDEBUG
-# define NDEBUG
-# endif
-#endif
#include <assert.h>
#include <stdlib.h>
@@ -64,10 +60,6 @@
#include <osl/endian.h>
#include <algorithm>
-#ifdef TEST7
-#include <ctype.h>
-#endif
-
namespace vcl
{
@@ -675,10 +667,6 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
glyphlist.push_back( index );
-#ifdef DEBUG2
- fprintf(stderr,"glyphlist: += %d\n", index);
-#endif
-
if ((np = GetTTGlyphOutline(ttf, index, &nextComponent, 0, &glyphlist)) == 0)
{
/* XXX that probably indicates a corrupted font */
@@ -688,18 +676,6 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
#endif
}
-#ifdef DEBUG2
- fprintf(stderr,"%d [", (int)glyphlist.size() );
- for( std::vector< sal_uInt32 >::const_iterator it = glyphlist.begin();
- it != glyphlist.end(); ++it )
- {
- fprintf( stderr,"%d ", (int) *it );
- }
- fprintf(stderr, "]\n");
- if( ! glyphlist.empty() )
- fprintf(stderr, "glyphlist: -= %d\n", (int) glyphlist.back());
-
-#endif
if( ! glyphlist.empty() )
glyphlist.pop_back();
@@ -729,23 +705,14 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
b = c = 0;
if (flags & WE_HAVE_A_SCALE) {
-#ifdef DEBUG2
- fprintf(stderr, "WE_HAVE_A_SCALE\n");
-#endif
a = GetInt16(ptr, 0, 1) << 2;
d = a;
ptr += 2;
} else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) {
-#ifdef DEBUG2
- fprintf(stderr, "WE_HAVE_AN_X_AND_Y_SCALE\n");
-#endif
a = GetInt16(ptr, 0, 1) << 2;
d = GetInt16(ptr, 2, 1) << 2;
ptr += 4;
} else if (flags & WE_HAVE_A_TWO_BY_TWO) {
-#ifdef DEBUG2
- fprintf(stderr, "WE_HAVE_A_TWO_BY_TWO\n");
-#endif
a = GetInt16(ptr, 0, 1) << 2;
b = GetInt16(ptr, 2, 1) << 2;
c = GetInt16(ptr, 4, 1) << 2;
@@ -771,18 +738,6 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
assert(!"ARGS_ARE_XY_VALUES is not implemented!!!\n");
}
-#ifdef DEBUG2
- fprintf(stderr, "a: %f, b: %f, c: %f, d: %f, e: %f, f: %f, m: %f, n: %f\n",
- ((double) a) / 65536,
- ((double) b) / 65536,
- ((double) c) / 65536,
- ((double) d) / 65536,
- ((double) e) / 65536,
- ((double) f) / 65536,
- ((double) m) / 65536,
- ((double) n) / 65536);
-#endif
-
for (i=0; i<np; i++) {
F16Dot16 t;
ControlPoint cp;
@@ -792,10 +747,6 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
t = fixedMulDiv(b, nextComponent[i].x << 16, n) + fixedMulDiv(d, nextComponent[i].y << 16, n) + (f << 16);
cp.y = (sal_Int16)(fixedMul(t, n) >> 16);
-#ifdef DEBUG2
- fprintf(stderr, "( %d %d ) -> ( %d %d )\n", nextComponent[i].x, nextComponent[i].y, cp.x, cp.y);
-#endif
-
myPoints.push_back( cp );
}
@@ -857,21 +808,6 @@ static int GetTTGlyphOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint
res = GetCompoundTTOutline(ttf, glyphID, pointArray, metrics, glyphlist ? *glyphlist : aPrivList );
}
-#ifdef DEBUG3
- {
- int i;
- FILE *out = fopen("points.dat", "a");
- assert(out != 0);
- fprintf(out, "Glyph: %d\nPoints: %d\n", glyphID, res);
- for (i=0; i<res; i++) {
- fprintf(out, "%c ", ((*pointArray)[i].flags & 0x8000) ? 'X' : '.');
- fprintf(out, "%c ", ((*pointArray)[i].flags & 1) ? '+' : '-');
- fprintf(out, "%d %d\n", (*pointArray)[i].x, (*pointArray)[i].y);
- }
- fclose(out);
- }
-#endif
-
return res;
}
@@ -1332,7 +1268,7 @@ static sal_uInt32 getGlyph4(const sal_uInt8 *cmap, sal_uInt32 c) {
sal_uInt16 * idDelta;
/* sal_uInt16 * glyphIdArray; */
sal_uInt16 * idRangeOffset;
- sal_uInt16 * glyphIndexArray;
+ /*sal_uInt16 * glyphIndexArray;*/
sal_uInt16 *CMAP4 = (sal_uInt16 *) cmap;
/* sal_uInt16 GEbinsearch(sal_uInt16 *ar, sal_uInt16 length, sal_uInt16 toSearch); */
@@ -1350,7 +1286,7 @@ static sal_uInt32 getGlyph4(const sal_uInt8 *cmap, sal_uInt32 c) {
}
idDelta = startCode + segCount;
idRangeOffset = idDelta + segCount;
- glyphIndexArray = idRangeOffset + segCount;
+ /*glyphIndexArray = idRangeOffset + segCount;*/
if(Int16FromMOTA(idRangeOffset[i]) != 0) {
c = Int16FromMOTA(*(&(idRangeOffset[i]) + (Int16FromMOTA(idRangeOffset[i])/2 + (c - Int16FromMOTA(startCode[i])))));
@@ -1545,79 +1481,6 @@ static void GetKern(TrueTypeFont *ttf)
return;
}
-#ifdef TEST5
-/* KernGlyphsPrim?() functions expect the caller to ensure the validity of their arguments and
- * that x and y elements of the kern array are initialized to zeroes
- */
-static void KernGlyphsPrim1(TrueTypeFont *ttf, sal_uInt16 *glyphs, int nglyphs, int wmode, KernData *kern)
-{
- (void)ttf; /* avoid warning */
- (void)glyphs; /* avoid warning */
- (void)nglyphs; /* avoid warning */
- (void)wmode; /* avoid warning */
- (void)nglyphs; /* avoid warning */
- (void)kern; /* avoid warning */
- fprintf(stderr, "MacOS kerning tables have not been implemented yet!\n");
-}
-
-static void KernGlyphsPrim2(TrueTypeFont *ttf, sal_uInt16 *glyphs, int nglyphs, int wmode, KernData *kern)
-{
- sal_uInt32 i, j;
- sal_uInt32 gpair;
-
- if( ! nglyphs )
- return;
-
- for (i = 0; i < (sal_uInt32)nglyphs - 1; i++) {
- gpair = (glyphs[i] << 16) | glyphs[i+1];
-#ifdef DEBUG2
- /* All fonts with MS kern table that I've seen so far contain just one kern subtable.
- * MS kern documentation is very poor and I doubt that font developers will be using
- * several subtables. I expect them to be using OpenType tables instead.
- * According to MS documention, format 2 subtables are not supported by Windows and OS/2.
- */
- if (ttf->nkern > 1) {
- fprintf(stderr, "KernGlyphsPrim2: %d kern tables found.\n", ttf->nkern);
- }
-#endif
- for (j = 0; j < ttf->nkern; j++) {
- sal_uInt16 coverage = GetUInt16(ttf->kerntables[j], 4, 1);
- sal_uInt8 *ptr;
- int npairs;
- sal_uInt32 t;
- int l, r, k;
-
- if (! ((coverage & 1) ^ wmode)) continue;
- if ((coverage & 0xFFFE) != 0) {
-#ifdef DEBUG2
- fprintf(stderr, "KernGlyphsPrim2: coverage flags are not supported: %04X.\n", coverage);
-#endif
- continue;
- }
- ptr = ttf->kerntables[j];
- npairs = GetUInt16(ptr, 6, 1);
- ptr += 14;
- l = 0;
- r = npairs;
- do {
- k = (l + r) >> 1;
- t = GetUInt32(ptr, k * 6, 1);
- if (gpair >= t) l = k + 1;
- if (gpair <= t) r = k - 1;
- } while (l <= r);
- if (l - r == 2) {
- if (!wmode) {
- kern[i].x = XUnits(ttf->unitsPerEm, GetInt16(ptr, 4 + (l-1) * 6, 1));
- } else {
- kern[i].y = XUnits(ttf->unitsPerEm, GetInt16(ptr, 4 + (l-1) * 6, 1));
- }
- /* !wmode ? kern[i].x : kern[i].y = GetInt16(ptr, 4 + (l-1) * 6, 1); */
- }
- }
- }
-}
-#endif
-
/*- Public functions */ /*FOLD00*/
int CountTTCFonts(const char* fname)
@@ -1753,10 +1616,6 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
return SF_TTFORMAT;
}
-#ifdef DEBUG2
- fprintf(stderr, "tdoffset: %d\n", tdoffset);
-#endif
-
/* magic number */
t->tag = TTFontClassTag;
@@ -1841,7 +1700,7 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
{
#if OSL_DEBUG_LEVEL > 1
if( t->tables[i] )
- fprintf( stderr, "font file %s has bad table offset %d (tagnum=%d)\n", t->fname, (sal_uInt8*)t->tables[i]-t->ptr, i );
+ fprintf( stderr, "font file %s has bad table offset %" SAL_PRI_PTRDIFFT "d (tagnum=%d)\n", t->fname, (sal_uInt8*)t->tables[i]-t->ptr, i );
#endif
t->tlens[i] = 0;
t->tables[i] = NULL;
@@ -2057,7 +1916,7 @@ int CreateT3FromTTGlyphs(TrueTypeFont *ttf, FILE *outf, const char *fname, /*FO
fprintf(outf, h02, modname, modver, modextra);
fprintf(outf, h09, ttf->psname);
- fprintf(outf, h10);
+ fprintf(outf, "%s", h10);
fprintf(outf, h11, fname);
/* fprintf(outf, h12, 4000000); */
@@ -2072,17 +1931,17 @@ int CreateT3FromTTGlyphs(TrueTypeFont *ttf, FILE *outf, const char *fname, /*FO
*/
fprintf(outf, h17, rtl_crc32(0, ttf->ptr, ttf->fsize), nGlyphs, rtl_crc32(0, glyphArray, nGlyphs * 2), rtl_crc32(0, encoding, nGlyphs));
- fprintf(outf, h13);
+ fprintf(outf, "%s", h13);
fprintf(outf, h14, XUnits(UPEm, GetInt16(table, 36, 1)), XUnits(UPEm, GetInt16(table, 38, 1)), XUnits(UPEm, GetInt16(table, 40, 1)), XUnits(UPEm, GetInt16(table, 42, 1)));
- fprintf(outf, h15);
+ fprintf(outf, "%s", h15);
for (i = 0; i < nGlyphs; i++) {
fprintf(outf, h16, encoding[i], i);
}
fprintf(outf, h30, nGlyphs+1);
- fprintf(outf, h31);
- fprintf(outf, h32);
+ fprintf(outf, "%s", h31);
+ fprintf(outf, "%s", h32);
for (i = 0; i < nGlyphs; i++) {
fprintf(outf, h33, i);
@@ -2130,14 +1989,14 @@ int CreateT3FromTTGlyphs(TrueTypeFont *ttf, FILE *outf, const char *fname, /*FO
}
if (n > 0) fprintf(outf, "\tfill\n"); /* if glyph is not a whitespace character */
- fprintf(outf, h34);
+ fprintf(outf, "%s", h34);
free(pa);
free(path);
}
- fprintf(outf, h35);
+ fprintf(outf, "%s", h35);
- fprintf(outf, h40);
+ fprintf(outf, "%s", h40);
fprintf(outf, h41, fname);
return SF_OK;
@@ -2740,23 +2599,6 @@ void GetTTGlobalFontInfo(TrueTypeFont *ttf, TTGlobalFontInfo *info)
}
}
-#ifdef TEST5
-void KernGlyphs(TrueTypeFont *ttf, sal_uInt16 *glyphs, int nglyphs, int wmode, KernData *kern)
-{
- int i;
-
- if (!nglyphs || !glyphs || !kern) return;
-
- for (i = 0; i < nglyphs-1; i++) kern[i].x = kern[i].y = 0;
-
- switch (ttf->kerntype) {
- case KT_APPLE_NEW: KernGlyphsPrim1(ttf, glyphs, nglyphs, wmode, kern); return;
- case KT_MICROSOFT: KernGlyphsPrim2(ttf, glyphs, nglyphs, wmode, kern); return;
- default: return;
- }
-}
-#endif
-
GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID)
{
const sal_uInt8* glyf = getTable(ttf, O_glyf);
@@ -2861,10 +2703,6 @@ int GetTTNameRecords(TrueTypeFont *ttf, NameRecord **nr)
}
else
{
-#ifdef DEBUG
- fprintf( stderr, "found invalid name record %d with name id %d for file %s\n",
- i, rec[i].nameID, ttf->fname );
-#endif
rec[i].sptr = 0;
rec[i].slen = 0;
}
@@ -2889,471 +2727,54 @@ void DisposeNameRecords(NameRecord* nr, int n)
free(nr);
}
-} // namespace vcl
-
-
-#ifdef TEST1
-/* This example creates a subset of a TrueType font with two encoded characters */
-int main(int ac, char **av)
-{
- TrueTypeFont *fnt;
- int r;
-
- /* Array of Unicode source characters */
- sal_uInt16 chars[2];
-
- /* Encoding vector maps character encoding to the ordinal number
- * of the glyph in the output file */
- sal_uInt8 encoding[2];
-
- /* This array is for glyph IDs that source characters map to */
- sal_uInt16 g[2];
-
-
- if (ac < 2) return 0;
-
- if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
- fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
- return 0;
- }
-
-
- /* We want to create the output file that only contains two Unicode characters:
- * L'a' and L'A' */
-
- chars[0] = L'a';
- chars[1] = L'A';
-
- /* Figure out what glyphs do these characters map in our font */
- MapString(fnt, chars, 2, g);
-
- /* Encode the characters. Value of encoding[i] is the number 0..255 which maps to glyph i of the
- * newly generated font */
- encoding[0] = chars[0];
- encoding[1] = chars[1];
-
-
- /* Generate a subset */
- CreateT3FromTTGlyphs(fnt, stdout, 0, g, encoding, 2, 0);
-
- /* Now call the dtor for the font */
- CloseTTFont(fnt);
- return 0;
-}
-#endif
-
-#ifdef TEST2
-/* This example extracts first 224 glyphs from a TT fonts and encodes them starting at 32 */
-int main(int ac, char **av)
+bool getTTCoverage(
+ boost::dynamic_bitset<sal_uInt32> &rUnicodeRange,
+ boost::dynamic_bitset<sal_uInt32> &rCodePageRange,
+ const unsigned char* pTable, size_t nLength)
{
- TrueTypeFont *fnt;
- int i, r;
-
- /* Array of Unicode source characters */
- sal_uInt16 glyphs[224];
-
- /* Encoding vector maps character encoding to the ordinal number
- * of the glyph in the output file */
- sal_uInt8 encoding[224];
-
-
-
- for (i=0; i<224; i++) {
- glyphs[i] = i;
- encoding[i] = 32 + i;
- }
-
- if (ac < 2) return 0;
-
- if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
- fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
- return 0;
- }
-
-
- /* Encode the characters. Value of encoding[i] is the number 0..255 which maps to glyph i of the
- * newly generated font */
-
- /* Generate a subset */
- CreateT3FromTTGlyphs(fnt, stdout, 0, glyphs, encoding, 224, 0);
-
- /* Now call the dtor for the font */
- CloseTTFont(fnt);
- return 0;
-}
-#endif
-
-#ifdef TEST3
-/* Glyph metrics example */
-int main(int ac, char **av)
-{
- TrueTypeFont *fnt;
- int i, r;
- sal_uInt16 glyphs[224];
- TTSimpleGlyphMetrics *m;
-
- for (i=0; i<224; i++) {
- glyphs[i] = i;
- }
-
- if (ac < 2) return 0;
-
- if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
- fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
- return 0;
- }
-
- if ((m = GetTTSimpleGlyphMetrics(fnt, glyphs, 224, 0)) == 0) {
- printf("Requested metrics is not available\n");
- } else {
- for (i=0; i<224; i++) {
- printf("%d. advWid: %5d, LSBear: %5d\n", i, m[i].adv, m[i].sb);
- }
- }
-
- /* Now call the dtor for the font */
- free(m);
- CloseTTFont(fnt);
- return 0;
-}
-#endif
-
-#ifdef TEST4
-int main(int ac, char **av)
-{
- TrueTypeFont *fnt;
- TTGlobalFontInfo info;
- int i, r;
-
-
- if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
- fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
- return 0;
- }
-
- printf("Font file: %s\n", av[1]);
-
-#ifdef PRINT_KERN
- switch (fnt->kerntype) {
- case KT_MICROSOFT:
- printf("\tkern: MICROSOFT, ntables: %d.", fnt->nkern);
- if (fnt->nkern) {
- printf(" [");
- for (i=0; i<fnt->nkern; i++) {
- printf("%04X ", GetUInt16(fnt->kerntables[i], 4, 1));
- }
- printf("]");
- }
- printf("\n");
- break;
-
- case KT_APPLE_NEW:
- printf("\tkern: APPLE_NEW, ntables: %d.", fnt->nkern);
- if (fnt->nkern) {
- printf(" [");
- for (i=0; i<fnt->nkern; i++) {
- printf("%04X ", GetUInt16(fnt->kerntables[i], 4, 1));
- }
- printf("]");
- }
- printf("\n");
- break;
-
- case KT_NONE:
- printf("\tkern: none.\n");
- break;
-
- default:
- printf("\tkern: unrecoginzed.\n");
- break;
- }
- printf("\n");
-#endif
-
- GetTTGlobalFontInfo(fnt, &info);
- printf("\tfamily name: `%s`\n", info.family);
- printf("\tsubfamily name: `%s`\n", info.subfamily);
- printf("\tpostscript name: `%s`\n", info.psname);
- printf("\tweight: %d\n", info.weight);
- printf("\twidth: %d\n", info.width);
- printf("\tpitch: %d\n", info.pitch);
- printf("\titalic angle: %d\n", info.italicAngle);
- printf("\tbouding box: [%d %d %d %d]\n", info.xMin, info.yMin, info.xMax, info.yMax);
- printf("\tascender: %d\n", info.ascender);
- printf("\tdescender: %d\n", info.descender);
- printf("\tlinegap: %d\n", info.linegap);
- printf("\tvascent: %d\n", info.vascent);
- printf("\tvdescent: %d\n", info.vdescent);
- printf("\ttypoAscender: %d\n", info.typoAscender);
- printf("\ttypoDescender: %d\n", info.typoDescender);
- printf("\ttypoLineGap: %d\n", info.typoLineGap);
- printf("\twinAscent: %d\n", info.winAscent);
- printf("\twinDescent: %d\n", info.winDescent);
- printf("\tUnicode ranges:\n");
- for (i = 0; i < 32; i++) {
- if ((info.ur1 >> i) & 1) {
- printf("\t\t\t%s\n", UnicodeRangeName(i));
- }
- }
- for (i = 0; i < 32; i++) {
- if ((info.ur2 >> i) & 1) {
- printf("\t\t\t%s\n", UnicodeRangeName(i+32));
- }
- }
- for (i = 0; i < 32; i++) {
- if ((info.ur3 >> i) & 1) {
- printf("\t\t\t%s\n", UnicodeRangeName(i+64));
- }
- }
- for (i = 0; i < 32; i++) {
- if ((info.ur4 >> i) & 1) {
- printf("\t\t\t%s\n", UnicodeRangeName(i+96));
- }
- }
-
- CloseTTFont(fnt);
- return 0;
-}
-#endif
-
-#ifdef TEST5
-/* Kerning example */
-int main(int ac, char **av)
-{
- TrueTypeFont *fnt;
- sal_uInt16 g[224];
- KernData d[223];
- int r, i, k = 0;
-
- g[k++] = 11;
- g[k++] = 36;
- g[k++] = 11;
- g[k++] = 98;
- g[k++] = 11;
- g[k++] = 144;
- g[k++] = 41;
- g[k++] = 171;
- g[k++] = 51;
- g[k++] = 15;
-
- if (ac < 2) return 0;
-
- if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
- fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
- return 0;
- }
-
- KernGlyphs(fnt, g, k, 0, d);
-
- for (i = 0; i < k-1; i++) {
- printf("%3d %3d: [%3d %3d]\n", g[i], g[i+1], d[i].x, d[i].y);
- }
-
- CloseTTFont(fnt);
- return 0;
-}
-#endif
-
-
-
-#ifdef TEST6
-/* This example extracts a single glyph from a font */
-int main(int ac, char **av)
-{
- TrueTypeFont *fnt;
- int r, i;
-
- sal_uInt16 glyphs[256];
- sal_uInt8 encoding[256];
-
- for (i=0; i<256; i++) {
- glyphs[i] = 512 + i;
- encoding[i] = i;
- }
-
-#if 0
- i=0;
- glyphs[i++] = 2001;
- glyphs[i++] = 2002;
- glyphs[i++] = 2003;
- glyphs[i++] = 2004;
- glyphs[i++] = 2005;
- glyphs[i++] = 2006;
- glyphs[i++] = 2007;
- glyphs[i++] = 2008;
- glyphs[i++] = 2009;
- glyphs[i++] = 2010;
- glyphs[i++] = 2011;
- glyphs[i++] = 2012;
- glyphs[i++] = 2013;
- glyphs[i++] = 2014;
- glyphs[i++] = 2015;
- glyphs[i++] = 2016;
- glyphs[i++] = 2017;
- glyphs[i++] = 2018;
- glyphs[i++] = 2019;
- glyphs[i++] = 2020;
-
-
- r = 97;
- i = 0;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
- encoding[i++] = r++;
-#endif
-
- if (ac < 2) return 0;
-
- if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
- fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
- return 0;
- }
-
- /* Generate a subset */
- CreateT3FromTTGlyphs(fnt, stdout, 0, glyphs, encoding, 256, 0);
-
- fprintf(stderr, "UnitsPerEm: %d.\n", fnt->unitsPerEm);
-
- /* Now call the dtor for the font */
- CloseTTFont(fnt);
- return 0;
-}
-#endif
-
-#ifdef TEST7
-/* NameRecord extraction example */
-int main(int ac, char **av)
-{
- TrueTypeFont *fnt;
- int r, i, j, n;
- NameRecord *nr;
-
- if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
- fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
- return 0;
- }
-
- if ((n = GetTTNameRecords(fnt, &nr)) == 0) {
- fprintf(stderr, "No name records in the font.\n");
- return 0;
- }
-
- printf("Number of name records: %d.\n", n);
- for (i = 0; i < n; i++) {
- printf("%d %d %04X %d [", nr[i].platformID, nr[i].encodingID, nr[i].languageID, nr[i].nameID);
- for (j=0; j<nr[i].slen; j++) {
- printf("%c", isprint(nr[i].sptr[j]) ? nr[i].sptr[j] : '.');
+ bool bRet = false;
+ sal_uInt16 nVersion = GetUInt16(pTable, 0, 1);
+ // parse OS/2 header
+ if ( nVersion >= 0x0001 && nLength >= 58 )
+ {
+ rUnicodeRange.append(GetUInt32(pTable, 42, 1));
+ rUnicodeRange.append(GetUInt32(pTable, 46, 1));
+ rUnicodeRange.append(GetUInt32(pTable, 50, 1));
+ rUnicodeRange.append(GetUInt32(pTable, 54, 1));
+ bRet = true;
+ if (nLength >= 86)
+ {
+ rCodePageRange.append(GetUInt32(pTable, 78, 1));
+ rCodePageRange.append(GetUInt32(pTable, 82, 1));
}
- printf("]\n");
- }
-
-
- DisposeNameRecords(nr, n);
- CloseTTFont(fnt);
- return 0;
-}
-#endif
-
-#ifdef TEST8
-/* TrueType -> TrueType subsetting */
-int main(int ac, char **av)
-{
- TrueTypeFont *fnt;
- sal_uInt16 glyphArray[] = { 0, 98, 99, 22, 24, 25, 26, 27, 28, 29, 30, 31, 1270, 1289, 34};
- sal_uInt8 encoding[] = {32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46};
- int r;
-
- if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
- fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
- return 0;
}
-
- CreateTTFromTTGlyphs(fnt, "subfont.ttf", glyphArray, encoding, 15, 0, 0, TTCF_AutoName | TTCF_IncludeOS2);
-
-
- CloseTTFont(fnt);
-
- return 0;
+ return bRet;
}
-#endif
-#ifdef TEST9
-/* TrueType -> Type42 subsetting */
-int main(int ac, char **av)
+void getTTScripts(std::vector< sal_uInt32 > &rScriptTags, const unsigned char* pTable, size_t nLength)
{
- TrueTypeFont *fnt;
- /*
- sal_uInt16 glyphArray[] = { 0, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34};
- sal_uInt8 encoding[] = {32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46};
- */
- sal_uInt16 glyphArray[] = { 0, 6711, 6724, 11133, 11144, 14360, 26, 27, 28, 29, 30, 31, 1270, 1289, 34};
- sal_uInt8 encoding[] = {32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46};
- int r;
-
- if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
- fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
- return 0;
- }
-
- CreateT42FromTTGlyphs(fnt, stdout, "testfont", glyphArray, encoding, 15);
-
- CloseTTFont(fnt);
-
- return 0;
-}
-#endif
-
-#ifdef TEST10
-/* Component glyph test */
-int main(int ac, char **av)
-{
- TrueTypeFont *fnt;
- int r, i;
- list glyphlist = listNewEmpty();
-
+ if (nLength < 6)
+ return;
- if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
- fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
- return 0;
- }
+ // parse GSUB/GPOS header
+ const sal_uInt16 nOfsScriptList = GetUInt16(pTable, 4, 1);
- for (i = 0; i < fnt->nglyphs; i++) {
- r = GetTTGlyphComponents(fnt, i, glyphlist);
- if (r > 1) {
- printf("%d -> ", i);
- listToFirst(glyphlist);
- do {
- printf("%d ", (int) listCurrent(glyphlist));
- } while (listNext(glyphlist));
- printf("\n");
- } else {
- printf("%d: single glyph.\n", i);
- }
- listClear(glyphlist);
+ // parse Script Table
+ const sal_uInt16 nCntScript = GetUInt16(pTable, nOfsScriptList, 1);
+ sal_uInt32 nCurrentPos = nOfsScriptList+2;
+ for( sal_uInt16 nScriptIndex = 0;
+ nScriptIndex < nCntScript && nLength >= 6; ++nScriptIndex,
+ nLength-=6 )
+ {
+ sal_uInt32 nTag = GetUInt32(pTable, nCurrentPos, 1);
+ nCurrentPos+=6;
+ rScriptTags.push_back(nTag); // e.g. hani/arab/kana/hang
}
- CloseTTFont(fnt);
- listDispose(glyphlist);
-
- return 0;
+ std::sort(rScriptTags.begin(), rScriptTags.end());
+ rScriptTags.erase(std::unique(rScriptTags.begin(), rScriptTags.end()), rScriptTags.end());
}
-#endif
+} // namespace vcl
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx
index badf9fb496b0..7a785b9bf99f 100644
--- a/vcl/source/fontsubset/ttcr.cxx
+++ b/vcl/source/fontsubset/ttcr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1543,19 +1544,6 @@ static void ProcessTables(TrueTypeCreator *tt)
PutUInt16(maxCompositePoints, pMaxpData, 10, 1);
PutUInt16(maxCompositeContours, pMaxpData, 12, 1);
-#if 0
- /* XXX do not overwrite the existing data. Fix: re-calculate these numbers here */
- PutUInt16(2, maxp->data, 14, 1); /* maxZones is always 2 */
- PutUInt16(0, maxp->data, 16, 1); /* maxTwilightPoints */
- PutUInt16(0, maxp->data, 18, 1); /* maxStorage */
- PutUInt16(0, maxp->data, 20, 1); /* maxFunctionDefs */
- PutUint16(0, maxp->data, 22, 1); /* maxInstructionDefs */
- PutUint16(0, maxp->data, 24, 1); /* maxStackElements */
- PutUint16(0, maxp->data, 26, 1); /* maxSizeOfInstructions */
- PutUint16(0, maxp->data, 28, 1); /* maxComponentElements */
- PutUint16(0, maxp->data, 30, 1); /* maxComponentDepth */
-#endif
-
/*
* Generate an htmx table and update hhea table
*/
@@ -1664,3 +1652,5 @@ int main(void)
return 0;
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/fontsubset/ttcr.hxx b/vcl/source/fontsubset/ttcr.hxx
index 69583ecdbdda..b2beb0549174 100644
--- a/vcl/source/fontsubset/ttcr.hxx
+++ b/vcl/source/fontsubset/ttcr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -259,3 +260,5 @@ extern "C"
}
#endif /* __TTCR_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/fontsubset/xlat.cxx b/vcl/source/fontsubset/xlat.cxx
index 108c69cee8c7..1df7a5a2fdde 100644
--- a/vcl/source/fontsubset/xlat.cxx
+++ b/vcl/source/fontsubset/xlat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -219,3 +220,4 @@ void TranslateString16(sal_uInt16 *src, sal_uInt16 *dst, sal_uInt32 n)
} // namespace vcl
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/fontsubset/xlat.hxx b/vcl/source/fontsubset/xlat.hxx
index 5960336e13e3..3d8622bf9ae7 100644
--- a/vcl/source/fontsubset/xlat.hxx
+++ b/vcl/source/fontsubset/xlat.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,3 +53,4 @@ namespace vcl
#endif /* __XLAT_H */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/alpha.cxx b/vcl/source/gdi/alpha.cxx
index 21c3f15f51c0..6107affaf4e9 100644
--- a/vcl/source/gdi/alpha.cxx
+++ b/vcl/source/gdi/alpha.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -432,3 +433,5 @@ void AlphaMask::ReleaseAccess( BitmapReadAccess* pAccess )
Bitmap::Convert( BMP_CONVERSION_8BIT_GREYS );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index 9fc45f2f61d6..63d0010bd5d2 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -937,3 +938,5 @@ SvStream& operator>>( SvStream& rIStm, Animation& rAnimation )
return rIStm;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/base14.cxx b/vcl/source/gdi/base14.cxx
index 83820bc654bf..9912b3e91509 100644
--- a/vcl/source/gdi/base14.cxx
+++ b/vcl/source/gdi/base14.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,7 +33,9 @@
#include <rtl/strbuf.hxx>
using namespace vcl;
-using namespace rtl;
+
+using ::rtl::OString;
+using ::rtl::OStringBuffer;
OString PDFWriterImpl::BuiltinFont::getNameObject() const
{
@@ -685,3 +688,4 @@ const PDFWriterImpl::BuiltinFont PDFWriterImpl::m_aBuiltinFonts[ 14 ] = {
};
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index 8d831961f8af..a0b48f4ee124 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,9 +36,7 @@
#include <vcl/outdev.hxx>
#include <vcl/impbmp.hxx>
#include <vcl/salbmp.hxx>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/bitmap.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/svapp.hxx>
@@ -222,7 +221,7 @@ const BitmapPalette& Bitmap::GetGreyPalette( int nEntries )
}
else
{
- DBG_ERROR( "Bitmap::GetGreyPalette: invalid entry count (2/4/16/256 allowed)" );
+ OSL_FAIL( "Bitmap::GetGreyPalette: invalid entry count (2/4/16/256 allowed)" );
return aGreyPalette2;
}
}
@@ -1744,38 +1743,6 @@ Bitmap Bitmap::CreateDisplayBitmap( OutputDevice* pDisplay )
// ------------------------------------------------------------------
-Bitmap Bitmap::GetColorTransformedBitmap( BmpColorMode eColorMode ) const
-{
- Bitmap aRet;
-
- if( BMP_COLOR_HIGHCONTRAST == eColorMode )
- {
- Color* pSrcColors = NULL;
- Color* pDstColors = NULL;
- sal_uLong nColorCount = 0;
-
- aRet = *this;
-
- Image::GetColorTransformArrays( (ImageColorTransform) eColorMode, pSrcColors, pDstColors, nColorCount );
-
- if( nColorCount && pSrcColors && pDstColors )
- aRet.Replace( pSrcColors, pDstColors, nColorCount );
-
- delete[] pSrcColors;
- delete[] pDstColors;
- }
- else if( BMP_COLOR_MONOCHROME_BLACK == eColorMode ||
- BMP_COLOR_MONOCHROME_WHITE == eColorMode )
- {
- aRet = *this;
- aRet.MakeMono( BMP_COLOR_MONOCHROME_THRESHOLD );
- }
-
- return aRet;
-}
-
-// ------------------------------------------------------------------
-
sal_Bool Bitmap::CombineSimple( const Bitmap& rMask, BmpCombine eCombine )
{
BitmapReadAccess* pMaskAcc = ( (Bitmap&) rMask ).AcquireReadAccess();
@@ -1970,3 +1937,5 @@ bool Bitmap::GetSystemData( BitmapSystemData& rData ) const
return bRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/bitmap2.cxx b/vcl/source/gdi/bitmap2.cxx
index 8dffa7d59a2c..9db334395e23 100644
--- a/vcl/source/gdi/bitmap2.cxx
+++ b/vcl/source/gdi/bitmap2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include "precompiled_vcl.hxx"
#include <tools/zcodec.hxx>
-#ifndef _TOOLS_STREAM_HXX
#include <tools/stream.hxx>
-#endif
#include <vcl/salbtype.hxx>
#include <vcl/bmpacc.hxx>
#include <vcl/outdev.hxx>
@@ -46,6 +45,8 @@
#define DIBCOREHEADERSIZE ( 12UL )
#define DIBINFOHEADERSIZE ( sizeof( DIBInfoHeader ) )
+#define BITMAPINFOHEADER 0x28
+
#define SETPIXEL4( pBuf, nX, cChar )( (pBuf)[ (nX) >> 1 ] |= ( (nX) & 1 ) ? ( cChar ): (cChar) << 4 );
// ----------------------
@@ -129,7 +130,7 @@ SvStream& operator<<( SvStream& rOStm, const Bitmap& rBitmap )
// ------------------------------------------------------------------
-sal_Bool Bitmap::Read( SvStream& rIStm, sal_Bool bFileHeader )
+sal_Bool Bitmap::Read( SvStream& rIStm, sal_Bool bFileHeader, sal_Bool bIsMSOFormat )
{
const sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
const sal_uLong nOldPos = rIStm.Tell();
@@ -144,7 +145,7 @@ sal_Bool Bitmap::Read( SvStream& rIStm, sal_Bool bFileHeader )
bRet = ImplReadDIB( rIStm, *this, nOffset );
}
else
- bRet = ImplReadDIB( rIStm, *this, nOffset );
+ bRet = ImplReadDIB( rIStm, *this, nOffset, bIsMSOFormat );
if( !bRet )
{
@@ -161,18 +162,18 @@ sal_Bool Bitmap::Read( SvStream& rIStm, sal_Bool bFileHeader )
// ------------------------------------------------------------------
-sal_Bool Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, sal_uLong nOffset )
+sal_Bool Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, sal_uLong nOffset, sal_Bool bIsMSOFormat )
{
DIBInfoHeader aHeader;
const sal_uLong nStmPos = rIStm.Tell();
sal_Bool bRet = sal_False;
sal_Bool bTopDown = sal_False;
- if( ImplReadDIBInfoHeader( rIStm, aHeader, bTopDown ) && aHeader.nWidth && aHeader.nHeight && aHeader.nBitCount )
+ if( ImplReadDIBInfoHeader( rIStm, aHeader, bTopDown, bIsMSOFormat ) && aHeader.nWidth && aHeader.nHeight && aHeader.nBitCount )
{
const sal_uInt16 nBitCount( discretizeBitcount(aHeader.nBitCount) );
- const Size aSizePixel( aHeader.nWidth, aHeader.nHeight );
+ const Size aSizePixel( aHeader.nWidth, abs(aHeader.nHeight) );
BitmapPalette aDummyPal;
Bitmap aNewBmp( aSizePixel, nBitCount, &aDummyPal );
BitmapWriteAccess* pAcc = aNewBmp.AcquireWriteAccess();
@@ -215,7 +216,8 @@ sal_Bool Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, sal_uLong nOffset )
// set decoded bytes to memory stream,
// from which we will read the bitmap data
- pIStm = pMemStm = new SvMemoryStream;
+ pMemStm = new SvMemoryStream;
+ pIStm = pMemStm;
pMemStm->SetBuffer( (char*) pData, nUncodedSize, sal_False, nUncodedSize );
nOffset = 0;
}
@@ -244,7 +246,7 @@ sal_Bool Bitmap::ImplReadDIB( SvStream& rIStm, Bitmap& rBmp, sal_uLong nOffset )
Fraction( 1000, aHeader.nYPelsPerMeter ) );
aNewBmp.SetPrefMapMode( aMapMode );
- aNewBmp.SetPrefSize( Size( aHeader.nWidth, aHeader.nHeight ) );
+ aNewBmp.SetPrefSize( Size( aHeader.nWidth, abs(aHeader.nHeight) ) );
}
}
@@ -299,21 +301,37 @@ sal_Bool Bitmap::ImplReadDIBFileHeader( SvStream& rIStm, sal_uLong& rOffset )
// ------------------------------------------------------------------
-sal_Bool Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown )
+sal_Bool Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader, sal_Bool& bTopDown, sal_Bool bIsMSOFormat )
{
// BITMAPINFOHEADER or BITMAPCOREHEADER
rIStm >> rHeader.nSize;
// BITMAPCOREHEADER
+ sal_Int16 nTmp16 = 0;
if ( rHeader.nSize == DIBCOREHEADERSIZE )
{
- sal_Int16 nTmp16;
rIStm >> nTmp16; rHeader.nWidth = nTmp16;
rIStm >> nTmp16; rHeader.nHeight = nTmp16;
rIStm >> rHeader.nPlanes;
rIStm >> rHeader.nBitCount;
}
+ else if ( bIsMSOFormat && ( rHeader.nSize == BITMAPINFOHEADER ) )
+ {
+ sal_uInt8 nTmp8 = 0;
+ rIStm >> nTmp16; rHeader.nWidth = nTmp16;
+ rIStm >> nTmp16; rHeader.nHeight = nTmp16;
+ rIStm >> nTmp8; rHeader.nPlanes = nTmp8;
+ rIStm >> nTmp8; rHeader.nBitCount = nTmp8;
+ rIStm >> nTmp16; rHeader.nSizeImage = nTmp16;
+ rIStm >> nTmp16; rHeader.nCompression = nTmp16;
+ if ( !rHeader.nSizeImage ) // uncompressed?
+ rHeader.nSizeImage = ((rHeader.nWidth * rHeader.nBitCount + 31) & ~31) / 8 * rHeader.nHeight;
+ rIStm >> rHeader.nXPelsPerMeter;
+ rIStm >> rHeader.nYPelsPerMeter;
+ rIStm >> rHeader.nColsUsed;
+ rIStm >> rHeader.nColsImportant;
+ }
else
{
// unknown Header
@@ -365,7 +383,7 @@ sal_Bool Bitmap::ImplReadDIBInfoHeader( SvStream& rIStm, DIBInfoHeader& rHeader,
else
{
rIStm >> rHeader.nWidth;
- rIStm >> rHeader.nHeight;
+ rIStm >> rHeader.nHeight; //rHeader.nHeight=abs(rHeader.nHeight);
rIStm >> rHeader.nPlanes;
rIStm >> rHeader.nBitCount;
rIStm >> rHeader.nCompression;
@@ -461,7 +479,13 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, Bitma
if( rHeader.nColsUsed && rHeader.nBitCount > 8 )
rIStm.SeekRel( rHeader.nColsUsed * ( ( rHeader.nSize != DIBCOREHEADERSIZE ) ? 4 : 3 ) );
- rIStm.Read( rAcc.GetBuffer(), rHeader.nHeight * nAlignedWidth );
+ if ( rHeader.nHeight > 0 )
+ rIStm.Read( rAcc.GetBuffer(), rHeader.nHeight * nAlignedWidth );
+ else
+ {
+ for( int i = abs(rHeader.nHeight)-1; i >= 0; i-- )
+ rIStm.Read( ((char*)rAcc.GetBuffer()) + (nAlignedWidth*i), nAlignedWidth );
+ }
}
else
{
@@ -504,7 +528,7 @@ sal_Bool Bitmap::ImplReadDIBBits( SvStream& rIStm, DIBInfoHeader& rHeader, Bitma
else
{
const long nWidth = rHeader.nWidth;
- const long nHeight = rHeader.nHeight;
+ const long nHeight = abs(rHeader.nHeight);
sal_uInt8* pBuf = new sal_uInt8[ nAlignedWidth ];
// true color DIB's can have a (optimization) palette
@@ -1061,7 +1085,7 @@ void Bitmap::ImplDecodeRLE( sal_uInt8* pBuffer, DIBInfoHeader& rHeader,
BitmapWriteAccess& rAcc, sal_Bool bRLE4 )
{
Scanline pRLE = pBuffer;
- long nY = rHeader.nHeight - 1L;
+ long nY = abs(rHeader.nHeight) - 1L;
const sal_uLong nWidth = rAcc.Width();
sal_uLong nCountByte;
sal_uLong nRunByte;
@@ -1275,3 +1299,5 @@ sal_Bool Bitmap::ImplWriteRLE( SvStream& rOStm, BitmapReadAccess& rAcc, sal_Bool
return( rOStm.GetError() == 0UL );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index 4905646d3563..c2d929ea4fa0 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -353,7 +354,7 @@ sal_Bool Bitmap::Convert( BmpConversion eConversion )
break;
default:
- DBG_ERROR( "Bitmap::Convert(): Unsupported conversion" );
+ OSL_FAIL( "Bitmap::Convert(): Unsupported conversion" );
break;
}
@@ -965,10 +966,11 @@ sal_Bool Bitmap::ImplScaleFast( const double& rScaleX, const double& rScaleY )
const long nHeight = pReadAcc->Height();
long* pLutX = new long[ nNewWidth ];
long* pLutY = new long[ nNewHeight ];
- long nX, nY, nMapY, nActY = 0L;
if( nNewWidth1 && nNewHeight1 )
{
+ long nX, nY, nMapY, nActY = 0L;
+
for( nX = 0L; nX < nNewWidth; nX++ )
pLutX[ nX ] = nX * nWidth / nNewWidth;
@@ -1839,7 +1841,7 @@ sal_Bool Bitmap::ImplReduceMedian( sal_uInt16 nColCount )
nBitCount = 8;
else
{
- DBG_ERROR( "Bitmap::ImplReduceMedian(): invalid color count!" );
+ OSL_FAIL( "Bitmap::ImplReduceMedian(): invalid color count!" );
nBitCount = 8;
nColCount = 256;
}
@@ -2201,3 +2203,5 @@ sal_Bool Bitmap::Adjust( short nLuminancePercent, short nContrastPercent,
return bRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/bitmap4.cxx b/vcl/source/gdi/bitmap4.cxx
index 5fe9139ea35e..1166f6cc0931 100644
--- a/vcl/source/gdi/bitmap4.cxx
+++ b/vcl/source/gdi/bitmap4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,6 @@
#include "precompiled_vcl.hxx"
#include <stdlib.h>
-#include <vos/macros.hxx>
#include <vcl/bmpacc.hxx>
#include <vcl/bitmap.hxx>
@@ -98,7 +98,7 @@ sal_Bool Bitmap::Filter( BmpFilter eFilter, const BmpFilterParam* pFilterParam,
break;
default:
- DBG_ERROR( "Bitmap::Convert(): Unsupported filter" );
+ OSL_FAIL( "Bitmap::Convert(): Unsupported filter" );
break;
}
@@ -474,7 +474,7 @@ sal_Bool Bitmap::ImplSobelGrey( const BmpFilterParam* /*pFilterParam*/, const Li
nSum2 += nMask332 * nGrey33;
nSum1 = (long) sqrt( (double)( nSum1 * nSum1 + nSum2 * nSum2 ) );
- aGrey.SetIndex( ~(sal_uInt8) VOS_BOUND( nSum1, 0, 255 ) );
+ aGrey.SetIndex( ~(sal_uInt8) SAL_BOUND( nSum1, 0, 255 ) );
pWriteAcc->SetPixel( nY, nX, aGrey );
if( nX < ( nWidth - 1 ) )
@@ -549,7 +549,7 @@ sal_Bool Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link*
const long nLz = FRound( sin( fElev ) * 255.0 );
const long nZ2 = ( ( 6 * 255 ) / 4 ) * ( ( 6 * 255 ) / 4 );
const long nNzLz = ( ( 6 * 255 ) / 4 ) * nLz;
- const sal_uInt8 cLz = (sal_uInt8) VOS_BOUND( nLz, 0, 255 );
+ const sal_uInt8 cLz = (sal_uInt8) SAL_BOUND( nLz, 0, 255 );
// fill mapping tables
pHMap[ 0 ] = 0;
@@ -586,7 +586,7 @@ sal_Bool Bitmap::ImplEmbossGrey( const BmpFilterParam* pFilterParam, const Link*
else
{
const double fGrey = nDotL / sqrt( (double)(nNx * nNx + nNy * nNy + nZ2) );
- aGrey.SetIndex( (sal_uInt8) VOS_BOUND( fGrey, 0, 255 ) );
+ aGrey.SetIndex( (sal_uInt8) SAL_BOUND( fGrey, 0, 255 ) );
}
pWriteAcc->SetPixel( nY, nX, aGrey );
@@ -687,7 +687,7 @@ sal_Bool Bitmap::ImplSepia( const BmpFilterParam* pFilterParam, const Link* /*pP
{
long nSepiaPercent = ( pFilterParam && pFilterParam->meFilter == BMP_FILTER_SEPIA ) ?
pFilterParam->mcSolarGreyThreshold : 10;
- const long nSepia = 10000 - 100 * VOS_BOUND( nSepiaPercent, 0, 100 );
+ const long nSepia = 10000 - 100 * SAL_BOUND( nSepiaPercent, 0, 100 );
BitmapPalette aSepiaPal( 256 );
DBG_ASSERT( nSepiaPercent <= 100, "Bitmap::ImplSepia(): sepia value out of range; defaulting to 100%" );
@@ -1007,3 +1007,5 @@ sal_Bool Bitmap::ImplPopArt( const BmpFilterParam* /*pFilterParam*/, const Link*
return bRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index abee1ed9bf67..dd7b64f1abd6 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,14 +38,11 @@
#include <vcl/image.h>
#include <vcl/bitmapex.hxx>
#include <vcl/pngread.hxx>
-#ifndef _SV_IMPIMAGETREE_H
#include <vcl/impimagetree.hxx>
-#endif
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/svapp.hxx>
#include <vcl/bmpacc.hxx>
+#include <vcl/virdev.hxx>
// ------------
// - BitmapEx -
@@ -106,7 +104,7 @@ BitmapEx::BitmapEx( const ResId& rResId ) :
const String aFileName( pResMgr->ReadString() );
::rtl::OUString aCurrentSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyleName();
- if( !aImageTree->loadImage( aFileName, aCurrentSymbolsStyle, *this ) )
+ if( !aImageTree->loadImage( aFileName, aCurrentSymbolsStyle, *this, true ) )
{
#ifdef DBG_UTIL
ByteString aErrorStr( "BitmapEx::BitmapEx( const ResId& rResId ): could not load image <" );
@@ -300,36 +298,6 @@ Bitmap BitmapEx::GetBitmap( const Color* pTransReplaceColor ) const
// ------------------------------------------------------------------
-BitmapEx BitmapEx::GetColorTransformedBitmapEx( BmpColorMode eColorMode ) const
-{
- BitmapEx aRet;
-
- if( BMP_COLOR_HIGHCONTRAST == eColorMode )
- {
- aRet = *this;
- aRet.aBitmap = aBitmap.GetColorTransformedBitmap( eColorMode );
- }
- else if( BMP_COLOR_MONOCHROME_BLACK == eColorMode ||
- BMP_COLOR_MONOCHROME_WHITE == eColorMode )
- {
- aRet = *this;
- aRet.aBitmap = aRet.aBitmap.GetColorTransformedBitmap( eColorMode );
-
- if( !aRet.aMask.IsEmpty() )
- {
- aRet.aMask.CombineSimple( aRet.aBitmap, BMP_COMBINE_OR );
- aRet.aBitmap.Erase( ( BMP_COLOR_MONOCHROME_BLACK == eColorMode ) ? COL_BLACK : COL_WHITE );
-
- DBG_ASSERT( aRet.aBitmap.GetSizePixel() == aRet.aMask.GetSizePixel(),
- "BitmapEx::GetColorTransformedBitmapEx(): size mismatch for bitmap and alpha mask." );
- }
- }
-
- return aRet;
-}
-
-// ------------------------------------------------------------------
-
Bitmap BitmapEx::GetMask() const
{
Bitmap aRet( aMask );
@@ -757,6 +725,60 @@ void BitmapEx::Draw( OutputDevice* pOutDev,
pOutDev->DrawBitmapEx( rDestPt, rDestSize, rSrcPtPixel, rSrcSizePixel, *this );
}
+BitmapEx BitmapEx:: AutoScaleBitmap(BitmapEx & aBitmap, const long aStandardSize)
+{
+ Point aEmptyPoint(0,0);
+ sal_Int32 imgNewWidth = 0;
+ sal_Int32 imgNewHeight = 0;
+ double imgposX = 0;
+ double imgposY = 0;
+ BitmapEx aRet = aBitmap;
+ double imgOldWidth = aRet.GetSizePixel().Width();
+ double imgOldHeight =aRet.GetSizePixel().Height();
+
+ Size aScaledSize;
+ if (imgOldWidth >= aStandardSize || imgOldHeight >= aStandardSize)
+ {
+ if (imgOldWidth >= imgOldHeight)
+ {
+ imgNewWidth = aStandardSize;
+ imgNewHeight = sal_Int32(imgOldHeight / (imgOldWidth / aStandardSize) + 0.5);
+ imgposX = 0;
+ imgposY = (aStandardSize - (imgOldHeight / (imgOldWidth / aStandardSize) + 0.5)) / 2 + 0.5;
+ }
+ else
+ {
+ imgNewHeight = aStandardSize;
+ imgNewWidth = sal_Int32(imgOldWidth / (imgOldHeight / aStandardSize) + 0.5);
+ imgposY = 0;
+ imgposX = (aStandardSize - (imgOldWidth / (imgOldHeight / aStandardSize) + 0.5)) / 2 + 0.5;
+ }
+
+ aScaledSize = Size( imgNewWidth, imgNewHeight );
+ aRet.Scale( aScaledSize, BMP_SCALE_INTERPOLATE );
+ }
+ else
+ {
+ imgposX = (aStandardSize - imgOldWidth) / 2 + 0.5;
+ imgposY = (aStandardSize - imgOldHeight) / 2 + 0.5;
+ }
+
+ Size aStdSize( aStandardSize, aStandardSize );
+ Rectangle aRect(aEmptyPoint, aStdSize );
+
+ VirtualDevice aVirDevice( *Application::GetDefaultDevice(), 0, 1 );
+ aVirDevice.SetOutputSizePixel( aStdSize );
+ aVirDevice.SetFillColor( COL_TRANSPARENT );
+ aVirDevice.SetLineColor( COL_TRANSPARENT );
+
+ //draw a rect into virDevice
+ aVirDevice.DrawRect( aRect );
+ Point aPointPixel( (long)imgposX, (long)imgposY );
+ aVirDevice.DrawBitmapEx( aPointPixel, aRet );
+ aRet = aVirDevice.GetBitmapEx( aEmptyPoint, aStdSize );
+
+ return aRet;
+}
// ------------------------------------------------------------------
sal_uInt8 BitmapEx::GetTransparency(sal_Int32 nX, sal_Int32 nY) const
@@ -912,3 +934,5 @@ SvStream& operator>>( SvStream& rIStm, BitmapEx& rBitmapEx )
return rIStm;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/bmpacc.cxx b/vcl/source/gdi/bmpacc.cxx
index 1c7b41b51de6..0762821c3267 100644
--- a/vcl/source/gdi/bmpacc.cxx
+++ b/vcl/source/gdi/bmpacc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -249,7 +250,7 @@ void BitmapReadAccess::ImplZeroInitUnusedBits()
default:
{
- DBG_ERROR( "BitmapWriteAccess::ZeroInitUnusedBits: Unsupported pixel format");
+ OSL_FAIL( "BitmapWriteAccess::ZeroInitUnusedBits: Unsupported pixel format");
nBits = 0;
bMsb = true;
}
@@ -445,3 +446,5 @@ void BitmapWriteAccess::CopyBuffer( const BitmapReadAccess& rReadAcc )
for( long nY = 0L, nHeight = Min( mpBuffer->mnHeight, rReadAcc.Height() ); nY < nHeight; nY++ )
CopyScanline( nY, rReadAcc );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/bmpacc2.cxx b/vcl/source/gdi/bmpacc2.cxx
index ae0eade2381b..718bd56cdb0c 100644
--- a/vcl/source/gdi/bmpacc2.cxx
+++ b/vcl/source/gdi/bmpacc2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -329,3 +330,5 @@ IMPL_FORMAT_SETPIXEL( _32BIT_TC_MASK )
{
rMask.SetColorFor32Bit( rBitmapColor, pScanline + ( nX << 2UL ) );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/bmpacc3.cxx b/vcl/source/gdi/bmpacc3.cxx
index ac2e09df832f..5e87d680e9c0 100644
--- a/vcl/source/gdi/bmpacc3.cxx
+++ b/vcl/source/gdi/bmpacc3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -408,3 +409,5 @@ void BitmapWriteAccess::DrawPolyPolygon( const PolyPolygon& rPolyPoly )
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/bmpconv.cxx b/vcl/source/gdi/bmpconv.cxx
index 789c8377318d..886055817312 100644
--- a/vcl/source/gdi/bmpconv.cxx
+++ b/vcl/source/gdi/bmpconv.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +32,7 @@
#include "vcl/bitmap.hxx"
#include "vcl/svapp.hxx"
#include "vcl/salctype.hxx"
-#include "vos/mutex.hxx"
+#include <osl/mutex.hxx>
#include "tools/stream.hxx"
#include "com/sun/star/script/XInvocation.hpp"
#include "com/sun/star/awt/XBitmap.hpp"
@@ -43,7 +44,8 @@ using namespace com::sun::star::script;
using namespace com::sun::star::beans;
using namespace com::sun::star::reflection;
using namespace com::sun::star::awt;
-using namespace rtl;
+
+using ::rtl::OUString;
namespace vcl {
@@ -118,7 +120,7 @@ Any SAL_CALL BmpConverter::getValue( const OUString& ) throw( UnknownPropertyExc
sal_Bool SAL_CALL BmpConverter::hasMethod( const OUString& rName ) throw()
{
- return rName.equalsIgnoreAsciiCase( OUString::createFromAscii( "convert-bitmap-depth" ) );
+ return rName.equalsIgnoreAsciiCase( OUString(RTL_CONSTASCII_USTRINGPARAM("convert-bitmap-depth")) );
}
sal_Bool SAL_CALL BmpConverter::hasProperty( const OUString& ) throw()
@@ -135,7 +137,7 @@ Any SAL_CALL BmpConverter::invoke(
{
Any aRet;
- if( rFunction.equalsIgnoreAsciiCase( OUString::createFromAscii( "convert-bitmap-depth" ) ) )
+ if( rFunction.equalsIgnoreAsciiCase( OUString(RTL_CONSTASCII_USTRINGPARAM("convert-bitmap-depth")) ) )
{
Reference< XBitmap > xBM;
sal_uInt16 nTargetDepth = 0;
@@ -149,7 +151,7 @@ Any SAL_CALL BmpConverter::invoke(
Sequence< sal_Int8 > aDIB = xBM->getDIB();
// call into vcl not thread safe
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
SvMemoryStream aStream( aDIB.getArray(), aDIB.getLength(), STREAM_READ | STREAM_WRITE );
Bitmap aBM;
@@ -211,3 +213,5 @@ Sequence< sal_Int8 > SAL_CALL BmpTransporter::getMaskDIB() throw()
{
return Sequence< sal_Int8 >();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/bmpfast.cxx b/vcl/source/gdi/bmpfast.cxx
index ac3a80612fe5..8fc5188c9204 100644
--- a/vcl/source/gdi/bmpfast.cxx
+++ b/vcl/source/gdi/bmpfast.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -251,63 +252,6 @@ class TrueColorPixelPtr<BMP_FORMAT_8BIT_PAL>
: public TrueColorPixelPtr<BMP_FORMAT_8BIT_TC_MASK>
{};
-#if 0
-template <>
-class TrueColorPixelPtr<BMP_FORMAT_24BIT_TC_MASK> : public BasePixelPtr
-{
-public:
- void operator++() { mpPixel += 3; }
-
- unsigned GetAlpha() const
- {
- unsigned nAlpha = mpPixel[0];
- nAlpha |= mpPixel[1] << 8U;
- nAlpha |= mpPixel[2] << 16U;
- return nAlpha;
- }
-
- void SetAlpha( unsigned nAlpha ) const
- {
- mpPixel[0] = nAlpha;
- mpPixel[1] = nAlpha >> 8U;
- mpPixel[2] = nAlpha >> 16U;
- }
-};
-
-template <>
-class TrueColorPixelPtr<BMP_FORMAT_32BIT_TC_MASK> : public BasePixelPtr
-{
-public:
- void operator++() { mpPixel += 4; }
-
- unsigned GetAlpha() const
- {
-#ifdef OSL_BIGENDIAN
- unsigned nAlpha = *reinterpret_cast<unsigned*>( mpPixel );
-#else
- unsigned nAlpha = mpPixel[0];
- nAlpha |= mpPixel[1] << 8U;
- nAlpha |= mpPixel[2] << 16U;
- nAlpha |= mpPixel[3] << 24U;
-#endif
- return nAlpha;
- }
-
- void SetAlpha( unsigned nAlpha ) const
- {
-#ifdef OSL_BIGENDIAN
- *reinterpret_cast<unsigned*>( mpPixel ) = nAlpha;
-#else
- mpPixel[0] = nAlpha;
- mpPixel[1] = nAlpha >> 8U;
- mpPixel[2] = nAlpha >> 16U;
- mpPixel[3] = nAlpha >> 24U;
-#endif
- }
-};
-
-#endif
-
// =======================================================================
// converting truecolor formats
@@ -1038,3 +982,5 @@ bool ImplFastEraseBitmap( BitmapBuffer&, const BitmapColor& )
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/configsettings.cxx b/vcl/source/gdi/configsettings.cxx
index b11b9ab822f4..ff701ab640fa 100644
--- a/vcl/source/gdi/configsettings.cxx
+++ b/vcl/source/gdi/configsettings.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,7 +35,6 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
-using namespace rtl;
using namespace utl;
using namespace vcl;
using namespace com::sun::star::uno;
@@ -42,6 +42,8 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::container;
+using ::rtl::OUString;
+
#define SETTINGS_CONFIGNODE "VCL/Settings"
/*
@@ -88,7 +90,7 @@ void SettingsConfigItem::Commit()
if( ! IsValidConfigMgr() )
return;
- std::hash_map< OUString, SmallOUStrMap, rtl::OUStringHash >::const_iterator group;
+ boost::unordered_map< OUString, SmallOUStrMap, rtl::OUStringHash >::const_iterator group;
for( group = m_aSettings.begin(); group != m_aSettings.end(); ++group )
{
@@ -133,12 +135,11 @@ void SettingsConfigItem::getValues()
m_aSettings.clear();
Sequence< OUString > aNames( GetNodeNames( OUString() ) );
- m_aSettings.resize( aNames.getLength() );
for( int j = 0; j < aNames.getLength(); j++ )
{
#if OSL_DEBUG_LEVEL > 2
- fprintf( stderr, "found settings data for \"%s\"\n",
+ OSL_TRACE( "found settings data for \"%s\"\n",
OUStringToOString( aNames.getConstArray()[j], RTL_TEXTENCODING_ASCII_US ).getStr()
);
#endif
@@ -164,7 +165,7 @@ void SettingsConfigItem::getValues()
if( pLine->getLength() )
m_aSettings[ aKeyName ][ pFrom[i] ] = *pLine;
#if OSL_DEBUG_LEVEL > 2
- fprintf( stderr, " \"%s\"=\"%.30s\"\n",
+ OSL_TRACE( " \"%s\"=\"%.30s\"\n",
OUStringToOString( aKeys.getConstArray()[i], RTL_TEXTENCODING_ASCII_US ).getStr(),
OUStringToOString( *pLine, RTL_TEXTENCODING_ASCII_US ).getStr()
);
@@ -180,7 +181,7 @@ void SettingsConfigItem::getValues()
const OUString& SettingsConfigItem::getValue( const OUString& rGroup, const OUString& rKey ) const
{
- ::std::hash_map< OUString, SmallOUStrMap, rtl::OUStringHash >::const_iterator group = m_aSettings.find( rGroup );
+ ::boost::unordered_map< OUString, SmallOUStrMap, rtl::OUStringHash >::const_iterator group = m_aSettings.find( rGroup );
if( group == m_aSettings.end() || group->second.find( rKey ) == group->second.end() )
{
static OUString aEmpty;
@@ -203,3 +204,4 @@ void SettingsConfigItem::setValue( const OUString& rGroup, const OUString& rKey,
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/cvtgrf.cxx b/vcl/source/gdi/cvtgrf.cxx
index 3f95f56315f6..261781ebcf50 100644
--- a/vcl/source/gdi/cvtgrf.cxx
+++ b/vcl/source/gdi/cvtgrf.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/metaact.hxx>
#include <vcl/salinst.hxx>
#include <vcl/svdata.hxx>
@@ -173,3 +172,5 @@ sal_uLong GraphicConverter::Export( SvStream& rOStm, const Graphic& rGraphic, sa
return nRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index 7a6dd74db2c5..2329a9673d23 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -942,7 +943,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
}
#ifdef DBG_UTIL
else
- DBG_ERROR("More than one DX array element missing on SVM import");
+ OSL_FAIL("More than one DX array element missing on SVM import");
#endif
}
}
@@ -1379,7 +1380,6 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf )
{
- sal_uLong nPos;
sal_uLong nCountPos;
Font aSaveFont;
const sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
@@ -1394,7 +1394,6 @@ void SVMConverter::ImplConvertToSVM1( SvStream& rOStm, GDIMetaFile& rMtf )
//MagicCode schreiben
rOStm << "SVGDI"; // Kennung
- nPos = rOStm.Tell();
rOStm << (sal_Int16) 42; // HeaderSize
rOStm << (sal_Int16) 200; // VERSION
rOStm << (sal_Int32) aPrefSize.Width();
@@ -2363,11 +2362,6 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
}
break;
-#if 0
- case( META_OVERLINECOLOR_ACTION ):
- break;
-#endif
-
case( META_TEXTLINE_ACTION ):
{
const MetaTextLineAction* pA = (MetaTextLineAction*) pAction;
@@ -2514,3 +2508,5 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
return nCount;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/extoutdevdata.cxx b/vcl/source/gdi/extoutdevdata.cxx
index eebd6b35765b..2b8ad0fb9ae6 100644
--- a/vcl/source/gdi/extoutdevdata.cxx
+++ b/vcl/source/gdi/extoutdevdata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,3 +40,5 @@ ExtOutDevData::~ExtOutDevData()
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index 4a3a2f265374..2a10563441fa 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,6 +38,7 @@
#include "vcl/impfont.hxx"
#include "vcl/outfont.hxx"
#include "unotools/fontcfg.hxx"
+#include <sal/macros.h>
#include <algorithm>
@@ -1033,7 +1035,7 @@ namespace
aEnt.string = pOpen+1;
aEnt.string_len = (pClose-pOpen)-1;
aEnt.weight = WEIGHT_NORMAL;
- const int nEnt = sizeof( weight_table ) / sizeof( weight_table[0] );
+ const int nEnt = SAL_N_ELEMENTS( weight_table );
WeightSearchEntry* pFound = std::lower_bound( weight_table, weight_table+nEnt, aEnt );
if( pFound != (weight_table+nEnt) )
o_rResult.SetWeight( pFound->weight );
@@ -1114,3 +1116,5 @@ FontStrikeout Font::GetStrikeout() const { return mpImplFont->meStrikeout; }
FontEmphasisMark Font::GetEmphasisMark() const { return mpImplFont->meEmphasisMark; }
sal_Bool Font::IsWordLineMode() const { return mpImplFont->mbWordLine; }
sal_Bool Font::IsSameInstance( const Font& rFont ) const { return (mpImplFont == rFont.mpImplFont); }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 23da138d23a2..79b8f417891b 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <vos/macros.hxx>
#include <rtl/crc.h>
#include <tools/stream.hxx>
#include <tools/vcompat.hxx>
@@ -35,12 +35,28 @@
#include <vcl/salbtype.hxx>
#include <vcl/outdev.hxx>
#include <vcl/window.hxx>
-#ifndef _SV_CVTSVM_HXX
#include <vcl/cvtsvm.hxx>
-#endif
#include <vcl/virdev.hxx>
+#include <vcl/salbmp.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/svdata.hxx>
+#include <vcl/salinst.hxx>
#include <vcl/gdimtf.hxx>
#include <vcl/graphictools.hxx>
+#include <vcl/canvastools.hxx>
+#include <vcl/unohelp.hxx>
+
+#include <com/sun/star/beans/XFastPropertySet.hpp>
+#include <com/sun/star/rendering/XCanvas.hpp>
+#include <com/sun/star/rendering/MtfRenderer.hpp>
+#include <comphelper/processfactory.hxx>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/awt/XGraphics.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/graphic/XGraphicRenderer.hpp>
+
+using namespace com::sun::star;
// -----------
// - Defines -
@@ -200,7 +216,8 @@ GDIMetaFile::GDIMetaFile() :
pOutDev ( NULL ),
pLabelList ( NULL ),
bPause ( sal_False ),
- bRecord ( sal_False )
+ bRecord ( sal_False ),
+ bUseCanvas ( sal_False )
{
}
@@ -215,7 +232,8 @@ GDIMetaFile::GDIMetaFile( const GDIMetaFile& rMtf ) :
pNext ( rMtf.pNext ),
pOutDev ( NULL ),
bPause ( sal_False ),
- bRecord ( sal_False )
+ bRecord ( sal_False ),
+ bUseCanvas ( rMtf.bUseCanvas )
{
// RefCount der MetaActions erhoehen
for( void* pAct = First(); pAct; pAct = Next() )
@@ -269,6 +287,7 @@ GDIMetaFile& GDIMetaFile::operator=( const GDIMetaFile& rMtf )
pOutDev = NULL;
bPause = sal_False;
bRecord = sal_False;
+ bUseCanvas = rMtf.bUseCanvas;
if( rMtf.bRecord )
{
@@ -418,6 +437,8 @@ void GDIMetaFile::Play( GDIMetaFile& rMtf, sal_uLong nPos )
MetaAction* pAction = GetCurAction();
const sal_uLong nObjCount = Count();
+ rMtf.UseCanvas( rMtf.GetUseCanvas() || bUseCanvas );
+
if( nPos > nObjCount )
nPos = nObjCount;
@@ -459,7 +480,16 @@ void GDIMetaFile::Play( OutputDevice* pOut, sal_uLong nPos )
{
if( !Hook() )
{
- pAction->Execute( pOut );
+ MetaCommentAction* pCommentAct = static_cast<MetaCommentAction*>(pAction);
+ if( pAction->GetType() == META_COMMENT_ACTION &&
+ pCommentAct->GetComment().Equals("DELEGATE_PLUGGABLE_RENDERER") )
+ {
+ ImplDelegate2PluggableRenderer(pCommentAct, pOut);
+ }
+ else
+ {
+ pAction->Execute( pOut );
+ }
// flush output from time to time
if( i++ > nSyncCount )
@@ -475,6 +505,154 @@ void GDIMetaFile::Play( OutputDevice* pOut, sal_uLong nPos )
// ------------------------------------------------------------------------
+bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rDestSize )
+{
+ const Window* win = dynamic_cast <Window*> ( pOut );
+
+ if (!win)
+ win = Application::GetActiveTopWindow();
+ if (!win)
+ win = Application::GetFirstTopLevelWindow();
+
+ if (!win)
+ return false;
+
+ try {
+ const uno::Reference<rendering::XCanvas>& xCanvas = win->GetCanvas ();
+ Size aSize (rDestSize.Width () + 1, rDestSize.Height () + 1);
+ const uno::Reference<rendering::XBitmap>& xBitmap = xCanvas->getDevice ()->createCompatibleAlphaBitmap (vcl::unotools::integerSize2DFromSize( aSize));
+ uno::Reference< lang::XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
+ if( xFactory.is() && xBitmap.is () ) {
+ uno::Reference< rendering::XMtfRenderer > xMtfRenderer;
+ uno::Sequence< uno::Any > args (1);
+ uno::Reference< rendering::XBitmapCanvas > xBitmapCanvas( xBitmap, uno::UNO_QUERY );
+ if( xBitmapCanvas.is() ) {
+ args[0] = uno::Any( xBitmapCanvas );
+ xMtfRenderer.set( xFactory->createInstanceWithArguments( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.rendering.MtfRenderer")),
+ args ), uno::UNO_QUERY );
+
+ if( xMtfRenderer.is() ) {
+ xBitmapCanvas->clear();
+ uno::Reference< beans::XFastPropertySet > xMtfFastPropertySet( xMtfRenderer, uno::UNO_QUERY );
+ if( xMtfFastPropertySet.is() )
+ // set this metafile to the renderer to
+ // speedup things (instead of copying data to
+ // sequence of bytes passed to renderer)
+ xMtfFastPropertySet->setFastPropertyValue( 0, uno::Any( reinterpret_cast<sal_Int64>( this ) ) );
+
+ xMtfRenderer->draw( rDestSize.Width(), rDestSize.Height() );
+
+ uno::Reference< beans::XFastPropertySet > xFastPropertySet( xBitmapCanvas, uno::UNO_QUERY );
+ if( xFastPropertySet.get() ) {
+ // 0 means get BitmapEx
+ uno::Any aAny = xFastPropertySet->getFastPropertyValue( 0 );
+ BitmapEx* pBitmapEx = (BitmapEx*) *reinterpret_cast<const sal_Int64*>(aAny.getValue());
+ if( pBitmapEx ) {
+ pOut->DrawBitmapEx( rPos, *pBitmapEx );
+ delete pBitmapEx;
+ return true;
+ }
+ }
+
+ SalBitmap* pSalBmp = ImplGetSVData()->mpDefInst->CreateSalBitmap();
+ SalBitmap* pSalMask = ImplGetSVData()->mpDefInst->CreateSalBitmap();
+
+ if( pSalBmp->Create( xBitmapCanvas, aSize ) && pSalMask->Create( xBitmapCanvas, aSize, true ) ) {
+ Bitmap aBitmap( pSalBmp );
+ Bitmap aMask( pSalMask );
+ AlphaMask aAlphaMask( aMask );
+ BitmapEx aBitmapEx( aBitmap, aAlphaMask );
+ pOut->DrawBitmapEx( rPos, aBitmapEx );
+ return true;
+ }
+
+ delete pSalBmp;
+ delete pSalMask;
+ }
+ }
+ }
+ } catch( uno::RuntimeException& ) {
+ throw; // runtime errors are fatal
+ } catch( uno::Exception& ) {
+ // ignore errors, no way of reporting them here
+ }
+
+ return false;
+}
+
+// ------------------------------------------------------------------------
+
+void GDIMetaFile::ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct, OutputDevice* pOut )
+{
+ OSL_ASSERT( pAct->GetComment().Equals("DELEGATE_PLUGGABLE_RENDERER") );
+
+ // read payload - string of service name, followed by raw render input
+ const sal_uInt8* pData = pAct->GetData();
+ const sal_uInt8* const pEndData = pData + pAct->GetDataSize();
+ if( !pData )
+ return;
+
+ ::rtl::OUStringBuffer aBuffer;
+ while( pData<pEndData && *pData )
+ aBuffer.append(static_cast<sal_Unicode>(*pData++));
+ const ::rtl::OUString aRendererServiceName=aBuffer.makeStringAndClear();
+ ++pData;
+
+ while( pData<pEndData && *pData )
+ aBuffer.append(static_cast<sal_Unicode>(*pData++));
+ const ::rtl::OUString aGraphicServiceName=aBuffer.makeStringAndClear();
+ ++pData;
+
+ uno::Reference< lang::XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory();
+ if( pData<pEndData && xFactory.is() )
+ {
+ try
+ {
+ // instantiate render service
+ uno::Sequence<uno::Any> aRendererArgs(1);
+ aRendererArgs[0] = makeAny(uno::Reference<awt::XGraphics>(pOut->CreateUnoGraphics()));
+ uno::Reference<graphic::XGraphicRenderer> xRenderer(
+ xFactory->createInstanceWithArguments(
+ aRendererServiceName,
+ aRendererArgs),
+ uno::UNO_QUERY );
+
+ // instantiate graphic service
+ uno::Reference<graphic::XGraphic> xGraphic(
+ xFactory->createInstance(
+ aGraphicServiceName),
+ uno::UNO_QUERY );
+
+ uno::Reference<lang::XInitialization> xInit(
+ xGraphic, uno::UNO_QUERY);
+
+ if(xGraphic.is() && xRenderer.is() && xInit.is())
+ {
+ // delay intialization of XGraphic, to only expose
+ // XGraphic-generating services to arbitrary binary data
+ uno::Sequence< sal_Int8 > aSeq(
+ (sal_Int8*)&pData, pEndData-pData );
+ uno::Sequence<uno::Any> aGraphicsArgs(1);
+ aGraphicsArgs[0] = makeAny(aSeq);
+ xInit->initialize(aGraphicsArgs);
+
+ xRenderer->render(xGraphic);
+ }
+ }
+ catch( uno::RuntimeException& )
+ {
+ // runtime errors are fatal
+ throw;
+ }
+ catch( uno::Exception& )
+ {
+ // ignore errors, no way of reporting them here
+ }
+ }
+}
+
+// ------------------------------------------------------------------------
+
void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
const Size& rSize, sal_uLong nPos )
{
@@ -484,9 +662,13 @@ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
if( aDestSize.Width() && aDestSize.Height() )
{
- Size aTmpPrefSize( pOut->LogicToPixel( GetPrefSize(), aDrawMap ) );
GDIMetaFile* pMtf = pOut->GetConnectMetaFile();
+ if( bUseCanvas && !pMtf && ImplPlayWithRenderer( pOut, rPos, aDestSize ) )
+ return;
+
+ Size aTmpPrefSize( pOut->LogicToPixel( GetPrefSize(), aDrawMap ) );
+
if( !aTmpPrefSize.Width() )
aTmpPrefSize.Width() = aDestSize.Width();
@@ -783,12 +965,12 @@ sal_Bool GDIMetaFile::Mirror( sal_uLong nMirrorFlags )
sal_Bool bRet;
if( nMirrorFlags & MTF_MIRROR_HORZ )
- nMoveX = VOS_ABS( aOldPrefSize.Width() ) - 1, fScaleX = -1.0;
+ nMoveX = SAL_ABS( aOldPrefSize.Width() ) - 1, fScaleX = -1.0;
else
nMoveX = 0, fScaleX = 1.0;
if( nMirrorFlags & MTF_MIRROR_VERT )
- nMoveY = VOS_ABS( aOldPrefSize.Height() ) - 1, fScaleY = -1.0;
+ nMoveY = SAL_ABS( aOldPrefSize.Height() ) - 1, fScaleY = -1.0;
else
nMoveY = 0, fScaleY = 1.0;
@@ -1445,7 +1627,7 @@ void GDIMetaFile::Rotate( long nAngle10 )
case( META_TEXTRECT_ACTION ):
case( META_MOVECLIPREGION_ACTION ):
{
- DBG_ERROR( "GDIMetaFile::Rotate(): unsupported action" );
+ OSL_FAIL( "GDIMetaFile::Rotate(): unsupported action" );
}
break;
@@ -2149,7 +2331,7 @@ void GDIMetaFile::ImplExchangeColors( ColorExchangeFnc pFncCol, const void* pCol
case( META_BMPEX_ACTION ):
case( META_MASK_ACTION ):
{
- DBG_ERROR( "Don't use bitmap actions of this type in metafiles!" );
+ OSL_FAIL( "Don't use bitmap actions of this type in metafiles!" );
}
break;
@@ -3031,3 +3213,53 @@ sal_Bool GDIMetaFile::CreateThumbnail( sal_uInt32 nMaximumExtent,
return !rBmpEx.IsEmpty();
}
+
+void GDIMetaFile::UseCanvas( sal_Bool _bUseCanvas )
+{
+ bUseCanvas = _bUseCanvas;
+}
+
+// ------------------------------------------------------------------------
+
+MetaCommentAction* makePluggableRendererAction( const rtl::OUString& rRendererServiceName,
+ const rtl::OUString& rGraphicServiceName,
+ const void* _pData,
+ sal_uInt32 nDataSize )
+{
+ const sal_uInt8* pData=(sal_uInt8*)_pData;
+
+ // data gets copied twice, unfortunately
+ rtl::OString aRendererServiceName(
+ rRendererServiceName.getStr(),
+ rRendererServiceName.getLength(),
+ RTL_TEXTENCODING_ASCII_US);
+ rtl::OString aGraphicServiceName(
+ rGraphicServiceName.getStr(),
+ rGraphicServiceName.getLength(),
+ RTL_TEXTENCODING_ASCII_US);
+
+ std::vector<sal_uInt8> aMem(
+ aRendererServiceName.getLength()+
+ aGraphicServiceName.getLength()+2+nDataSize);
+ sal_uInt8* pMem=&aMem[0];
+
+ std::copy(aRendererServiceName.getStr(),
+ aRendererServiceName.getStr()+aRendererServiceName.getLength()+1,
+ pMem);
+ pMem+=aRendererServiceName.getLength()+1;
+ std::copy(aGraphicServiceName.getStr(),
+ aGraphicServiceName.getStr()+aGraphicServiceName.getLength()+1,
+ pMem);
+ pMem+=aGraphicServiceName.getLength()+1;
+
+ std::copy(pData,pData+nDataSize,
+ pMem);
+
+ return new MetaCommentAction(
+ "DELEGATE_PLUGGABLE_RENDERER",
+ 0,
+ &aMem[0],
+ aMem.size());
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index 1a476f1b5420..29b6a62253a6 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -467,3 +468,5 @@ void ImpSwap::WriteTo( SvStream& rOStm ) const
delete[] pData;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/gradient.cxx b/vcl/source/gdi/gradient.cxx
index 9f4f91c38e60..38d8ba4567a2 100644
--- a/vcl/source/gdi/gradient.cxx
+++ b/vcl/source/gdi/gradient.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -244,6 +245,99 @@ void Gradient::SetSteps( sal_uInt16 nSteps )
// -----------------------------------------------------------------------
+void Gradient::GetBoundRect( const Rectangle& rRect, Rectangle& rBoundRect, Point& rCenter ) const
+{
+ Rectangle aRect( rRect );
+ sal_uInt16 nAngle = GetAngle() % 3600;
+
+ if( GetStyle() == GRADIENT_LINEAR || GetStyle() == GRADIENT_AXIAL )
+ {
+ aRect.Left()--;
+ aRect.Top()--;
+ aRect.Right()++;
+ aRect.Bottom()++;
+
+ const double fAngle = nAngle * F_PI1800;
+ const double fWidth = aRect.GetWidth();
+ const double fHeight = aRect.GetHeight();
+ double fDX = fWidth * fabs( cos( fAngle ) ) + fHeight * fabs( sin( fAngle ) );
+ double fDY = fHeight * fabs( cos( fAngle ) ) + fWidth * fabs( sin( fAngle ) );
+
+ fDX = ( fDX - fWidth ) * 0.5 + 0.5;
+ fDY = ( fDY - fHeight ) * 0.5 + 0.5;
+
+ aRect.Left() -= (long) fDX;
+ aRect.Right() += (long) fDX;
+ aRect.Top() -= (long) fDY;
+ aRect.Bottom() += (long) fDY;
+
+ rBoundRect = aRect;
+ rCenter = rRect.Center();
+ }
+ else
+ {
+
+ if( GetStyle() == GRADIENT_SQUARE || GetStyle() == GRADIENT_RECT )
+ {
+ const double fAngle = nAngle * F_PI1800;
+ const double fWidth = aRect.GetWidth();
+ const double fHeight = aRect.GetHeight();
+ double fDX = fWidth * fabs( cos( fAngle ) ) + fHeight * fabs( sin( fAngle ) );
+ double fDY = fHeight * fabs( cos( fAngle ) ) + fWidth * fabs( sin( fAngle ) );
+
+ fDX = ( fDX - fWidth ) * 0.5 + 0.5;
+ fDY = ( fDY - fHeight ) * 0.5 + 0.5;
+
+ aRect.Left() -= (long) fDX;
+ aRect.Right() += (long) fDX;
+ aRect.Top() -= (long) fDY;
+ aRect.Bottom() += (long) fDY;
+ }
+
+ Size aSize( aRect.GetSize() );
+
+ if( GetStyle() == GRADIENT_RADIAL )
+ {
+ // Radien-Berechnung fuer Kreis
+ aSize.Width() = (long)(0.5 + sqrt((double)aSize.Width()*(double)aSize.Width() + (double)aSize.Height()*(double)aSize.Height()));
+ aSize.Height() = aSize.Width();
+ }
+ else if( GetStyle() == GRADIENT_ELLIPTICAL )
+ {
+ // Radien-Berechnung fuer Ellipse
+ aSize.Width() = (long)( 0.5 + (double) aSize.Width() * 1.4142 );
+ aSize.Height() = (long)( 0.5 + (double) aSize.Height() * 1.4142 );
+ }
+ else if( GetStyle() == GRADIENT_SQUARE )
+ {
+ if ( aSize.Width() > aSize.Height() )
+ aSize.Height() = aSize.Width();
+ else
+ aSize.Width() = aSize.Height();
+ }
+
+ // neue Mittelpunkte berechnen
+ long nZWidth = aRect.GetWidth() * (long) GetOfsX() / 100;
+ long nZHeight = aRect.GetHeight() * (long) GetOfsY() / 100;
+ long nBorderX = (long) GetBorder() * aSize.Width() / 100;
+ long nBorderY = (long) GetBorder() * aSize.Height() / 100;
+ rCenter = Point( aRect.Left() + nZWidth, aRect.Top() + nZHeight );
+
+ // Rand beruecksichtigen
+ aSize.Width() -= nBorderX;
+ aSize.Height() -= nBorderY;
+
+ // Ausgaberechteck neu setzen
+ aRect.Left() = rCenter.X() - ( aSize.Width() >> 1 );
+ aRect.Top() = rCenter.Y() - ( aSize.Height() >> 1 );
+
+ aRect.SetSize( aSize );
+ rBoundRect = rRect;
+ }
+}
+
+// -----------------------------------------------------------------------
+
Gradient& Gradient::operator=( const Gradient& rGradient )
{
DBG_CHKTHIS( Gradient, NULL );
@@ -342,3 +436,5 @@ SvStream& operator<<( SvStream& rOStm, const Gradient& rGradient )
{
return( rOStm << *rGradient.mpImplGradient );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 1a8201706212..f61bbf8dc041 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -812,3 +813,5 @@ SvStream& operator<<( SvStream& rOStream, const Graphic& rGraphic )
{
return rOStream << *rGraphic.mpImpGraphic;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/graphictools.cxx b/vcl/source/gdi/graphictools.cxx
index 5ef9ed038163..2e20a3639790 100644
--- a/vcl/source/gdi/graphictools.cxx
+++ b/vcl/source/gdi/graphictools.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,7 +52,7 @@ static ::rtl::OString polyToString( const Polygon& rPoly )
break;
default:
- DBG_ERROR( "SvtGraphicStroke::polyToString invalid flag");
+ OSL_FAIL( "SvtGraphicStroke::polyToString invalid flag");
break;
}
aStr += ::rtl::OString::valueOf( static_cast< double >( rPoly[nVertex].getX() ) );
@@ -226,7 +227,7 @@ void SvtGraphicStroke::getDashArray( DashArray& rDashArray ) const
break;
default:
- DBG_ERROR( "SvtGraphicStroke::toString missing cap type");
+ OSL_FAIL( "SvtGraphicStroke::toString missing cap type");
break;
}
aStr += " join: ";
@@ -249,7 +250,7 @@ void SvtGraphicStroke::getDashArray( DashArray& rDashArray ) const
break;
default:
- DBG_ERROR( "SvtGraphicStroke::toString missing join type");
+ OSL_FAIL( "SvtGraphicStroke::toString missing join type");
break;
}
aStr += " ";
@@ -514,7 +515,7 @@ void SvtGraphicFill::getGraphic( Graphic& rGraphic ) const
break;
default:
- DBG_ERROR( "SvtGraphicFill::toString missing fill rule");
+ OSL_FAIL( "SvtGraphicFill::toString missing fill rule");
break;
}
aStr += " type: ";
@@ -537,7 +538,7 @@ void SvtGraphicFill::getGraphic( Graphic& rGraphic ) const
break;
default:
- DBG_ERROR( "SvtGraphicStroke::toString missing fill type");
+ OSL_FAIL( "SvtGraphicStroke::toString missing fill type");
break;
}
@@ -563,7 +564,7 @@ void SvtGraphicFill::getGraphic( Graphic& rGraphic ) const
break;
default:
- DBG_ERROR( "SvtGraphicStroke::toString missing hatch type");
+ OSL_FAIL( "SvtGraphicStroke::toString missing hatch type");
break;
}
@@ -586,7 +587,7 @@ void SvtGraphicFill::getGraphic( Graphic& rGraphic ) const
break;
default:
- DBG_ERROR( "SvtGraphicStroke::toString missing gradient type");
+ OSL_FAIL( "SvtGraphicStroke::toString missing gradient type");
break;
}
@@ -617,7 +618,7 @@ void SvtGraphicFill::getGraphic( Graphic& rGraphic ) const
break;
default:
- DBG_ERROR( "SvtGraphicStroke::toString missing graphic type");
+ OSL_FAIL( "SvtGraphicStroke::toString missing graphic type");
break;
}
@@ -757,3 +758,5 @@ SvStream& operator>>( SvStream& rIStm, SvtGraphicFill& rClass )
return rIStm;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/hatch.cxx b/vcl/source/gdi/hatch.cxx
index b226c0f06936..9836b2e6e4b4 100644
--- a/vcl/source/gdi/hatch.cxx
+++ b/vcl/source/gdi/hatch.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <tools/stream.hxx>
#include <tools/vcompat.hxx>
#include <tools/debug.hxx>
-#ifndef _SV_HATCX_HXX
#include <vcl/hatch.hxx>
-#endif
DBG_NAME( Hatch )
@@ -220,3 +219,5 @@ SvStream& operator<<( SvStream& rOStm, const Hatch& rHatch )
{
return( rOStm << *rHatch.mpImplHatch );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx
index ee6060b7d8f3..e212efc00e23 100644
--- a/vcl/source/gdi/image.cxx
+++ b/vcl/source/gdi/image.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,22 +34,17 @@
#include <rtl/logfile.hxx>
#include <tools/debug.hxx>
#include <tools/stream.hxx>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <tools/rc.hxx>
-#ifndef _SV_RESMGR_HXX
#include <tools/resmgr.hxx>
-#endif
#include <vcl/settings.hxx>
#include <vcl/outdev.hxx>
#include <vcl/graph.hxx>
#include <vcl/svapp.hxx>
-#ifndef _SV_IMPIMAGETREE_H
#include <vcl/impimagetree.hxx>
-#endif
#include <vcl/image.h>
#include <vcl/image.hxx>
+#include <vcl/imagerepository.hxx>
#if OSL_DEBUG_LEVEL > 0
#include <rtl/strbuf.hxx>
@@ -279,51 +275,6 @@ uno::Reference< graphic::XGraphic > Image::GetXGraphic() const
// -----------------------------------------------------------------------
-Image Image::GetColorTransformedImage( ImageColorTransform eColorTransform ) const
-{
- DBG_CHKTHIS( Image, NULL );
-
- Image aRet;
-
- if( IMAGECOLORTRANSFORM_HIGHCONTRAST == eColorTransform )
- {
- BitmapEx aBmpEx( GetBitmapEx() );
-
- if( !aBmpEx.IsEmpty() )
- {
- Color* pSrcColors = NULL;
- Color* pDstColors = NULL;
- sal_uLong nColorCount = 0;
-
- Image::GetColorTransformArrays( eColorTransform, pSrcColors, pDstColors, nColorCount );
-
- if( nColorCount && pSrcColors && pDstColors )
- {
- aBmpEx.Replace( pSrcColors, pDstColors, nColorCount );
- aRet = Image( aBmpEx );
- }
-
- delete[] pSrcColors;
- delete[] pDstColors;
- }
- }
- else if( IMAGECOLORTRANSFORM_MONOCHROME_BLACK == eColorTransform ||
- IMAGECOLORTRANSFORM_MONOCHROME_WHITE == eColorTransform )
- {
- BitmapEx aBmpEx( GetBitmapEx() );
-
- if( !aBmpEx.IsEmpty() )
- aRet = Image( aBmpEx.GetColorTransformedBitmapEx( ( BmpColorMode )( eColorTransform ) ) );
- }
-
- if( !aRet )
- aRet = *this;
-
- return aRet;
-}
-
-// -----------------------------------------------------------------------
-
void Image::Invert()
{
BitmapEx aInvertedBmp( GetBitmapEx() );
@@ -495,8 +446,6 @@ ImageList::ImageList( const ::std::vector< ::rtl::OUString >& rNameVector,
mpImplData->maPrefix = rPrefix;
for( sal_uInt32 i = 0; i < rNameVector.size(); ++i )
{
-// fprintf (stderr, "List %p [%d]: '%s'\n",
-// this, i, rtl::OUStringToOString( rNameVector[i], RTL_TEXTENCODING_UTF8 ).getStr() );
mpImplData->AddImage( rNameVector[ i ], static_cast< sal_uInt16 >( i ) + 1, BitmapEx() );
}
}
@@ -542,9 +491,6 @@ void ImageAryData::Load(const rtl::OUString &rPrefix)
BitmapEx aBmpEx;
-// fprintf (stderr, "Attempt load of '%s'\n",
-// rtl::OUStringToOString( maName, RTL_TEXTENCODING_UTF8 ).getStr() );
-
rtl::OUString aFileName = rPrefix;
aFileName += maName;
#if OSL_DEBUG_LEVEL > 0
@@ -621,8 +567,6 @@ void ImageList::InsertFromHorizontalStrip( const BitmapEx &rBitmapEx,
{
sal_uInt16 nItems = sal::static_int_cast< sal_uInt16 >( rNameVector.size() );
-// fprintf (stderr, "InsertFromHorizontalStrip (1) [%d items]\n", nItems);
-
if (!nItems)
return;
@@ -794,15 +738,13 @@ Image ImageList::GetImage( sal_uInt16 nId ) const
{
DBG_CHKTHIS( ImageList, NULL );
-// fprintf (stderr, "GetImage %d\n", nId);
-
Image aRet;
if( mpImplData )
{
std::vector<ImageAryData *>::iterator aIter;
for( aIter = mpImplData->maImages.begin();
- aIter != mpImplData->maImages.end(); aIter++)
+ aIter != mpImplData->maImages.end(); ++aIter)
{
if ((*aIter)->mnId == nId)
{
@@ -814,6 +756,14 @@ Image ImageList::GetImage( sal_uInt16 nId ) const
}
}
+ if (!aRet)
+ {
+ BitmapEx rBitmap;
+ bool res = ::vcl::ImageRepository::loadDefaultImage(rBitmap);
+ if (res)
+ aRet = Image(rBitmap);
+ }
+
return aRet;
}
@@ -821,9 +771,6 @@ Image ImageList::GetImage( sal_uInt16 nId ) const
Image ImageList::GetImage( const ::rtl::OUString& rImageName ) const
{
-// fprintf (stderr, "GetImage '%s'\n",
-// rtl::OUStringToOString( rImageName, RTL_TEXTENCODING_UTF8 ).getStr() );
-
if( mpImplData )
{
ImageAryData *pImg = mpImplData->maNameHash[ rImageName ];
@@ -835,7 +782,6 @@ Image ImageList::GetImage( const ::rtl::OUString& rImageName ) const
return Image( pImg->maBitmapEx );
}
}
-// fprintf (stderr, "no such image\n");
return Image();
}
@@ -984,9 +930,6 @@ Size ImageList::GetImageSize() const
aRet = mpImplData->maImageSize = aTmp.GetSizePixel();
}
}
-// fprintf (stderr, "GetImageSize returns %d, %d\n",
-// aRet.Width(), aRet.Height());
-
return aRet;
}
@@ -1027,3 +970,5 @@ sal_Bool ImageList::operator==( const ImageList& rImageList ) const
return bRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/imagerepository.cxx b/vcl/source/gdi/imagerepository.cxx
index d97999311751..ea5b5f5d87a4 100644
--- a/vcl/source/gdi/imagerepository.cxx
+++ b/vcl/source/gdi/imagerepository.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <vcl/bitmapex.hxx>
#include <vcl/imagerepository.hxx>
#include <vcl/svapp.hxx>
-#ifndef _SV_IMPIMAGETREE_H
#include "vcl/impimagetree.hxx"
-#endif
//........................................................................
namespace vcl
@@ -43,15 +42,23 @@ namespace vcl
//= ImageRepository
//====================================================================
//--------------------------------------------------------------------
- bool ImageRepository::loadImage( const ::rtl::OUString& _rName, BitmapEx& _out_rImage, bool _bSearchLanguageDependent )
+ bool ImageRepository::loadImage( const ::rtl::OUString& _rName, BitmapEx& _out_rImage, bool _bSearchLanguageDependent, bool loadMissing )
{
::rtl::OUString sCurrentSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyleName();
ImplImageTreeSingletonRef aImplImageTree;
- return aImplImageTree->loadImage( _rName, sCurrentSymbolsStyle, _out_rImage, _bSearchLanguageDependent );
+ return aImplImageTree->loadImage( _rName, sCurrentSymbolsStyle, _out_rImage, _bSearchLanguageDependent, loadMissing );
+ }
+
+ bool ImageRepository::loadDefaultImage( BitmapEx& _out_rImage)
+ {
+ ::rtl::OUString sCurrentSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyleName();
+ ImplImageTreeSingletonRef aImplImageTree;
+ return aImplImageTree->loadDefaultImage( sCurrentSymbolsStyle,_out_rImage);
}
//........................................................................
} // namespace vcl
//........................................................................
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx
index aaaca451ebe3..59ee15fa558a 100644
--- a/vcl/source/gdi/impanmvw.cxx
+++ b/vcl/source/gdi/impanmvw.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -353,3 +354,5 @@ AInfo* ImplAnimView::ImplCreateAInfo() const
return pAInfo;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/impanmvw.hxx b/vcl/source/gdi/impanmvw.hxx
index 69ae35fe1c6e..4e96ecbd9b64 100644
--- a/vcl/source/gdi/impanmvw.hxx
+++ b/vcl/source/gdi/impanmvw.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -94,3 +95,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx
index af39ed615874..6957e32b3e25 100644
--- a/vcl/source/gdi/impbmp.cxx
+++ b/vcl/source/gdi/impbmp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/salbmp.hxx>
#include <tools/debug.hxx>
#include <vcl/impbmp.hxx>
@@ -132,3 +131,5 @@ void ImpBitmap::ImplReleaseBuffer( BitmapBuffer* pBuffer, sal_Bool bReadOnly )
if( !bReadOnly )
mnChecksum = 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 500ba9549b9e..bf99364a0f64 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,9 +33,7 @@
#include <tools/debug.hxx>
#include <ucbhelper/content.hxx>
#include <unotools/ucbstreamhelper.hxx>
-#ifndef _UNTOOLS_TEMPFILE_HXX
#include <unotools/tempfile.hxx>
-#endif
#include <vcl/outdev.hxx>
#include <vcl/virdev.hxx>
#include <tools/debug.hxx>
@@ -389,7 +388,7 @@ void ImpGraphic::ImplClear()
::ucbhelper::Content aCnt( mpSwapFile->aSwapURL.GetMainURL( INetURLObject::NO_DECODE ),
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
- aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ),
+ aCnt.executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")),
::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
}
catch( const ::com::sun::star::ucb::ContentCreationException& )
@@ -1070,7 +1069,7 @@ sal_Bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, sal_Bool bSwap )
::ucbhelper::Content aCnt( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ),
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
- aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ),
+ aCnt.executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")),
::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
}
catch( const ::com::sun::star::ucb::ContentCreationException& )
@@ -1254,7 +1253,7 @@ sal_Bool ImpGraphic::ImplSwapOut()
::ucbhelper::Content aCnt( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ),
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
- aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ),
+ aCnt.executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")),
::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
}
catch( const ::com::sun::star::ucb::ContentCreationException& )
@@ -1356,7 +1355,7 @@ sal_Bool ImpGraphic::ImplSwapIn()
::ucbhelper::Content aCnt( aSwapURL,
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
- aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ),
+ aCnt.executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")),
::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
}
catch( const ::com::sun::star::ucb::ContentCreationException& )
@@ -1675,3 +1674,5 @@ SvStream& operator<<( SvStream& rOStm, const ImpGraphic& rImpGraphic )
return rOStm;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/impimage.cxx b/vcl/source/gdi/impimage.cxx
index 0d0af3365c00..d2e479e1edb5 100644
--- a/vcl/source/gdi/impimage.cxx
+++ b/vcl/source/gdi/impimage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -346,15 +347,6 @@ void ImplImageBmp::ReplaceColors( const Color* pSrcColors, const Color* pDstColo
// -----------------------------------------------------------------------
-void ImplImageBmp::ColorTransform( BmpColorMode eColorMode )
-{
- maBmpEx = maBmpEx.GetColorTransformedBitmapEx( eColorMode );
- delete mpDisplayBmp;
- mpDisplayBmp = NULL;
-}
-
-// -----------------------------------------------------------------------
-
BitmapEx ImplImageBmp::GetBitmapEx( sal_uInt16 nPosCount, sal_uInt16* pPosAry ) const
{
const Bitmap aNewBmp( Size( nPosCount * maSize.Width(), maSize.Height() ), maBmpEx.GetBitmap().GetBitCount() );
@@ -404,7 +396,6 @@ void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev,
else
{
if( nStyle & ( IMAGE_DRAW_COLORTRANSFORM |
- IMAGE_DRAW_MONOCHROME_BLACK | IMAGE_DRAW_MONOCHROME_WHITE |
IMAGE_DRAW_HIGHLIGHT | IMAGE_DRAW_DEACTIVE | IMAGE_DRAW_SEMITRANSPARENT ) )
{
BitmapEx aTmpBmpEx;
@@ -417,14 +408,6 @@ void ImplImageBmp::Draw( sal_uInt16 nPos, OutputDevice* pOutDev,
aTmpBmpEx.Crop( aCropRect );
- if( nStyle & ( IMAGE_DRAW_COLORTRANSFORM | IMAGE_DRAW_MONOCHROME_BLACK | IMAGE_DRAW_MONOCHROME_WHITE ) )
- {
- const BmpColorMode eMode = ( nStyle & IMAGE_DRAW_COLORTRANSFORM ) ? BMP_COLOR_HIGHCONTRAST :
- ( ( nStyle & IMAGE_DRAW_MONOCHROME_BLACK ) ? BMP_COLOR_MONOCHROME_BLACK : BMP_COLOR_MONOCHROME_WHITE );
-
- aTmpBmpEx = aTmpBmpEx.GetColorTransformedBitmapEx( eMode );
- }
-
Bitmap aTmpBmp( aTmpBmpEx.GetBitmap() );
if( nStyle & ( IMAGE_DRAW_HIGHLIGHT | IMAGE_DRAW_DEACTIVE ) )
@@ -632,3 +615,5 @@ void ImplImageBmp::ImplUpdateDisabledBmpEx( int nPos )
maDisabledBmpEx = BitmapEx( aGrey, aGreyAlphaMask );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/impimagetree.cxx b/vcl/source/gdi/impimagetree.cxx
index 03e4c1dbbb2a..88b465c89f7d 100644
--- a/vcl/source/gdi/impimagetree.cxx
+++ b/vcl/source/gdi/impimagetree.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,7 +34,7 @@
#include <utility>
#include <vector>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include "com/sun/star/container/XNameAccess.hpp"
#include "com/sun/star/io/XInputStream.hpp"
@@ -84,8 +85,8 @@ std::auto_ptr< SvStream > wrapStream(
OSL_ASSERT(stream.is());
std::auto_ptr< SvStream > s(new SvMemoryStream);
for (;;) {
- css::uno::Sequence< sal_Int8 > data;
- sal_Int32 const size = 30000;
+ sal_Int32 const size = 2048;
+ css::uno::Sequence< sal_Int8 > data(size);
sal_Int32 n = stream->readBytes(data, size);
s->Write(data.getConstArray(), n);
if (n < size) {
@@ -137,7 +138,7 @@ bool ImplImageTree::checkStyle(rtl::OUString const & style)
// skip brand-specific icon themes; they are incomplete and thus not useful for this check
if (nFromIndex < 0 || !aZipURL.match(sBrandURLSuffix, nFromIndex)) {
osl::File aZip(aZipURL);
- if (aZip.open(OpenFlag_Read) == ::osl::FileBase::E_None) {
+ if (aZip.open(osl_File_OpenFlag_Read) == ::osl::FileBase::E_None) {
aZip.close();
exists = true;
}
@@ -150,6 +151,41 @@ bool ImplImageTree::checkStyle(rtl::OUString const & style)
bool ImplImageTree::loadImage(
rtl::OUString const & name, rtl::OUString const & style, BitmapEx & bitmap,
+ bool localized, bool loadMissing )
+{
+ bool found = false;
+ try {
+ found = doLoadImage(name, style, bitmap, localized);
+ } catch (css::uno::RuntimeException &) {
+ if (!loadMissing)
+ throw;
+ }
+ if (found || !loadMissing)
+ return found;
+
+ try {
+ OSL_TRACE(
+ "ImplImageTree::loadImage exception couldn't load \"%s\", fetching missing_icon.png",
+ rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr());
+ found = loadDefaultImage(style, bitmap);
+ } catch (css::uno::RuntimeException &) {
+ throw;
+ }
+ return found;
+}
+
+bool ImplImageTree::loadDefaultImage(
+ rtl::OUString const & style,
+ BitmapEx& bitmap)
+{
+ return doLoadImage(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("res/grafikde.png")),
+ style, bitmap, false);
+}
+
+
+bool ImplImageTree::doLoadImage(
+ rtl::OUString const & name, rtl::OUString const & style, BitmapEx & bitmap,
bool localized)
{
setStyle(style);
@@ -272,7 +308,7 @@ void ImplImageTree::resetZips() {
u.GetMainURL(INetURLObject::NO_DECODE),
css::uno::Reference< css::container::XNameAccess >()));
}
- if ( m_style.equals(::rtl::OUString::createFromAscii("default")) )
+ if ( m_style.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("default"))) )
{
rtl::OUString url(
RTL_CONSTASCII_USTRINGPARAM(
@@ -350,3 +386,5 @@ bool ImplImageTree::find(
}
return false;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx
index f405c3e4b602..df0e3adddb1d 100644
--- a/vcl/source/gdi/impvect.cxx
+++ b/vcl/source/gdi/impvect.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,9 +37,7 @@
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/virdev.hxx>
-#ifndef _SV_VECTORIZ_HXX
#include <impvect.hxx>
-#endif
// -----------
// - Defines -
@@ -1202,3 +1201,5 @@ sal_Bool ImplVectorizer::ImplIsUp( ImplVectMap* pMap, long nY, long nX ) const
else
return sal_False;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/impvect.hxx b/vcl/source/gdi/impvect.hxx
index 86fef6a04083..56591e969b8b 100644
--- a/vcl/source/gdi/impvect.hxx
+++ b/vcl/source/gdi/impvect.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,3 +62,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx
index ff3c9a20ef06..34cd27b270cd 100644
--- a/vcl/source/gdi/jobset.cxx
+++ b/vcl/source/gdi/jobset.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include "precompiled_vcl.hxx"
#include <tools/debug.hxx>
#include <tools/stream.hxx>
-#ifndef _RTL_ALLOC_H
#include <rtl/alloc.h>
-#endif
#include <vcl/jobset.hxx>
#include <vcl/jobset.h>
@@ -213,7 +212,7 @@ String JobSetup::GetValue( const String& rKey ) const
{
if( mpData )
{
- ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >::const_iterator it;
+ ::boost::unordered_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >::const_iterator it;
it = mpData->maValueMap.find( rKey );
return it != mpData->maValueMap.end() ? String( it->second ) : String();
}
@@ -296,10 +295,8 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup )
{
DBG_ASSERTWARNING( rIStream.GetVersion(), "JobSetup::>> - Solar-Version not set on rOStream" );
- // Zur Zeit haben wir noch kein neues FileFormat
-// if ( rIStream.GetVersion() < JOBSET_FILEFORMAT2 )
{
- sal_uInt16 nLen;
+ sal_uInt16 nLen(0);
sal_uInt16 nSystem;
sal_Size nFirstPos = rIStream.Tell();
rIStream >> nLen;
@@ -378,11 +375,6 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup )
}
delete[] pTempBuf;
}
-/*
- else
- {
- }
-*/
return rIStream;
}
@@ -428,7 +420,7 @@ SvStream& operator<<( SvStream& rOStream, const JobSetup& rJobSetup )
rOStream.Write( (char*)&aOldData, sizeof( aOldData ) );
rOStream.Write( (char*)&aOldJobData, nOldJobDataSize );
rOStream.Write( (char*)pJobData->mpDriverData, pJobData->mnDriverDataLen );
- ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >::const_iterator it;
+ ::boost::unordered_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >::const_iterator it;
for( it = pJobData->maValueMap.begin(); it != pJobData->maValueMap.end(); ++it )
{
rOStream.WriteByteString( it->first, RTL_TEXTENCODING_UTF8 );
@@ -456,3 +448,5 @@ SvStream& operator<<( SvStream& rOStream, const JobSetup& rJobSetup )
return rOStream;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/lineinfo.cxx b/vcl/source/gdi/lineinfo.cxx
index ebd55a48f593..542c3103eb27 100644
--- a/vcl/source/gdi/lineinfo.cxx
+++ b/vcl/source/gdi/lineinfo.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -367,3 +368,5 @@ void LineInfo::applyToB2DPolyPolygon(
}
// -----------------------------------------------------------------------
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk
index ac2e586a41cb..c530c0148783 100755
--- a/vcl/source/gdi/makefile.mk
+++ b/vcl/source/gdi/makefile.mk
@@ -48,73 +48,73 @@ CDEFS+=-DENABLE_GRAPHITE
# --- Files --------------------------------------------------------
EXCEPTIONSFILES= $(SLO)$/salmisc.obj \
- $(SLO)$/outdev.obj \
- $(SLO)$/outdev3.obj \
- $(SLO)$/outdevnative.obj \
- $(SLO)$/gfxlink.obj \
- $(SLO)$/print.obj \
- $(SLO)$/print2.obj \
- $(SLO)$/print3.obj \
- $(SLO)$/oldprintadaptor.obj \
+ $(SLO)$/animate.obj \
+ $(SLO)$/base14.obj \
+ $(SLO)$/bitmap.obj \
+ $(SLO)$/bitmap2.obj \
+ $(SLO)$/bitmapex.obj \
+ $(SLO)$/bmpconv.obj \
$(SLO)$/configsettings.obj \
- $(SLO)$/sallayout.obj \
+ $(SLO)$/cvtgrf.obj \
+ $(SLO)$/cvtsvm.obj \
+ $(SLO)$/gdimtf.obj \
+ $(SLO)$/gfxlink.obj \
+ $(SLO)$/graph.obj \
+ $(SLO)$/graphictools.obj \
$(SLO)$/image.obj \
- $(SLO)$/impimage.obj \
+ $(SLO)$/imagerepository.obj \
+ $(SLO)$/impanmvw.obj \
$(SLO)$/impgraph.obj \
+ $(SLO)$/impimage.obj \
+ $(SLO)$/impimagetree.obj \
+ $(SLO)$/impvect.obj \
+ $(SLO)$/jobset.obj \
+ $(SLO)$/lineinfo.obj \
+ $(SLO)$/metaact.obj \
$(SLO)$/metric.obj \
+ $(SLO)$/oldprintadaptor.obj \
+ $(SLO)$/outdev.obj \
+ $(SLO)$/outdev2.obj \
+ $(SLO)$/outdev3.obj \
+ $(SLO)$/outdev4.obj \
+ $(SLO)$/outdev5.obj \
+ $(SLO)$/outdev6.obj \
+ $(SLO)$/outdevnative.obj \
+ $(SLO)$/outmap.obj \
+ $(SLO)$/pdfextoutdevdata.obj \
+ $(SLO)$/pdffontcache.obj\
+ $(SLO)$/pdfwriter.obj \
$(SLO)$/pdfwriter_impl.obj \
$(SLO)$/pdfwriter_impl2.obj \
- $(SLO)$/pdffontcache.obj\
- $(SLO)$/bmpconv.obj \
- $(SLO)$/pdfextoutdevdata.obj \
- $(SLO)$/jobset.obj \
- $(SLO)$/impimagetree.obj \
$(SLO)$/pngread.obj \
$(SLO)$/pngwrite.obj \
- $(SLO)$/virdev.obj \
- $(SLO)$/gdimtf.obj \
- $(SLO)$/graphictools.obj \
+ $(SLO)$/print.obj \
+ $(SLO)$/print2.obj \
+ $(SLO)$/print3.obj \
+ $(SLO)$/salgdilayout.obj \
+ $(SLO)$/sallayout.obj \
+ $(SLO)$/salnativewidgets-none.obj \
$(SLO)$/textlayout.obj \
- $(SLO)$/lineinfo.obj
+ $(SLO)$/virdev.obj \
+ $(SLO)$/wall.obj
SLOFILES= $(EXCEPTIONSFILES) \
- $(SLO)$/animate.obj \
- $(SLO)$/impanmvw.obj \
- $(SLO)$/bitmap.obj \
- $(SLO)$/bitmap2.obj \
$(SLO)$/bitmap3.obj \
$(SLO)$/bitmap4.obj \
$(SLO)$/alpha.obj \
- $(SLO)$/bitmapex.obj \
$(SLO)$/bmpacc.obj \
$(SLO)$/bmpacc2.obj \
$(SLO)$/bmpacc3.obj \
$(SLO)$/bmpfast.obj \
- $(SLO)$/cvtsvm.obj \
- $(SLO)$/cvtgrf.obj \
$(SLO)$/font.obj \
$(SLO)$/gradient.obj \
$(SLO)$/hatch.obj \
- $(SLO)$/graph.obj \
$(SLO)$/impbmp.obj \
- $(SLO)$/imagerepository.obj \
- $(SLO)$/impvect.obj \
$(SLO)$/mapmod.obj \
- $(SLO)$/metaact.obj \
$(SLO)$/octree.obj \
- $(SLO)$/outmap.obj \
- $(SLO)$/outdev2.obj \
- $(SLO)$/outdev4.obj \
- $(SLO)$/outdev5.obj \
- $(SLO)$/outdev6.obj \
$(SLO)$/regband.obj \
$(SLO)$/region.obj \
- $(SLO)$/wall.obj \
- $(SLO)$/base14.obj \
- $(SLO)$/pdfwriter.obj \
- $(SLO)$/salgdilayout.obj \
- $(SLO)$/extoutdevdata.obj \
- $(SLO)$/salnativewidgets-none.obj
+ $(SLO)$/extoutdevdata.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/gdi/mapmod.cxx b/vcl/source/gdi/mapmod.cxx
index 5eff28d559a7..ae7b13ca25b7 100644
--- a/vcl/source/gdi/mapmod.cxx
+++ b/vcl/source/gdi/mapmod.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -309,3 +310,5 @@ SvStream& operator<<( SvStream& rOStm, const MapMode& rMapMode )
{
return (rOStm << *rMapMode.mpImplMapMode);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index eab6af8444e5..feba437c7c2f 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -4113,6 +4114,7 @@ void MetaCommentAction::Move( long nXMove, long nYMove )
// SJ: 25.07.06 #i56656# we are not able to mirrorcertain kind of
// comments properly, especially the XPATHSTROKE and XPATHFILL lead to
// problems, so it is better to remove these comments when mirroring
+// FIXME: fake comment to apply the next hunk in the right location
void MetaCommentAction::Scale( double fXScale, double fYScale )
{
if ( ( fXScale != 1.0 ) || ( fYScale != 1.0 ) )
@@ -4146,6 +4148,32 @@ void MetaCommentAction::Scale( double fXScale, double fYScale )
}
delete[] mpData;
ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() );
+ } else if( maComment.Equals( "EMF_PLUS_HEADER_INFO" ) ) {
+ SvMemoryStream aMemStm( (void*)mpData, mnDataSize, STREAM_READ );
+ SvMemoryStream aDest;
+
+ sal_Int32 nLeft, nRight, nTop, nBottom;
+ sal_Int32 nPixX, nPixY, nMillX, nMillY;
+ float m11, m12, m21, m22, mdx, mdy;
+
+ // read data
+ aMemStm >> nLeft >> nTop >> nRight >> nBottom;
+ aMemStm >> nPixX >> nPixY >> nMillX >> nMillY;
+ aMemStm >> m11 >> m12 >> m21 >> m22 >> mdx >> mdy;
+
+ // add scale to the transformation
+ m11 *= fXScale;
+ m12 *= fXScale;
+ m22 *= fYScale;
+ m21 *= fYScale;
+
+ // prepare new data
+ aDest << nLeft << nTop << nRight << nBottom;
+ aDest << nPixX << nPixY << nMillX << nMillY;
+ aDest << m11 << m12 << m21 << m22 << mdx << mdy;
+
+ // save them
+ ImplInitDynamicData( static_cast<const sal_uInt8*>( aDest.GetData() ), aDest.Tell() );
}
}
}
@@ -4294,3 +4322,5 @@ void MetaTextLanguageAction::Read( SvStream& rIStm, ImplMetaReadData* )
}
// ========================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx
index 01f88e9d8860..4814d6e3114e 100644
--- a/vcl/source/gdi/metric.cxx
+++ b/vcl/source/gdi/metric.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -685,15 +686,8 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
sal_uInt32 cMaxChar = GetUInt( pGroup + 4 );
int nGlyphId = GetUInt( pGroup + 8 );
pGroup += 12;
-#if 0 // TODO: remove unicode baseplane clipping for UCS-4 support
- if( cMinChar > 0xFFFF )
- continue;
- if( cMaxChar > 0xFFFF )
- cMaxChar = 0xFFFF;
-#else
if( cMinChar > cMaxChar ) // no sane font should trigger this
break;
-#endif
*(pCP++) = cMinChar;
*(pCP++) = cMaxChar + 1;
pStartGlyphs[i] = nGlyphId;
@@ -932,3 +926,4 @@ sal_uInt32 FontCharMap::GetCharFromIndex( int nIndex ) const
// =======================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/octree.cxx b/vcl/source/gdi/octree.cxx
index 658856dbe100..c2f0d92f03c3 100644
--- a/vcl/source/gdi/octree.cxx
+++ b/vcl/source/gdi/octree.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -367,3 +368,5 @@ void InverseColorMap::ImplCreateBuffers( const sal_uLong nMax )
pBuffer = (sal_uInt8*) rtl_allocateMemory( nSize );
memset( pBuffer, 0xff, nSize );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/oldprintadaptor.cxx b/vcl/source/gdi/oldprintadaptor.cxx
index ce3ece7e1e5b..4d87c06471ee 100644
--- a/vcl/source/gdi/oldprintadaptor.cxx
+++ b/vcl/source/gdi/oldprintadaptor.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -115,3 +116,4 @@ void OldStylePrintAdaptor::printPage( int i_nPage ) const
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx
index b5ecb0761949..ffc71df7b98f 100755
--- a/vcl/source/gdi/outdev.cxx
+++ b/vcl/source/gdi/outdev.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include "precompiled_vcl.hxx"
#include <tools/ref.hxx>
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/salgdi.hxx>
#include <vcl/sallayout.hxx>
#include <vcl/salframe.hxx>
@@ -41,9 +40,7 @@
#include <vcl/svdata.hxx>
#include <vcl/svapp.hxx>
#include <vcl/ctrl.hxx>
-#ifndef _POLY_HXX
#include <tools/poly.hxx>
-#endif
#include <vcl/region.hxx>
#include <vcl/region.h>
#include <vcl/virdev.hxx>
@@ -2137,17 +2134,9 @@ void OutputDevice::DrawPolyPolygon( const basegfx::B2DPolyPolygon& rB2DPolyPoly
DBG_TRACE( "OutputDevice::DrawPolyPolygon(B2D&)" );
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
-#if 0
- // MetaB2DPolyPolygonAction is not implemented yet:
- // according to AW adding it is very dangerous since there is a lot
- // of code that uses the metafile actions directly and unless every
- // place that does this knows about the new action we need to fallback
- if( mpMetaFile )
- mpMetaFile->AddAction( new MetaB2DPolyPolygonAction( rB2DPolyPoly ) );
-#else
+
if( mpMetaFile )
mpMetaFile->AddAction( new MetaPolyPolygonAction( PolyPolygon( rB2DPolyPoly ) ) );
-#endif
// call helper
ImpDrawPolyPolygonWithB2DPolyPolygon(rB2DPolyPoly);
@@ -2262,13 +2251,6 @@ void OutputDevice::DrawPolyLine(
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
(void)eLineJoin; // ATM used in UNX, but not in WNT, access it for warning-free
-#if 0 // MetaB2DPolyLineAction is not implemented yet:
- // according to AW adding it is very dangerous since there is a lot
- // of code that uses the metafile actions directly and unless every
- // place that does this knows about the new action we need to fallback
- if( mpMetaFile )
- mpMetaFile->AddAction( new MetaB2DPolyLineAction( rB2DPolygon ) );
-#else
if( mpMetaFile )
{
LineInfo aLineInfo;
@@ -2277,7 +2259,7 @@ void OutputDevice::DrawPolyLine(
const Polygon aToolsPolygon( rB2DPolygon );
mpMetaFile->AddAction( new MetaPolyLineAction( aToolsPolygon, aLineInfo ) );
}
-#endif
+
// AW: Do NOT paint empty PolyPolygons
if(!rB2DPolygon.count())
@@ -2708,3 +2690,5 @@ SystemGraphicsData OutputDevice::GetSystemGfxData() const
}
// -----------------------------------------------------------------------
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/outdev2.cxx b/vcl/source/gdi/outdev2.cxx
index 6d98f79dcaaa..f00ca53b400d 100755..100644
--- a/vcl/source/gdi/outdev2.cxx
+++ b/vcl/source/gdi/outdev2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/salbmp.hxx>
#include <vcl/salgdi.hxx>
#include <vcl/impbmp.hxx>
@@ -2268,3 +2267,5 @@ void OutputDevice::ImplPrintMask( const Bitmap& rMask, const Color& rMaskColor,
mpMetaFile = pOldMetaFile;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 10f618d6e7c1..fd399c6c0a11 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -607,10 +608,10 @@ Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang,
// No Name, than set all names
if ( !aFont.GetName().Len() )
{
- xub_StrLen nIndex = 0;
if ( nFlags & DEFAULTFONT_FLAGS_ONLYONE )
{
- //aFont.SetName( aSearch.GetToken( 0, ';', nIndex ) );
+ xub_StrLen nIndex = 0;
+
if( !pOutDev )
pOutDev = (const OutputDevice *)ImplGetSVData()->mpDefaultWin;
if( !pOutDev )
@@ -996,8 +997,8 @@ ImplFontEntry::~ImplFontEntry()
size_t ImplFontEntry::GFBCacheKey_Hash::operator()( const GFBCacheKey& rData ) const
{
- std::hash<sal_UCS4> a;
- std::hash<int > b;
+ boost::hash<sal_UCS4> a;
+ boost::hash<int > b;
return a(rData.first) ^ b(rData.second);
}
@@ -1394,16 +1395,6 @@ void ImplDevFontList::InitGenericGlyphFallback( void ) const
}
#endif
-#if defined(HDU_DEBUG)
- for( int i = 0; i < nMaxLevel; ++i )
- {
- ImplDevFontListData* pFont = pFallbackList[ i ];
- ByteString aFontName( pFont->GetFamilyName(), RTL_TEXTENCODING_UTF8 );
- fprintf( stderr, "GlyphFallbackFont[%d] (quality=%05d): \"%s\"\n",
- i, pFont->GetMinQuality(), aFontName.GetBuffer() );
- }
-#endif
-
mnFallbackCount = nMaxLevel;
mpFallbackList = pFallbackList;
}
@@ -1506,7 +1497,8 @@ void ImplDevFontList::Add( ImplFontData* pNewData )
pNewData->maMapNames = String();
bool bKeepNewData = false;
- for( xub_StrLen nMapNameIndex = 0; nMapNameIndex != STRING_NOTFOUND; )
+ xub_StrLen nMapNameIndex = 0;
+ while( true )
{
String aSearchName = pNewData->maName;
GetEnglishSearchFontName( aSearchName );
@@ -1524,7 +1516,7 @@ void ImplDevFontList::Add( ImplFontData* pNewData )
bKeepNewData = pFoundData->AddFontFace( pNewData );
- // add font alias if available
+ // add (another) font alias if available
// a font alias should never win against an original font with similar quality
if( aMapNames.Len() <= nMapNameIndex )
break;
@@ -2749,8 +2741,20 @@ ImplFontEntry* ImplFontCache::GetGlyphFallbackFont( ImplDevFontList* pFontList,
// e.g. PsPrint Arial->Helvetica for udiaeresis when Helvetica doesn't support it
if( nFallbackLevel >= 1)
{
- ImplDevFontListData* pFallbackData = pFontList->GetGlyphFallbackFont(
- rFontSelData, rMissingCodes, nFallbackLevel-1 );
+ ImplDevFontListData* pFallbackData = NULL;
+
+ //fdo#33898 If someone has EUDC installed then they really want that to
+ //be used as the first-choice glyph fallback seeing as it's filled with
+ //private area codes with don't make any sense in any other font so
+ //prioritise it here if it's available. Ideally we would remove from
+ //rMissingCodes all the glyphs which it is able to resolve as an
+ //optimization, but that's tricky to achieve cross-platform without
+ //sufficient heavy-weight code that's likely to undo the value of the
+ //optimization
+ if (nFallbackLevel == 1)
+ pFallbackData = pFontList->FindFontFamily(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EUDC")));
+ if (!pFallbackData)
+ pFallbackData = pFontList->GetGlyphFallbackFont(rFontSelData, rMissingCodes, nFallbackLevel-1);
// escape when there are no font candidates
if( !pFallbackData )
return NULL;
@@ -4432,7 +4436,6 @@ void OutputDevice::ImplDrawEmphasisMark( long nBaseX, long nX, long nY,
void OutputDevice::ImplDrawEmphasisMarks( SalLayout& rSalLayout )
{
- Color aOldColor = GetTextColor();
Color aOldLineColor = GetLineColor();
Color aOldFillColor = GetFillColor();
sal_Bool bOldMap = mbMap;
@@ -4849,7 +4852,6 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
if ( xHyph.is() )
{
sal_Unicode cAlternateReplChar = 0;
- sal_Unicode cAlternateExtraChar = 0;
i18n::Boundary aBoundary = xBI->getWordBoundary( aText, nBreakPos, rDefLocale, ::com::sun::star::i18n::WordType::DICTIONARY_WORD, sal_True );
// sal_uInt16 nWordStart = nBreakPos;
// sal_uInt16 nBreakPos_OLD = nBreakPos;
@@ -4923,8 +4925,6 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo,
if ( nTxtEnd > nTxtStart )
cAlternateReplChar = aAlt.GetChar( nAltStart );
- else
- cAlternateExtraChar = aAlt.GetChar( nAltStart );
nBreakPos = nWordStart + nTxtStart;
if ( cAlternateReplChar )
@@ -5092,12 +5092,6 @@ void OutputDevice::SetFont( const Font& rNewFont )
mpMetaFile->AddAction( new MetaTextFillColorAction( aFont.GetFillColor(), !aFont.IsTransparent() ) );
}
-#if (OSL_DEBUG_LEVEL > 2) || defined (HDU_DEBUG)
- fprintf( stderr, " OutputDevice::SetFont( name=\"%s\", h=%ld)\n",
- OUStringToOString( aFont.GetName(), RTL_TEXTENCODING_UTF8 ).getStr(),
- aFont.GetSize().Height() );
-#endif
-
if ( !maFont.IsSameInstance( aFont ) )
{
// Optimization MT/HDU: COL_TRANSPARENT means SetFont should ignore the font color,
@@ -6089,17 +6083,6 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
rLayoutArgs.PrepareFallback();
rLayoutArgs.mnFlags |= SAL_LAYOUT_FOR_FALLBACK;
-#if defined(HDU_DEBUG)
- {
- int nCharPos = -1;
- bool bRTL = false;
- fprintf(stderr,"OD:ImplLayout Glyph Fallback for");
- for( int i=0; i<8 && rLayoutArgs.GetNextPos( &nCharPos, &bRTL); ++i )
- fprintf(stderr," U+%04X", rLayoutArgs.mpStr[ nCharPos ] );
- fprintf(stderr,"\n");
- rLayoutArgs.ResetPos();
- }
-#endif
// get list of unicodes that need glyph fallback
int nCharPos = -1;
bool bRTL = false;
@@ -6148,16 +6131,6 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
}
}
-#if defined(HDU_DEBUG)
- {
- ByteString aOrigFontName( maFont.GetName(), RTL_TEXTENCODING_UTF8);
- ByteString aFallbackName( aFontSelData.mpFontData->GetFamilyName(),
- RTL_TEXTENCODING_UTF8);
- fprintf(stderr,"\tGlyphFallback[lvl=%d] \"%s\" -> \"%s\" (q=%d)\n",
- nFallbackLevel, aOrigFontName.GetBuffer(), aFallbackName.GetBuffer(),
- aFontSelData.mpFontData->GetQuality());
- }
-#endif
// TODO: try to get the metric data from the GFB's mpFontEntry
ImplFontMetricData aSubstituteMetric( aFontSelData );
@@ -8016,6 +7989,22 @@ sal_Bool OutputDevice::GetTextOutline( PolyPolygon& rPolyPoly,
return sal_True;
}
+bool OutputDevice::GetFontCapabilities( FontCapabilities& rFontCapabilities ) const
+{
+ // we need a graphics
+ if( !mpGraphics && !ImplGetGraphics() )
+ return false;
+
+ if( mbNewFont )
+ ImplNewFont();
+ if( mbInitFont )
+ ImplInitFont();
+ if( !mpFontEntry )
+ return false;
+
+ return mpGraphics->GetImplFontCapabilities(rFontCapabilities);
+}
+
// -----------------------------------------------------------------------
sal_Bool OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
@@ -8109,3 +8098,5 @@ xub_StrLen OutputDevice::HasGlyphs( const Font& rTempFont, const String& rStr,
}
// -----------------------------------------------------------------------
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx
index a18b7ff48413..91d8845c7788 100644
--- a/vcl/source/gdi/outdev4.cxx
+++ b/vcl/source/gdi/outdev4.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -174,42 +175,25 @@ void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect,
sal_Bool bMtf, const PolyPolygon* pClipPolyPoly )
{
// rotiertes BoundRect ausrechnen
- Rectangle aRect = rRect;
- aRect.Left()--;
- aRect.Top()--;
- aRect.Right()++;
- aRect.Bottom()++;
- sal_uInt16 nAngle = rGradient.GetAngle() % 3600;
- double fAngle = nAngle * F_PI1800;
- double fWidth = aRect.GetWidth();
- double fHeight = aRect.GetHeight();
- double fDX = fWidth * fabs( cos( fAngle ) ) +
- fHeight * fabs( sin( fAngle ) );
- double fDY = fHeight * fabs( cos( fAngle ) ) +
- fWidth * fabs( sin( fAngle ) );
- fDX = (fDX - fWidth) * 0.5 + 0.5;
- fDY = (fDY - fHeight) * 0.5 + 0.5;
- aRect.Left() -= (long)fDX;
- aRect.Right() += (long)fDX;
- aRect.Top() -= (long)fDY;
- aRect.Bottom() += (long)fDY;
+ Rectangle aRect;
+ Point aCenter;
+ sal_uInt16 nAngle = rGradient.GetAngle() % 3600;
+
+ rGradient.GetBoundRect( rRect, aRect, aCenter );
// Rand berechnen und Rechteck neu setzen
- Point aCenter = rRect.Center();
Rectangle aFullRect = aRect;
long nBorder = (long)rGradient.GetBorder() * aRect.GetHeight() / 100;
- sal_Bool bLinear;
// Rand berechnen und Rechteck neu setzen fuer linearen Farbverlauf
- if ( rGradient.GetStyle() == GRADIENT_LINEAR )
+ bool bLinear = (rGradient.GetStyle() == GRADIENT_LINEAR);
+ if ( bLinear )
{
- bLinear = sal_True;
aRect.Top() += nBorder;
}
// Rand berechnen und Rechteck neu setzen fuer axiale Farbverlauf
else
{
- bLinear = sal_False;
nBorder >>= 1;
aRect.Top() += nBorder;
@@ -429,7 +413,8 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
// Virtuelle Device werden auch ausgeklammert, da einige Treiber
// ansonsten zu langsam sind
PolyPolygon* pPolyPoly;
- Rectangle aRect( rRect );
+ Rectangle aRect;
+ Point aCenter;
Color aStartCol( rGradient.GetStartColor() );
Color aEndCol( rGradient.GetEndColor() );
long nStartRed = ( (long) aStartCol.GetRed() * rGradient.GetStartIntensity() ) / 100;
@@ -444,66 +429,13 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect,
long nStepCount = rGradient.GetSteps();
sal_uInt16 nAngle = rGradient.GetAngle() % 3600;
+ rGradient.GetBoundRect( rRect, aRect, aCenter );
+
if( (meRasterOp != ROP_OVERPAINT) || (meOutDevType != OUTDEV_WINDOW) || bMtf )
pPolyPoly = new PolyPolygon( 2 );
else
pPolyPoly = NULL;
- if( rGradient.GetStyle() == GRADIENT_SQUARE || rGradient.GetStyle() == GRADIENT_RECT )
- {
- const double fAngle = nAngle * F_PI1800;
- const double fWidth = aRect.GetWidth();
- const double fHeight = aRect.GetHeight();
- double fDX = fWidth * fabs( cos( fAngle ) ) + fHeight * fabs( sin( fAngle ) );
- double fDY = fHeight * fabs( cos( fAngle ) ) + fWidth * fabs( sin( fAngle ) );
-
- fDX = ( fDX - fWidth ) * 0.5 + 0.5;
- fDY = ( fDY - fHeight ) * 0.5 + 0.5;
-
- aRect.Left() -= (long) fDX;
- aRect.Right() += (long) fDX;
- aRect.Top() -= (long) fDY;
- aRect.Bottom() += (long) fDY;
- }
-
- Size aSize( aRect.GetSize() );
-
- if( rGradient.GetStyle() == GRADIENT_RADIAL )
- {
- // Radien-Berechnung fuer Kreis
- aSize.Width() = (long)(0.5 + sqrt((double)aSize.Width()*(double)aSize.Width() + (double)aSize.Height()*(double)aSize.Height()));
- aSize.Height() = aSize.Width();
- }
- else if( rGradient.GetStyle() == GRADIENT_ELLIPTICAL )
- {
- // Radien-Berechnung fuer Ellipse
- aSize.Width() = (long)( 0.5 + (double) aSize.Width() * 1.4142 );
- aSize.Height() = (long)( 0.5 + (double) aSize.Height() * 1.4142 );
- }
- else if( rGradient.GetStyle() == GRADIENT_SQUARE )
- {
- if ( aSize.Width() > aSize.Height() )
- aSize.Height() = aSize.Width();
- else
- aSize.Width() = aSize.Height();
- }
-
- // neue Mittelpunkte berechnen
- long nZWidth = aRect.GetWidth() * (long) rGradient.GetOfsX() / 100;
- long nZHeight = aRect.GetHeight() * (long) rGradient.GetOfsY() / 100;
- long nBorderX = (long) rGradient.GetBorder() * aSize.Width() / 100;
- long nBorderY = (long) rGradient.GetBorder() * aSize.Height() / 100;
- Point aCenter( aRect.Left() + nZWidth, aRect.Top() + nZHeight );
-
- // Rand beruecksichtigen
- aSize.Width() -= nBorderX;
- aSize.Height() -= nBorderY;
-
- // Ausgaberechteck neu setzen
- aRect.Left() = aCenter.X() - ( aSize.Width() >> 1 );
- aRect.Top() = aCenter.Y() - ( aSize.Height() >> 1 );
-
- aRect.SetSize( aSize );
long nMinRect = Min( aRect.GetWidth(), aRect.GetHeight() );
// Anzahl der Schritte berechnen, falls nichts uebergeben wurde
@@ -1419,3 +1351,5 @@ void OutputDevice::ImplDrawHatchLine( const Line& rLine, const PolyPolygon& rPol
}
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/outdev5.cxx b/vcl/source/gdi/outdev5.cxx
index 627f75e88282..539ecc0fa091 100644
--- a/vcl/source/gdi/outdev5.cxx
+++ b/vcl/source/gdi/outdev5.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include "precompiled_vcl.hxx"
#include <tools/ref.hxx>
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/salgdi.hxx>
#include <tools/debug.hxx>
#include <vcl/svdata.hxx>
@@ -311,3 +310,5 @@ void OutputDevice::DrawChord( const Rectangle& rRect,
if( mpAlphaVDev )
mpAlphaVDev->DrawChord( rRect, rStartPt, rEndPt );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx
index eb4b76fb4b41..4b63c47eca83 100644
--- a/vcl/source/gdi/outdev6.cxx
+++ b/vcl/source/gdi/outdev6.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/salgdi.hxx>
#include <tools/debug.hxx>
#include <vcl/outdev.h>
@@ -210,17 +209,8 @@ void OutputDevice::DrawTransparent( const basegfx::B2DPolyPolygon& rB2DPolyPoly,
if( bDrawnOk )
{
-#if 0
- // MetaB2DPolyPolygonAction is not implemented yet:
- // according to AW adding it is very dangerous since there is a lot
- // of code that uses the metafile actions directly and unless every
- // place that does this knows about the new action we need to fallback
- if( mpMetaFile )
- mpMetaFile->AddAction( new MetaB2DPolyPolygonAction( rB2DPolyPoly ) );
-#else
if( mpMetaFile )
mpMetaFile->AddAction( new MetaTransparentAction( PolyPolygon( rB2DPolyPoly ), static_cast< sal_uInt16 >(fTransparency * 100.0)));
-#endif
return;
}
}
@@ -721,6 +711,8 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
pVDev->EnableMapMode(false);
const AlphaMask aAlpha(pVDev->GetBitmap(aPoint, pVDev->GetOutputSizePixel()));
+ delete pVDev;
+
// draw masked content to target and restore MapMode
DrawBitmapEx(aDstRect.TopLeft(), BitmapEx(aPaint, aAlpha));
EnableMapMode(bOrigMapModeEnabled);
@@ -1245,3 +1237,5 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
return bDrawn;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/outdevnative.cxx b/vcl/source/gdi/outdevnative.cxx
index cb472762338b..8c2fa869378e 100755
--- a/vcl/source/gdi/outdevnative.cxx
+++ b/vcl/source/gdi/outdevnative.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -218,7 +219,6 @@ static boost::shared_ptr< ImplControlValue > lcl_transformControlValue( const Im
}
return aResult;
}
-
sal_Bool OutputDevice::DrawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
@@ -335,3 +335,4 @@ sal_Bool OutputDevice::GetNativeControlRegion( ControlType nType,
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/outmap.cxx b/vcl/source/gdi/outmap.cxx
index 1bdd86e13ecb..a0b2c6521aac 100644
--- a/vcl/source/gdi/outmap.cxx
+++ b/vcl/source/gdi/outmap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <limits.h>
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <tools/bigint.hxx>
#include <tools/debug.hxx>
#include <vcl/virdev.hxx>
@@ -53,8 +52,6 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
-#define USE_64BIT_INTS
-
// =======================================================================
DBG_NAMEEX( OutputDevice )
@@ -175,12 +172,10 @@ static void ImplCalcBigIntThreshold( long nDPIX, long nDPIY,
rThresRes.mnThresPixToLogY = (long)(((sal_uLong)LONG_MAX + (sal_uLong)(-nProductY/2)) / nDenomY);
}
-#ifdef USE_64BIT_INTS
rThresRes.mnThresLogToPixX /= 2;
rThresRes.mnThresLogToPixY /= 2;
rThresRes.mnThresPixToLogX /= 2;
rThresRes.mnThresPixToLogY /= 2;
-#endif
}
// -----------------------------------------------------------------------
@@ -284,7 +279,7 @@ static void ImplCalcMapResolution( const MapMode& rMapMode,
}
break;
default:
- DBG_ERROR( "unhandled MapUnit" );
+ OSL_FAIL( "unhandled MapUnit" );
break;
}
@@ -384,7 +379,6 @@ static long ImplLogicToPixel( long n, long nDPI, long nMapNum, long nMapDenom,
{
// To "use" it...
(void) nThres;
-#ifdef USE_64BIT_INTS
#if (SAL_TYPES_SIZEOFLONG < 8)
if( (+n < nThres) && (-n < nThres) )
{
@@ -412,34 +406,6 @@ static long ImplLogicToPixel( long n, long nDPI, long nMapNum, long nMapDenom,
}
}
return n;
-#else // USE_64BIT_INTS
- if ( Abs( n ) < nThres )
- {
- n *= nDPI * nMapNum;
- n += n >= 0 ? nMapDenom/2 : -((nMapDenom-1)/2);
- return (n / nMapDenom);
- }
- else
- {
- BigInt aTemp( n );
- aTemp *= BigInt( nDPI );
- aTemp *= BigInt( nMapNum );
-
- if ( aTemp.IsNeg() )
- {
- BigInt aMapScDenom2( (nMapDenom-1)/2 );
- aTemp -= aMapScDenom2;
- }
- else
- {
- BigInt aMapScDenom2( nMapDenom/2 );
- aTemp += aMapScDenom2;
- }
-
- aTemp /= BigInt( nMapDenom );
- return (long)aTemp;
- }
-#endif
}
// -----------------------------------------------------------------------
@@ -449,7 +415,6 @@ static long ImplPixelToLogic( long n, long nDPI, long nMapNum, long nMapDenom,
{
// To "use" it...
(void) nThres;
-#ifdef USE_64BIT_INTS
#if (SAL_TYPES_SIZEOFLONG < 8)
if( (+n < nThres) && (-n < nThres) )
n = (2 * n * nMapDenom) / (nDPI * nMapNum);
@@ -463,59 +428,6 @@ static long ImplPixelToLogic( long n, long nDPI, long nMapNum, long nMapDenom,
}
if( n < 0 ) --n; else ++n;
return (n / 2);
-#else // USE_64BIT_INTS
- if ( Abs( n ) < nThres )
- {
- long nDenom = nDPI * nMapNum;
- long nNum = n * nMapDenom;
- if( (nNum ^ nDenom) >= 0 )
- nNum += nDenom/2;
- else
- nNum -= nDenom/2;
- return (nNum / nDenom);
- }
- else
- {
- BigInt aDenom( nDPI );
- aDenom *= BigInt( nMapNum );
-
- BigInt aNum( n );
- aNum *= BigInt( nMapDenom );
-
- BigInt aDenom2( aDenom );
- if ( aNum.IsNeg() )
- {
- if ( aDenom.IsNeg() )
- {
- aDenom2 /= BigInt(2);
- aNum += aDenom2;
- }
- else
- {
- aDenom2 -= 1;
- aDenom2 /= BigInt(2);
- aNum -= aDenom2;
- }
- }
- else
- {
- if ( aDenom.IsNeg() )
- {
- aDenom2 += 1;
- aDenom2 /= BigInt(2);
- aNum -= aDenom2;
- }
- else
- {
- aDenom2 /= BigInt(2);
- aNum += aDenom2;
- }
- }
-
- aNum /= aDenom;
- return (long)aNum;
- }
-#endif
}
// -----------------------------------------------------------------------
@@ -2505,3 +2417,5 @@ long Window::ImplLogicUnitToPixelY( long nY, MapUnit eUnit )
return nY;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx
index 77458d2b26fd..2b3173c4b128 100644
--- a/vcl/source/gdi/pdfextoutdevdata.cxx
+++ b/vcl/source/gdi/pdfextoutdevdata.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -399,7 +400,7 @@ sal_Bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIM
}
break;
}
- aBeg++;
+ ++aBeg;
}
}
break;
@@ -410,13 +411,11 @@ sal_Bool PageSyncData::PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIM
break;
case PDFExtOutDevDataSync::EndGroupGfxLink :
{
- sal_Int32 nTransparency;
Rectangle aOutputRect, aVisibleOutputRect;
Graphic aGraphic( mGraphics.front() );
mGraphics.pop_front();
- nTransparency = mParaInts.front();
- mParaInts.pop_front();
+ mParaInts.pop_front(); //Transparency
aOutputRect = mParaRects.front();
mParaRects.pop_front();
aVisibleOutputRect = mParaRects.front();
@@ -796,3 +795,5 @@ void PDFExtOutDevData::EndGroup( const Graphic& rGraphic,
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/pdffontcache.cxx b/vcl/source/gdi/pdffontcache.cxx
index 507ede81ef24..2b5944377eac 100644
--- a/vcl/source/gdi/pdffontcache.cxx
+++ b/vcl/source/gdi/pdffontcache.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -83,3 +84,4 @@ sal_Int32 PDFFontCache::getGlyphWidth( const ImplFontData* pFont, sal_GlyphId nG
return nWidth;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/pdffontcache.hxx b/vcl/source/gdi/pdffontcache.hxx
index 06ffff86b070..30d075d23e42 100644
--- a/vcl/source/gdi/pdffontcache.hxx
+++ b/vcl/source/gdi/pdffontcache.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -79,3 +80,5 @@ namespace vcl
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/pdfwriter.cxx b/vcl/source/gdi/pdfwriter.cxx
index 445365e83dd4..881205e0af77 100644
--- a/vcl/source/gdi/pdfwriter.cxx
+++ b/vcl/source/gdi/pdfwriter.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -574,3 +575,4 @@ void PDFWriter::PlayMetafile( const GDIMetaFile& i_rMTF, const vcl::PDFWriter::P
((PDFWriterImpl*)pImplementation)->playMetafile( i_rMTF, i_pData, i_rPlayContext, NULL);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 4a37d3a5d601..1373d0f9b280 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,7 +72,14 @@
#include "vcl/strhelper.hxx"
using namespace vcl;
-using namespace rtl;
+
+using ::rtl::OUString;
+using ::rtl::OUStringToOString;
+using ::rtl::OString;
+using ::rtl::OStringHash;
+using ::rtl::OUStringHash;
+using ::rtl::OStringBuffer;
+using ::rtl::OUStringBuffer;
#if (OSL_DEBUG_LEVEL < 2)
#define COMPRESS_PAGES
@@ -701,7 +709,7 @@ void PDFWriterImpl::createWidgetFieldName( sal_Int32 i_nWidgetIndex, const PDFWr
// find or create a hierarchical field
// first find the fully qualified name up to this field
aDomain = aFullName.copy( 0, nTokenIndex-1 );
- std::hash_map< rtl::OString, sal_Int32, rtl::OStringHash >::const_iterator it = m_aFieldNameMap.find( aDomain );
+ boost::unordered_map< rtl::OString, sal_Int32, rtl::OStringHash >::const_iterator it = m_aFieldNameMap.find( aDomain );
if( it == m_aFieldNameMap.end() )
{
// create new hierarchy field
@@ -762,7 +770,7 @@ void PDFWriterImpl::createWidgetFieldName( sal_Int32 i_nWidgetIndex, const PDFWr
// insert widget into its hierarchy field
if( aDomain.getLength() )
{
- std::hash_map< rtl::OString, sal_Int32, rtl::OStringHash >::const_iterator it = m_aFieldNameMap.find( aDomain );
+ boost::unordered_map< rtl::OString, sal_Int32, rtl::OStringHash >::const_iterator it = m_aFieldNameMap.find( aDomain );
if( it != m_aFieldNameMap.end() )
{
OSL_ENSURE( it->second >= 0 && it->second < sal_Int32( m_aWidgets.size() ), "invalid field index" );
@@ -789,11 +797,11 @@ void PDFWriterImpl::createWidgetFieldName( sal_Int32 i_nWidgetIndex, const PDFWr
if( ! m_aContext.AllowDuplicateFieldNames )
{
- std::hash_map<OString, sal_Int32, OStringHash>::iterator it = m_aFieldNameMap.find( aFullName );
+ boost::unordered_map<OString, sal_Int32, OStringHash>::iterator it = m_aFieldNameMap.find( aFullName );
if( it != m_aFieldNameMap.end() ) // not unique
{
- std::hash_map< OString, sal_Int32, OStringHash >::const_iterator check_it;
+ boost::unordered_map< OString, sal_Int32, OStringHash >::const_iterator check_it;
OString aTry;
sal_Int32 nTry = 2;
do
@@ -1240,11 +1248,6 @@ bool PDFWriterImpl::PDFPage::emit(sal_Int32 nParentObject )
}
aLine.append( "]\n" );
}
- #if 0
- // FIXME: implement tab order as Structure Tree
- if( m_bHasWidgets && m_pWriter->getVersion() >= PDFWriter::PDF_1_5 )
- aLine.append( " /Tabs /S\n" );
- #endif
if( m_aMCIDParents.size() > 0 )
{
OStringBuffer aStructParents( 1024 );
@@ -2266,7 +2269,7 @@ ImplDevFontList* PDFWriterImpl::filterDevFontList( ImplDevFontList* pFontList )
// append the PDF builtin fonts
if( !m_bIsPDF_A1 && !m_bEmbedStandardFonts)
- for( unsigned int i = 0; i < sizeof(m_aBuiltinFonts)/sizeof(m_aBuiltinFonts[0]); i++ )
+ for( unsigned int i = 0; i < SAL_N_ELEMENTS(m_aBuiltinFonts); i++ )
{
ImplFontData* pNewData = new ImplPdfBuiltinFontData( m_aBuiltinFonts[i] );
pFiltered->Add( pNewData );
@@ -2462,7 +2465,7 @@ void PDFWriterImpl::endPage()
// sanity check
if( m_aOutputStreams.begin() != m_aOutputStreams.end() )
{
- DBG_ERROR( "redirection across pages !!!" );
+ OSL_FAIL( "redirection across pages !!!" );
m_aOutputStreams.clear(); // leak !
m_aMapMode.SetOrigin( Point() );
}
@@ -2713,7 +2716,7 @@ OString PDFWriterImpl::emitStructureAttributes( PDFStructureElement& i_rEle )
}
else
{
- DBG_ERROR( "unresolved link id for Link structure" );
+ OSL_FAIL( "unresolved link id for Link structure" );
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "unresolved link id %" SAL_PRIdINT32 " for Link structure\n", nLink );
{
@@ -2814,7 +2817,7 @@ sal_Int32 PDFWriterImpl::emitStructure( PDFStructureElement& rEle )
emitStructure( rChild );
else
{
- DBG_ERROR( "PDFWriterImpl::emitStructure: invalid child structure element" );
+ OSL_FAIL( "PDFWriterImpl::emitStructure: invalid child structure element" );
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "PDFWriterImpl::emitStructure: invalid child structure elemnt with id %" SAL_PRIdINT32 "\n", *it );
#endif
@@ -2823,7 +2826,7 @@ sal_Int32 PDFWriterImpl::emitStructure( PDFStructureElement& rEle )
}
else
{
- DBG_ERROR( "PDFWriterImpl::emitStructure: invalid child structure id" );
+ OSL_FAIL( "PDFWriterImpl::emitStructure: invalid child structure id" );
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "PDFWriterImpl::emitStructure: invalid child structure id %" SAL_PRIdINT32 "\n", *it );
#endif
@@ -2846,7 +2849,7 @@ sal_Int32 PDFWriterImpl::emitStructure( PDFStructureElement& rEle )
if( ! m_aRoleMap.empty() )
{
aLine.append( "/RoleMap<<" );
- for( std::hash_map<OString,OString,OStringHash>::const_iterator
+ for( boost::unordered_map<OString,OString,OStringHash>::const_iterator
it = m_aRoleMap.begin(); it != m_aRoleMap.end(); ++it )
{
aLine.append( '/' );
@@ -3090,7 +3093,6 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const ImplFontDa
return aRet;
}
- sal_Int32 nFontObject = 0;
sal_Int32 nFontDescriptor = 0;
rtl::OString aSubType( "/Type1" );
FontSubsetInfo aInfo;
@@ -3153,7 +3155,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const ImplFontDa
}
else
{
- DBG_ERROR( "system font neither embeddable nor subsettable" );
+ OSL_FAIL( "system font neither embeddable nor subsettable" );
}
// write font descriptor
@@ -3188,7 +3190,6 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const ImplFontDa
"endobj\n\n" );
writeBuffer( aLine.getStr(), aLine.getLength() );
- nFontObject = nObject;
aRet[ rEmbed.m_nNormalFontID ] = nObject;
}
}
@@ -3241,7 +3242,6 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
return aRet;
}
- sal_Int32 nFontObject = 0;
sal_Int32 nStreamObject = 0;
sal_Int32 nFontDescriptor = 0;
@@ -3657,7 +3657,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
if( nFontDescriptor )
{
if( pEncoding )
- nToUnicodeStream = createToUnicodeCMap( nEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, sizeof(nEncoding)/sizeof(nEncoding[0]) );
+ nToUnicodeStream = createToUnicodeCMap( nEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, SAL_N_ELEMENTS(nEncoding) );
// write font object
sal_Int32 nObject = createObject();
@@ -3693,8 +3693,6 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) )
throw FontException();
- nFontObject = nObject;
-
aRet[ rEmbed.m_nNormalFontID ] = nObject;
// write additional encodings
@@ -3987,7 +3985,7 @@ sal_Int32 PDFWriterImpl::emitFontDescriptor( const ImplFontData* pFont, FontSubs
case FontSubsetInfo::ANY_TYPE1:
break;
default:
- DBG_ERROR( "unknown fonttype in PDF font descriptor" );
+ OSL_FAIL( "unknown fonttype in PDF font descriptor" );
return 0;
}
aLine.append( ' ' );
@@ -4062,7 +4060,7 @@ bool PDFWriterImpl::emitFonts()
nGlyphs++;
else
{
- DBG_ERROR( "too many glyphs for subset" );
+ OSL_FAIL( "too many glyphs for subset" );
}
}
FontSubsetInfo aSubsetInfo;
@@ -4120,7 +4118,7 @@ bool PDFWriterImpl::emitFonts()
else if( (aSubsetInfo.m_nFontType & FontSubsetInfo::CFF_FONT) != 0 )
{
// TODO: implement
- DBG_ERROR( "PDFWriterImpl does not support CFF-font subsets yet!" );
+ OSL_FAIL( "PDFWriterImpl does not support CFF-font subsets yet!" );
}
else if( (aSubsetInfo.m_nFontType & FontSubsetInfo::TYPE1_PFB) != 0 ) // TODO: also support PFA?
{
@@ -4583,7 +4581,6 @@ we check in the following sequence:
// extract target file type
INetURLObject aDocumentURL( m_aContext.BaseURL );
INetURLObject aTargetURL( rLink.m_aURL );
- sal_Int32 nChangeFileExtensionToPDF = 0;
sal_Int32 nSetGoToRMode = 0;
sal_Bool bTargetHasPDFExtension = sal_False;
INetProtocol eTargetProtocol = aTargetURL.GetProtocol();
@@ -4622,18 +4619,19 @@ we check in the following sequence:
{
if( m_aContext.ConvertOOoTargetToPDFTarget )
{
-//examine the file type (.odm .odt. .odp, odg, ods)
+ sal_Int32 bChangeFileExtensionToPDF = false;
+ //examine the file type (.odm .odt. .odp, odg, ods)
if( aFileExtension.equalsIgnoreAsciiCase(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "odm" ) ) ) )
- nChangeFileExtensionToPDF++;
+ bChangeFileExtensionToPDF = true;
if( aFileExtension.equalsIgnoreAsciiCase(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "odt" ) ) ) )
- nChangeFileExtensionToPDF++;
+ bChangeFileExtensionToPDF = true;
else if( aFileExtension.equalsIgnoreAsciiCase(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "odp" ) ) ) )
- nChangeFileExtensionToPDF++;
+ bChangeFileExtensionToPDF = true;
else if( aFileExtension.equalsIgnoreAsciiCase(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "odg" ) ) ) )
- nChangeFileExtensionToPDF++;
+ bChangeFileExtensionToPDF = true;
else if( aFileExtension.equalsIgnoreAsciiCase(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ods" ) ) ) )
- nChangeFileExtensionToPDF++;
- if( nChangeFileExtensionToPDF )
+ bChangeFileExtensionToPDF = true;
+ if( bChangeFileExtensionToPDF )
aTargetURL.setExtension(rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "pdf" ) ) );
}
//check if extension is pdf, see if GoToR should be forced
@@ -4680,7 +4678,9 @@ we check in the following sequence:
// and will force the use of URI when the protocol is not file://
if( (aFragment.getLength() > 0 && !bTargetHasPDFExtension) ||
eTargetProtocol != INET_PROT_FILE )
+ {
aLine.append( "/URI/URI" );
+ }
else
{
aLine.append( "/Launch/F" );
@@ -4691,7 +4691,8 @@ we check in the following sequence:
}
//fragment are encoded in the same way as in the named destination processing
if( nSetGoToRMode )
- {//add the fragment
+ {
+ //add the fragment
rtl::OUString aURLNoMark = aTargetURL.GetURLNoMark( INetURLObject::DECODE_WITH_CHARSET );
aLine.append("/GoToR");
aLine.append("/F");
@@ -4719,15 +4720,11 @@ we check in the following sequence:
aTargetURL.SetMark( aLineLoc.getStr() );
}
rtl::OUString aURL = aTargetURL.GetMainURL( bFileSpec ? INetURLObject::DECODE_WITH_CHARSET : INetURLObject::NO_DECODE );
-// check if we have a URL available, if the string is empty, set it as the original one
-// if( aURL.getLength() == 0 )
-// appendLiteralStringEncrypt( rLink.m_aURL , rLink.m_nObject, aLine );
-// else
- appendLiteralStringEncrypt( bSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURL,
- INetURLObject::WAS_ENCODED,
+ appendLiteralStringEncrypt(bSetRelative ? INetURLObject::GetRelURL( m_aContext.BaseURL, aURL,
+ INetURLObject::WAS_ENCODED,
bFileSpec ? INetURLObject::DECODE_WITH_CHARSET : INetURLObject::NO_DECODE
) :
- aURL , rLink.m_nObject, aLine, osl_getThreadTextEncoding() );
+ aURL , rLink.m_nObject, aLine, osl_getThreadTextEncoding() );
}
//<--- i56629
}
@@ -5031,22 +5028,6 @@ void PDFWriterImpl::createDefaultListBoxAppearance( PDFWidget& rBox, const PDFWr
beginRedirect( pListBoxStream, rBox.m_aRect );
OStringBuffer aAppearance( 64 );
-#if 0
- if( ! rWidget.DropDown )
- {
- // prepare linewidth for DA string hack, see below
- Size aFontSize = lcl_convert( m_aGraphicsStack.front().m_aMapMode,
- m_aMapMode,
- getReferenceDevice(),
- Size( 0, aFont.GetHeight() ) );
- sal_Int32 nLW = aFontSize.Height() / 40;
- appendFixedInt( nLW > 0 ? nLW : 1, aAppearance );
- aAppearance.append( " w\n" );
- writeBuffer( aAppearance.getStr(), aAppearance.getLength() );
- aAppearance.setLength( 0 );
- }
-#endif
-
setLineColor( Color( COL_TRANSPARENT ) );
setFillColor( replaceColor( rWidget.BackgroundColor, rSettings.GetFieldColor() ) );
drawRectangle( rBox.m_aRect );
@@ -5062,18 +5043,6 @@ void PDFWriterImpl::createDefaultListBoxAppearance( PDFWidget& rBox, const PDFWr
// prepare DA string
OStringBuffer aDA( 256 );
-#if 0
- if( !rWidget.DropDown )
- {
- /* another of AR5's peculiarities: the selected item of a choice
- field is highlighted using the non stroking color - same as the
- text color. so workaround that by using text rendering mode 2
- (fill, then stroke) and set the stroking color
- */
- appendStrokingColor( replaceColor( rWidget.BackgroundColor, rSettings.GetFieldColor() ), aDA );
- aDA.append( " 2 Tr " );
- }
-#endif
// prepare DA string
appendNonStrokingColor( replaceColor( rWidget.TextColor, rSettings.GetFieldTextColor() ), aDA );
aDA.append( ' ' );
@@ -6649,7 +6618,7 @@ void PDFWriterImpl::sortWidgets()
{
// sort widget annotations on each page as per their
// TabOrder attribute
- std::hash_map< sal_Int32, AnnotSortContainer > sorted;
+ boost::unordered_map< sal_Int32, AnnotSortContainer > sorted;
int nWidgets = m_aWidgets.size();
for( int nW = 0; nW < nWidgets; nW++ )
{
@@ -6669,7 +6638,7 @@ void PDFWriterImpl::sortWidgets()
}
}
}
- for( std::hash_map< sal_Int32, AnnotSortContainer >::iterator it = sorted.begin(); it != sorted.end(); ++it )
+ for( boost::unordered_map< sal_Int32, AnnotSortContainer >::iterator it = sorted.begin(); it != sorted.end(); ++it )
{
// append entries for non widget annotations
PDFPage& rPage = m_aPages[ it->first ];
@@ -7797,7 +7766,6 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const String& rOrigStr, sa
XubString aLastLine;
ImplMultiTextLineInfo aMultiLineInfo;
ImplTextLineInfo* pLineInfo;
- long nMaxTextWidth;
xub_StrLen i;
xub_StrLen nLines;
xub_StrLen nFormatLines;
@@ -7805,7 +7773,7 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const String& rOrigStr, sa
if ( nTextHeight )
{
::vcl::DefaultTextLayout aLayout( *m_pReferenceDevice );
- nMaxTextWidth = OutputDevice::ImplGetTextLines( aMultiLineInfo, nWidth, aStr, nStyle, aLayout );
+ OutputDevice::ImplGetTextLines( aMultiLineInfo, nWidth, aStr, nStyle, aLayout );
nLines = (xub_StrLen)(nHeight/nTextHeight);
nFormatLines = aMultiLineInfo.Count();
if ( !nLines )
@@ -9305,11 +9273,6 @@ bool PDFWriterImpl::writeTransparentObject( TransparencyEmit& rObject )
* resource dict anyway, let's use the one from the page by NOT
* emitting a Resources entry.
*/
- #if 0
- aLine.append( " /Resources " );
- aLine.append( getResourceDictObj() );
- aLine.append( " 0 R\n" );
- #endif
aLine.append( "/Length " );
aLine.append( (sal_Int32)(nSize) );
@@ -9384,12 +9347,6 @@ bool PDFWriterImpl::writeTransparentObject( TransparencyEmit& rObject )
aMask.append( "]\n" );
/* #i42884# see above */
-#if 0
- aLine.append( "/Resources " );
- aMask.append( getResourceDictObj() );
- aMask.append( " 0 R\n" );
-#endif
-
aMask.append( "/Group<</S/Transparency/CS/DeviceRGB>>\n" );
aMask.append( "/Length " );
aMask.append( nMaskSize );
@@ -11117,11 +11074,11 @@ sal_Int32 PDFWriterImpl::beginStructureElement( PDFWriter::StructElement eType,
DBG_ASSERT( 0, "Structure element inserted to StructTreeRoot that is not a document" );
}
else {
- DBG_ERROR( "document structure in disorder !" );
+ OSL_FAIL( "document structure in disorder !" );
}
}
else {
- DBG_ERROR( "PDF document structure MUST be contained in a Document element" );
+ OSL_FAIL( "PDF document structure MUST be contained in a Document element" );
}
}
@@ -11239,7 +11196,7 @@ void PDFWriterImpl::addInternalStructureContainer( PDFStructureElement& rEle )
addInternalStructureContainer( rChild );//examine the child
else
{
- DBG_ERROR( "PDFWriterImpl::addInternalStructureContainer: invalid child structure element" );
+ OSL_FAIL( "PDFWriterImpl::addInternalStructureContainer: invalid child structure element" );
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "PDFWriterImpl::addInternalStructureContainer: invalid child structure elemnt with id %" SAL_PRIdINT32 "\n", *it );
#endif
@@ -11248,7 +11205,7 @@ void PDFWriterImpl::addInternalStructureContainer( PDFStructureElement& rEle )
}
else
{
- DBG_ERROR( "PDFWriterImpl::emitStructure: invalid child structure id" );
+ OSL_FAIL( "PDFWriterImpl::emitStructure: invalid child structure id" );
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "PDFWriterImpl::addInternalStructureContainer: invalid child structure id %" SAL_PRIdINT32 "\n", *it );
#endif
@@ -11751,7 +11708,7 @@ void PDFWriterImpl::ensureUniqueRadioOnValues()
{
PDFWidget& rGroupWidget = m_aWidgets[ group->second ];
// check whether all kids have a unique OnValue
- std::hash_map< OUString, sal_Int32, OUStringHash > aOnValues;
+ boost::unordered_map< OUString, sal_Int32, OUStringHash > aOnValues;
int nChildren = rGroupWidget.m_aKidsIndex.size();
bool bIsUnique = true;
for( int nKid = 0; nKid < nChildren && bIsUnique; nKid++ )
@@ -11781,7 +11738,7 @@ void PDFWriterImpl::ensureUniqueRadioOnValues()
int nKidIndex = rGroupWidget.m_aKidsIndex[nKid];
PDFWidget& rKid = m_aWidgets[nKidIndex];
rKid.m_aOnValue = OUString::valueOf( sal_Int32(nKid+1) );
- if( ! rKid.m_aValue.equalsAscii( "Off" ) )
+ if( ! rKid.m_aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Off" ) ) )
rKid.m_aValue = rKid.m_aOnValue;
}
}
@@ -11808,7 +11765,7 @@ void PDFWriterImpl::ensureUniqueRadioOnValues()
#endif
}
// update selected radio button
- if( ! rKid.m_aValue.equalsAscii( "Off" ) )
+ if( ! rKid.m_aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Off" ) ) )
{
rGroupWidget.m_aValue = rKid.m_aValue;
}
@@ -11942,7 +11899,7 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
rNewWidget.m_nTextStyle =
TEXT_DRAW_VCENTER | TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK;
- rNewWidget.m_aValue = OUString::createFromAscii( rBox.Checked ? "Yes" : "Off" );
+ rNewWidget.m_aValue = rBox.Checked ? OUString(RTL_CONSTASCII_USTRINGPARAM("Yes")) : OUString(RTL_CONSTASCII_USTRINGPARAM("Off" ));
// create default appearance before m_aRect gets transformed
createDefaultCheckBoxAppearance( rNewWidget, rBox );
}
@@ -12141,3 +12098,4 @@ void PDFWriterImpl::addStream( const String& rMimeType, PDFOutputStream* pStream
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx
index c73be7c037e5..09459e40a896 100644
--- a/vcl/source/gdi/pdfwriter_impl.hxx
+++ b/vcl/source/gdi/pdfwriter_impl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -43,13 +44,14 @@
#include "rtl/digest.h"
#include "com/sun/star/util/XURLTransformer.hpp"
#include "com/sun/star/lang/Locale.hpp"
+#include <sal/macros.h>
#include <vcl/sallayout.hxx>
#include "pdffontcache.hxx"
#include <vector>
#include <map>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <list>
#include <boost/shared_array.hpp>
@@ -201,7 +203,7 @@ public:
return *this;
}
- bool operator==( const BitmapID& rComp )
+ bool operator==( const BitmapID& rComp ) const
{
return (m_aPixelSize == rComp.m_aPixelSize &&
m_nSize == rComp.m_nSize &&
@@ -228,7 +230,7 @@ public:
sal_Int32 m_nObject;
bool m_bTrueColor;
- JPGEmit() : m_pStream( NULL ) {}
+ JPGEmit() : m_pStream( NULL ), m_bTrueColor( false ) {}
~JPGEmit() { delete m_pStream; }
};
@@ -293,7 +295,7 @@ public:
GlyphEmit() : m_nUnicodes(0), m_nSubsetGlyphID(0)
{
rtl_zeroMemory( m_aBufferedUnicodes, sizeof( m_aBufferedUnicodes ) );
- m_nMaxUnicodes = sizeof(m_aBufferedUnicodes)/sizeof(m_aBufferedUnicodes[0]);
+ m_nMaxUnicodes = SAL_N_ELEMENTS(m_aBufferedUnicodes);
}
~GlyphEmit()
{
@@ -439,8 +441,8 @@ public:
{}
};
- typedef std::hash_map< rtl::OString, SvMemoryStream*, rtl::OStringHash > PDFAppearanceStreams;
- typedef std::hash_map< rtl::OString, PDFAppearanceStreams, rtl::OStringHash > PDFAppearanceMap;
+ typedef boost::unordered_map< rtl::OString, SvMemoryStream*, rtl::OStringHash > PDFAppearanceStreams;
+ typedef boost::unordered_map< rtl::OString, PDFAppearanceStreams, rtl::OStringHash > PDFAppearanceMap;
struct PDFWidget : public PDFAnnotation
{
@@ -644,7 +646,7 @@ private:
bool m_bEmitStructure;
bool m_bNewMCID;
/* role map of struct tree root */
- std::hash_map< rtl::OString, rtl::OString, rtl::OStringHash >
+ boost::unordered_map< rtl::OString, rtl::OString, rtl::OStringHash >
m_aRoleMap;
/* contains all widgets used in the PDF
@@ -654,8 +656,8 @@ private:
std::map< sal_Int32, sal_Int32 > m_aRadioGroupWidgets;
/* used to store control id during beginControlAppearance/endControlAppearance */
sal_Int32 m_nCurrentControl;
- /* hash_map for field names, used to ensure unique field names */
- std::hash_map< rtl::OString, sal_Int32, rtl::OStringHash > m_aFieldNameMap;
+ /* boost::unordered_map for field names, used to ensure unique field names */
+ boost::unordered_map< rtl::OString, sal_Int32, rtl::OStringHash > m_aFieldNameMap;
/* contains Bitmaps for gradient functions until they are written
* to the file stream */
@@ -1334,3 +1336,4 @@ public:
#endif //_VCL_PDFEXPORT_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx
index ac6116e38234..66e3cd1bea1a 100644
--- a/vcl/source/gdi/pngread.cxx
+++ b/vcl/source/gdi/pngread.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -157,7 +158,6 @@ private:
bool ReadNextChunk();
void ReadRemainingChunks();
- void SkipRemainingChunks();
void ImplSetPixel( sal_uInt32 y, sal_uInt32 x, const BitmapColor & );
void ImplSetPixel( sal_uInt32 y, sal_uInt32 x, sal_uInt8 nPalIndex );
@@ -200,7 +200,9 @@ PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream )
mpInflateInBuf ( NULL ),
mpScanPrior ( NULL ),
mpTransTab ( NULL ),
+ mpScanCurrent ( NULL ),
mpColorTable ( (sal_uInt8*) mpDefaultColorTable ),
+ mnPass ( 0 ),
mbzCodecInUse ( sal_False ),
mbStatus( sal_True),
mbIDAT( sal_False ),
@@ -333,30 +335,6 @@ void PNGReaderImpl::ReadRemainingChunks()
// ------------------------------------------------------------------------
-// move position of mrPNGStream to the end of the file
-void PNGReaderImpl::SkipRemainingChunks()
-{
- // nothing to skip if the last chunk was read
- if( !maChunkSeq.empty() && (maChunkSeq.back().nType == PNGCHUNK_IEND) )
- return;
-
- // read from the stream until the IEND chunk is found
- const sal_Size nStreamPos = mrPNGStream.Tell();
- while( !mrPNGStream.IsEof() && (mrPNGStream.GetError() == ERRCODE_NONE) )
- {
- mrPNGStream >> mnChunkLen >> mnChunkType;
- if( mnChunkLen < 0 )
- break;
- if( nStreamPos + mnChunkLen >= mnStreamSize )
- break;
- mrPNGStream.SeekRel( mnChunkLen + 4 ); // skip data + CRC
- if( mnChunkType == PNGCHUNK_IEND )
- break;
- }
-}
-
-// ------------------------------------------------------------------------
-
const std::vector< vcl::PNGReader::ChunkData >& PNGReaderImpl::GetAllChunks()
{
ReadRemainingChunks();
@@ -478,11 +456,6 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
aRet.SetPrefSize( maPhysSize );
}
-#if 0
- // TODO: make sure nobody depends on the stream being after the IEND chunks
- // => let them do ReadChunks before
- ReadRemainingChunks();
-#endif
}
return aRet;
@@ -1587,3 +1560,5 @@ void PNGReader::SetIgnoreGammaChunk( sal_Bool b )
} // namespace vcl
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx
index 3d814bea000e..b87457c35054 100644
--- a/vcl/source/gdi/pngwrite.cxx
+++ b/vcl/source/gdi/pngwrite.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -119,7 +120,7 @@ private:
void ImplWriteChunk( sal_uInt8 nNumb );
void ImplWriteChunk( sal_uInt32 nNumb );
void ImplWriteChunk( unsigned char* pSource, sal_uInt32 nDatSize );
- void ImplCloseChunk( void );
+ void ImplCloseChunk( void ) const;
};
// ------------------------------------------------------------------------
@@ -148,11 +149,11 @@ PNGWriterImpl::PNGWriterImpl( const BitmapEx& rBmpEx,
sal_Int32 i = 0;
for ( i = 0; i < pFilterData->getLength(); i++ )
{
- if ( (*pFilterData)[ i ].Name.equalsAscii( "Compression" ) )
+ if ( (*pFilterData)[ i ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Compression" ) ) )
(*pFilterData)[ i ].Value >>= mnCompLevel;
- else if ( (*pFilterData)[ i ].Name.equalsAscii( "Interlaced" ) )
+ else if ( (*pFilterData)[ i ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Interlaced" ) ) )
(*pFilterData)[ i ].Value >>= mnInterlaced;
- else if ( (*pFilterData)[ i ].Name.equalsAscii( "MaxChunkSize" ) )
+ else if ( (*pFilterData)[ i ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MaxChunkSize" ) ) )
{
sal_Int32 nVal = 0;
if ( (*pFilterData)[ i ].Value >>= nVal )
@@ -698,7 +699,7 @@ void PNGWriterImpl::ImplWriteChunk ( unsigned char* pSource, sal_uInt32 nDatSize
// ------------------------------------------------------------------------
// nothing to do
-void PNGWriterImpl::ImplCloseChunk ( void )
+void PNGWriterImpl::ImplCloseChunk ( void ) const
{
}
@@ -735,3 +736,4 @@ std::vector< vcl::PNGWriter::ChunkData >& PNGWriter::GetChunks()
} // namespace vcl
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/polyscan.cxx b/vcl/source/gdi/polyscan.cxx
index 7c69f79d50e6..81d05bf33354 100644
--- a/vcl/source/gdi/polyscan.cxx
+++ b/vcl/source/gdi/polyscan.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -356,3 +357,5 @@ void PolyScanner::InsertLine( const Point& rStart, const Point& rEnd )
mpArray[ nLastY - mnTop ].Insert( nLastX );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index e5e19dff3771..15964d9da09f 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#define ENABLE_BYTESTRING_STREAM_OPERATORS
#include <list>
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/salinst.hxx>
#include <vcl/salgdi.hxx>
#include <vcl/salptype.hxx>
@@ -341,7 +340,7 @@ ImplPrnQueueList::~ImplPrnQueueList()
void ImplPrnQueueList::Add( SalPrinterQueueInfo* pData )
{
- std::hash_map< rtl::OUString, sal_Int32, rtl::OUStringHash >::iterator it =
+ boost::unordered_map< rtl::OUString, sal_Int32, rtl::OUStringHash >::iterator it =
m_aNameToIndex.find( pData->maPrinterName );
if( it == m_aNameToIndex.end() )
{
@@ -366,7 +365,7 @@ void ImplPrnQueueList::Add( SalPrinterQueueInfo* pData )
ImplPrnQueueData* ImplPrnQueueList::Get( const rtl::OUString& rPrinter )
{
ImplPrnQueueData* pData = NULL;
- std::hash_map<rtl::OUString,sal_Int32,rtl::OUStringHash>::iterator it =
+ boost::unordered_map<rtl::OUString,sal_Int32,rtl::OUStringHash>::iterator it =
m_aNameToIndex.find( rPrinter );
if( it != m_aNameToIndex.end() )
pData = &m_aQueueInfos[it->second];
@@ -1287,7 +1286,7 @@ rtl::OUString Printer::GetPaperName( Paper ePaper )
ImplSVData* pSVData = ImplGetSVData();
if( ! pSVData->mpPaperNames )
{
- pSVData->mpPaperNames = new std::hash_map< int, rtl::OUString >();
+ pSVData->mpPaperNames = new boost::unordered_map< int, rtl::OUString >();
if( ImplGetResMgr() )
{
ResStringArray aPaperStrings( VclResId( RID_STR_PAPERNAMES ) );
@@ -1307,7 +1306,7 @@ rtl::OUString Printer::GetPaperName( Paper ePaper )
}
}
- std::hash_map<int,rtl::OUString>::const_iterator it = pSVData->mpPaperNames->find( (int)ePaper );
+ boost::unordered_map<int,rtl::OUString>::const_iterator it = pSVData->mpPaperNames->find( (int)ePaper );
return (it != pSVData->mpPaperNames->end()) ? it->second : rtl::OUString();
}
@@ -1628,3 +1627,5 @@ void Printer::updatePrinters()
delete pNewList;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index d86df6e2816b..38c589eb12b2 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -201,7 +202,7 @@ static void ImplConvertTransparentAction( GDIMetaFile& o_rMtf,
case META_TRANSPARENT_ACTION:
default:
- DBG_ERROR("Printer::GetPreparedMetafile impossible state reached");
+ OSL_FAIL("Printer::GetPreparedMetafile impossible state reached");
break;
}
@@ -266,7 +267,7 @@ static void ImplConvertTransparentAction( GDIMetaFile& o_rMtf,
aBmp ));
break;
default:
- DBG_ERROR("Unexpected case");
+ OSL_FAIL("Unexpected case");
break;
}
}
@@ -628,7 +629,7 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic
break;
case META_TEXTLINE_ACTION:
- DBG_ERROR("META_TEXTLINE_ACTION not supported");
+ OSL_FAIL("META_TEXTLINE_ACTION not supported");
break;
default:
@@ -1589,3 +1590,5 @@ void Printer::DrawGradientEx( OutputDevice* pOut, const PolyPolygon& rPolyPoly,
else
pOut->DrawGradient( rPolyPoly, rGradient );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 34276fafdfe5..b1eb2a268f5c 100755..100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,8 +50,8 @@
#include "com/sun/star/awt/Size.hpp"
#include "comphelper/processfactory.hxx"
-#include <hash_map>
-#include <hash_set>
+#include <boost/unordered_map.hpp>
+#include <boost/unordered_set.hpp>
using namespace com::sun::star;
using namespace com::sun::star::uno;
@@ -75,13 +76,8 @@ class ImplPageCache
{
if( maCacheRanking[0] != nLastHit )
{
- bool bMove = false;
for( sal_Int32 i = nCacheSize-1; i > 0; i-- )
- {
- if( maCacheRanking[i] == nLastHit )
- bMove = true;
maCacheRanking[i] = maCacheRanking[i-1];
- }
maCacheRanking[0] = nLastHit;
}
}
@@ -148,9 +144,9 @@ public:
ControlDependency() : mnDependsOnEntry( -1 ) {}
};
- 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;
+ typedef boost::unordered_map< rtl::OUString, size_t, rtl::OUStringHash > PropertyToIndexMap;
+ typedef boost::unordered_map< rtl::OUString, ControlDependency, rtl::OUStringHash > ControlDependencyMap;
+ typedef boost::unordered_map< rtl::OUString, Sequence< sal_Bool >, rtl::OUStringHash > ChoiceDisableMap;
boost::shared_ptr<Printer> mpPrinter;
Sequence< PropertyValue > maUIOptions;
@@ -779,21 +775,21 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons
sal_Int32 nPaperBin = mnDefaultPaperBin;
for( sal_Int32 nProperty = 0, nPropertyCount = i_rProps.getLength(); nProperty < nPropertyCount; ++nProperty )
{
- if( i_rProps[ nProperty ].Name.equalsAscii( "PreferredPageSize" ) )
+ if( i_rProps[ nProperty ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PreferredPageSize" ) ) )
{
i_rProps[ nProperty ].Value >>= aSetSize;
}
- else if( i_rProps[ nProperty ].Name.equalsAscii( "PageSize" ) )
+ else if( i_rProps[ nProperty ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PageSize" ) ) )
{
i_rProps[ nProperty ].Value >>= aIsSize;
}
- else if( i_rProps[ nProperty ].Name.equalsAscii( "PageIncludesNonprintableArea" ) )
+ else if( i_rProps[ nProperty ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PageIncludesNonprintableArea" ) ) )
{
sal_Bool bVal = sal_False;
i_rProps[ nProperty ].Value >>= bVal;
aPageSize.bFullPaper = static_cast<bool>(bVal);
}
- else if( i_rProps[ nProperty ].Name.equalsAscii( "PrinterPaperTray" ) )
+ else if( i_rProps[ nProperty ].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrinterPaperTray" ) ) )
{
sal_Int32 nBin = -1;
i_rProps[ nProperty ].Value >>= nBin;
@@ -1239,7 +1235,7 @@ bool PrinterController::getReversePrint() const
Sequence< PropertyValue > PrinterController::getJobProperties( const Sequence< PropertyValue >& i_rMergeList ) const
{
- std::hash_set< rtl::OUString, rtl::OUStringHash > aMergeSet;
+ boost::unordered_set< rtl::OUString, rtl::OUStringHash > aMergeSet;
size_t nResultLen = size_t(i_rMergeList.getLength()) + mpImplData->maUIProperties.size() + 3;
for( int i = 0; i < i_rMergeList.getLength(); i++ )
aMergeSet.insert( i_rMergeList[i].Name );
@@ -1288,14 +1284,14 @@ const Sequence< beans::PropertyValue >& PrinterController::getUIOptions() const
beans::PropertyValue* PrinterController::getValue( const rtl::OUString& i_rProperty )
{
- std::hash_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it =
+ boost::unordered_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it =
mpImplData->maPropertyToIndex.find( i_rProperty );
return it != mpImplData->maPropertyToIndex.end() ? &mpImplData->maUIProperties[it->second] : NULL;
}
const beans::PropertyValue* PrinterController::getValue( const rtl::OUString& i_rProperty ) const
{
- std::hash_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it =
+ boost::unordered_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it =
mpImplData->maPropertyToIndex.find( i_rProperty );
return it != mpImplData->maPropertyToIndex.end() ? &mpImplData->maUIProperties[it->second] : NULL;
}
@@ -1325,7 +1321,7 @@ void PrinterController::setValue( const rtl::OUString& i_rName, const Any& i_rVa
void PrinterController::setValue( const beans::PropertyValue& i_rValue )
{
- std::hash_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it =
+ boost::unordered_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it =
mpImplData->maPropertyToIndex.find( i_rValue.Name );
if( it != mpImplData->maPropertyToIndex.end() )
mpImplData->maUIProperties[ it->second ] = i_rValue;
@@ -1356,7 +1352,7 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_
for( int n = 0; n < aOptProp.getLength(); n++ )
{
const beans::PropertyValue& rEntry( aOptProp[ n ] );
- if( rEntry.Name.equalsAscii( "Property" ) )
+ if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Property" ) ) )
{
PropertyValue aVal;
rEntry.Value >>= aVal;
@@ -1366,17 +1362,17 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_
aPropName = aVal.Name;
bHaveProperty = true;
}
- else if( rEntry.Name.equalsAscii( "Enabled" ) )
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Enabled" ) ) )
{
sal_Bool bValue = sal_True;
rEntry.Value >>= bValue;
bIsEnabled = bValue;
}
- else if( rEntry.Name.equalsAscii( "DependsOnName" ) )
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DependsOnName" ) ) )
{
rEntry.Value >>= aDep.maDependsOnName;
}
- else if( rEntry.Name.equalsAscii( "DependsOnEntry" ) )
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DependsOnEntry" ) ) )
{
rEntry.Value >>= aDep.mnDependsOnEntry;
}
@@ -1404,7 +1400,7 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_
void PrinterController::enableUIOption( const rtl::OUString& i_rProperty, bool i_bEnable )
{
- std::hash_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it =
+ boost::unordered_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator it =
mpImplData->maPropertyToIndex.find( i_rProperty );
if( it != mpImplData->maPropertyToIndex.end() )
{
@@ -1422,7 +1418,7 @@ void PrinterController::enableUIOption( const rtl::OUString& i_rProperty, bool i
bool PrinterController::isUIOptionEnabled( const rtl::OUString& i_rProperty ) const
{
bool bEnabled = false;
- std::hash_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator prop_it =
+ boost::unordered_map< rtl::OUString, size_t, rtl::OUStringHash >::const_iterator prop_it =
mpImplData->maPropertyToIndex.find( i_rProperty );
if( prop_it != mpImplData->maPropertyToIndex.end() )
{
@@ -1643,7 +1639,7 @@ sal_Bool PrinterController::getBoolProperty( const rtl::OUString& i_rProperty, s
Any PrinterOptionsHelper::getValue( const rtl::OUString& i_rPropertyName ) const
{
Any aRet;
- std::hash_map< rtl::OUString, Any, rtl::OUStringHash >::const_iterator it =
+ boost::unordered_map< rtl::OUString, Any, rtl::OUStringHash >::const_iterator it =
m_aPropertyMap.find( i_rPropertyName );
if( it != m_aPropertyMap.end() )
aRet = it->second;
@@ -1658,7 +1654,7 @@ void PrinterOptionsHelper::setValue( const rtl::OUString& i_rPropertyName, const
bool PrinterOptionsHelper::hasProperty( const rtl::OUString& i_rPropertyName ) const
{
Any aRet;
- std::hash_map< rtl::OUString, Any, rtl::OUStringHash >::const_iterator it =
+ boost::unordered_map< rtl::OUString, Any, rtl::OUStringHash >::const_iterator it =
m_aPropertyMap.find( i_rPropertyName );
return it != m_aPropertyMap.end();
}
@@ -1698,7 +1694,7 @@ bool PrinterOptionsHelper::processProperties( const Sequence< PropertyValue >& i
for( sal_Int32 i = 0; i < nElements; i++ )
{
bool bElementChanged = false;
- std::hash_map< rtl::OUString, Any, rtl::OUStringHash >::iterator it =
+ boost::unordered_map< rtl::OUString, Any, rtl::OUStringHash >::iterator it =
m_aPropertyMap.find( pVals[ i ].Name );
if( it != m_aPropertyMap.end() )
{
@@ -1949,3 +1945,5 @@ Any PrinterOptionsHelper::getEditControlOpt( const rtl::OUString& i_rTitle,
i_rControlOptions
);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/regband.cxx b/vcl/source/gdi/regband.cxx
index 08c94bc2ebc6..21c82cd51f3a 100644
--- a/vcl/source/gdi/regband.cxx
+++ b/vcl/source/gdi/regband.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -967,3 +968,5 @@ ImplRegionBand* ImplRegionBand::SplitBand (const sal_Int32 nY)
return pLowerBand;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx
index 96e67aaabffa..480a17a9f88b 100755
--- a/vcl/source/gdi/region.cxx
+++ b/vcl/source/gdi/region.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,15 +34,9 @@
#include <vcl/salbtype.hxx>
#include <tools/stream.hxx>
#include <tools/debug.hxx>
-#ifndef _REGION_H
#include <vcl/region.h>
-#endif
-#ifndef _REGION_HXX
#include <vcl/region.hxx>
-#endif
-#ifndef _REGBAND_HXX
#include <vcl/regband.hxx>
-#endif
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
@@ -663,7 +658,7 @@ sal_Bool ImplRegion::InsertPoint( const Point &rPoint, long nLineID,
mpLastCheckedBand = mpLastCheckedBand->mpNextBand;
}
- DBG_ERROR( "ImplRegion::InsertPoint reached the end of the list!" );
+ OSL_FAIL( "ImplRegion::InsertPoint reached the end of the list!" );
}
else
{
@@ -680,10 +675,10 @@ sal_Bool ImplRegion::InsertPoint( const Point &rPoint, long nLineID,
mpLastCheckedBand = mpLastCheckedBand->mpPrevBand;
}
- DBG_ERROR( "ImplRegion::InsertPoint reached the beginning of the list!" );
+ OSL_FAIL( "ImplRegion::InsertPoint reached the beginning of the list!" );
}
- DBG_ERROR( "ImplRegion::InsertPoint point not inserted!" );
+ OSL_FAIL( "ImplRegion::InsertPoint point not inserted!" );
// reinitialize pointer (should never be reached!)
mpLastCheckedBand = mpFirstBand;
@@ -896,7 +891,7 @@ void ImplRegion::Union( long nLeft, long nTop, long nRight, long nBottom )
{
if ( (pBand->mnYTop < nCurY) || (pBand->mnYBottom < nCurY) )
{
- DBG_ERROR( "ImplRegion::Union() - Bands not sorted!" );
+ OSL_FAIL( "ImplRegion::Union() - Bands not sorted!" );
}
pBand = pBand->mpNextBand;
}
@@ -933,7 +928,7 @@ void ImplRegion::Exclude( long nLeft, long nTop, long nRight, long nBottom )
{
if ( (pBand->mnYTop < nCurY) || (pBand->mnYBottom < nCurY) )
{
- DBG_ERROR( "ImplRegion::Exclude() - Bands not sorted!" );
+ OSL_FAIL( "ImplRegion::Exclude() - Bands not sorted!" );
}
pBand = pBand->mpNextBand;
}
@@ -970,7 +965,7 @@ void ImplRegion::XOr( long nLeft, long nTop, long nRight, long nBottom )
{
if ( (pBand->mnYTop < nCurY) || (pBand->mnYBottom < nCurY) )
{
- DBG_ERROR( "ImplRegion::XOr() - Bands not sorted!" );
+ OSL_FAIL( "ImplRegion::XOr() - Bands not sorted!" );
}
pBand = pBand->mpNextBand;
}
@@ -1061,12 +1056,12 @@ sal_Bool ImplRegion::OptimizeBandList()
"Exiting ImplRegion::OptimizeBandList(): empty band in region!" );
if ( pBand->mnYBottom < pBand->mnYTop )
- DBG_ERROR( "ImplRegion::OptimizeBandList(): YBottomBoundary < YTopBoundary" );
+ OSL_FAIL( "ImplRegion::OptimizeBandList(): YBottomBoundary < YTopBoundary" );
if ( pBand->mpNextBand )
{
if ( pBand->mnYBottom >= pBand->mpNextBand->mnYTop )
- DBG_ERROR( "ImplRegion::OptimizeBandList(): overlapping bands in region!" );
+ OSL_FAIL( "ImplRegion::OptimizeBandList(): overlapping bands in region!" );
}
pBand = pBand->mpNextBand;
@@ -2657,7 +2652,7 @@ SvStream& operator>>( SvStream& rIStrm, Region& rRegion )
if( rIStrm.IsEof() )
{
- DBG_ERROR( "premature end of region stream" );
+ OSL_FAIL( "premature end of region stream" );
delete rRegion.mpImplRegion;
rRegion.mpImplRegion = (ImplRegion*)&aImplEmptyRegion;
return rIStrm;
@@ -3105,3 +3100,5 @@ Region Region::GetRegionFromPolyPolygon( const PolyPolygon& rPolyPoly )
}
return aResult;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index 9f2ee0924555..9fa4d813b2b7 100755..100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include "precompiled_vcl.hxx"
#include <tools/ref.hxx>
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/salgdi.hxx>
#include <vcl/salframe.hxx>
#include <vcl/salvd.hxx>
@@ -826,3 +825,4 @@ void SalGraphics::AddDevFontSubstitute( OutputDevice* pOutDev,
pOutDev->ImplAddDevFontSubstitute( rFontName, rReplaceFontName, nFlags );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 5e187944c706..970b0ff3cd0b 100755..100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,9 +35,7 @@
#include <math.h>
#include <sal/alloca.h>
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/salgdi.hxx>
#include <vcl/sallayout.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
@@ -44,9 +43,7 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <i18npool/lang.h>
-#ifndef _TL_DEBUG_HXX
#include <tools/debug.hxx>
-#endif
#include <limits.h>
@@ -100,11 +97,6 @@ bool IsDiacritic( sal_UCS4 nChar )
{0x0590, 0x05BE}, {0x05BF, 0x05C0}, {0x05C1, 0x05C3}, {0x05C4, 0x05C6}, {0x05C7, 0x05C8},
{0x0610, 0x061B}, {0x064B, 0x0660}, {0x0670, 0x0671}, {0x06D6, 0x06DD}, {0x06DF, 0x06E5}, {0x06E7, 0x06E9}, {0x06EA,0x06EF},
{0x0730, 0x074D}, {0x07A6, 0x07B1}, {0x07EB, 0x07F4},
-#if 0 // all known fonts have zero-width diacritics already, so no need to query it
- {0x0900, 0x0904}, {0x093C, 0x093D}, {0x0941, 0x0948}, {0x094D, 0x0950}, {0x0951, 0x0958},
- {0x0980, 0x0985}, {0x09BC, 0x09BD}, {0x09C1, 0x09C7}, {0x09CD, 0x09CE}, {0x09E2, 0x09E6},
- {0x0A00, 0x0A05}, {0x0A3C, 0x0A59}, //...
-#endif
{0x1DC0, 0x1E00},
{0x205F, 0x2070}, {0x20D0, 0x2100},
{0xFB1E, 0xFB1F}
@@ -155,48 +147,6 @@ int GetVerticalFlags( sal_UCS4 nChar )
sal_UCS4 GetVerticalChar( sal_UCS4 )
{
return 0; // #i14788# input method is responsible vertical char changes
-
-#if 0
- int nVert = 0;
- switch( nChar )
- {
- // #104627# special treatment for some unicodes
- case 0x002C: nVert = 0x3001; break;
- case 0x002E: nVert = 0x3002; break;
- /*
- // to few fonts have the compatibility forms, using
- // them will then cause more trouble than good
- // TODO: decide on a font specific basis
- case 0x2018: nVert = 0xFE41; break;
- case 0x2019: nVert = 0xFE42; break;
- case 0x201C: nVert = 0xFE43; break;
- case 0x201D: nVert = 0xFE44; break;
- // CJK compatibility forms
- case 0x2025: nVert = 0xFE30; break;
- case 0x2014: nVert = 0xFE31; break;
- case 0x2013: nVert = 0xFE32; break;
- case 0x005F: nVert = 0xFE33; break;
- case 0x0028: nVert = 0xFE35; break;
- case 0x0029: nVert = 0xFE36; break;
- case 0x007B: nVert = 0xFE37; break;
- case 0x007D: nVert = 0xFE38; break;
- case 0x3014: nVert = 0xFE39; break;
- case 0x3015: nVert = 0xFE3A; break;
- case 0x3010: nVert = 0xFE3B; break;
- case 0x3011: nVert = 0xFE3C; break;
- case 0x300A: nVert = 0xFE3D; break;
- case 0x300B: nVert = 0xFE3E; break;
- case 0x3008: nVert = 0xFE3F; break;
- case 0x3009: nVert = 0xFE40; break;
- case 0x300C: nVert = 0xFE41; break;
- case 0x300D: nVert = 0xFE42; break;
- case 0x300E: nVert = 0xFE43; break;
- case 0x300F: nVert = 0xFE44; break;
- */
- }
-
- return nVert;
-#endif
}
// -----------------------------------------------------------------------
@@ -373,17 +323,6 @@ sal_UCS4 GetLocalizedChar( sal_UCS4 nChar, LanguageType eLang )
case LANGUAGE_TIBETAN & LANGUAGE_MASK_PRIMARY:
nOffset = 0x0F20 - '0'; // tibetan
break;
-#if 0 // TODO: use language type for these digit substitutions?
- // TODO case:
- nOffset = 0x2776 - '0'; // dingbat circled
- break;
- // TODO case:
- nOffset = 0x2070 - '0'; // superscript
- break;
- // TODO case:
- nOffset = 0x2080 - '0'; // subscript
- break;
-#endif
}
nChar += nOffset;
@@ -842,12 +781,6 @@ int SalLayout::CalcAsianKerning( sal_UCS4 c, bool bLeft, bool /*TODO:? bVertical
nResult = nTable[ c - 0x3000 ];
else switch( c )
{
-#if 0 // TODO: enable it for real-fixed-width fonts?
- case ':': case ';': case '!':
- if( !bVertical )
- nResult = bLeft ? -1 : +1; // 25% left and right
- break;
-#endif
case 0x30FB:
nResult = bLeft ? -1 : +1; // 25% left/right/top/bottom
break;
@@ -953,10 +886,6 @@ bool SalLayout::IsSpacingGlyph( sal_GlyphId nGlyph ) const
const ImplFontData* SalLayout::GetFallbackFontData( sal_GlyphId /*nGlyphId*/ ) const
{
-#if 0
- int nFallbackLevel = (nGlyphId & GF_FONTMASK) >> GF_FONTSHIFT
- assert( nFallbackLevel == 0 );
-#endif
return NULL;
}
@@ -2324,3 +2253,5 @@ bool MultiSalLayout::GetBoundRect( SalGraphics& rGraphics, Rectangle& rRect ) co
}
// =======================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/salmisc.cxx b/vcl/source/gdi/salmisc.cxx
index f77ce914fd4d..3a9bd669f54f 100644
--- a/vcl/source/gdi/salmisc.cxx
+++ b/vcl/source/gdi/salmisc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -212,7 +213,7 @@ static void ImplTCToTC( const BitmapBuffer& rSrcBuffer, BitmapBuffer& rDstBuffer
if( BMP_SCANLINE_FORMAT( rSrcBuffer.mnFormat ) == BMP_FORMAT_24BIT_TC_BGR )
{
BitmapColor aCol;
- sal_uInt8* pPixel;
+ sal_uInt8* pPixel = NULL;
for( long nActY = 0, nMapY; nActY < nHeight; nActY++ )
{
@@ -325,7 +326,7 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec
// initialize pFncGetPixel to something valid that is
// least likely to crash
pFncGetPixel = BitmapReadAccess::GetPixelFor_1BIT_MSB_PAL;
- DBG_ERROR( "unknown read format" );
+ OSL_FAIL( "unknown read format" );
break;
}
@@ -356,7 +357,7 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec
// least likely to crash
pFncSetPixel = BitmapReadAccess::SetPixelFor_1BIT_MSB_PAL;
pDstBuffer->mnBitCount = 1;
- DBG_ERROR( "unknown write format" );
+ OSL_FAIL( "unknown write format" );
break;
}
@@ -514,3 +515,5 @@ BitmapBuffer* StretchAndConvert( const BitmapBuffer& rSrcBuffer, const SalTwoRec
return pDstBuffer;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/salnativewidgets-none.cxx b/vcl/source/gdi/salnativewidgets-none.cxx
index 4cbce4c5298a..cc204069c2c4 100644
--- a/vcl/source/gdi/salnativewidgets-none.cxx
+++ b/vcl/source/gdi/salnativewidgets-none.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,7 @@
#include <vcl/salgdi.hxx>
-using namespace rtl;
+using ::rtl::OUString;
/****************************************************************
* Placeholder for no native widgets
@@ -132,3 +133,4 @@ sal_Bool SalGraphics::getNativeControlRegion( ControlType,
return( sal_False );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/svcompat.cxx b/vcl/source/gdi/svcompat.cxx
index be0c9cd7dcc9..c594dd1f93d7 100644
--- a/vcl/source/gdi/svcompat.cxx
+++ b/vcl/source/gdi/svcompat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -76,3 +77,5 @@ ImplCompat::~ImplCompat()
mpRWStm->SeekRel( mnTotalSize - nReadSize );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx
index 6d69bc67b982..421cd6a33f0a 100755
--- a/vcl/source/gdi/textlayout.cxx
+++ b/vcl/source/gdi/textlayout.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -384,3 +385,5 @@ namespace vcl
//........................................................................
} // namespace vcl
//........................................................................
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index e6e100072679..e7ec24ca87d2 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/salinst.hxx>
#include <vcl/salgdi.hxx>
#include <vcl/salframe.hxx>
@@ -447,3 +446,4 @@ void VirtualDevice::Compat_ZeroExtleadBug()
// -----------------------------------------------------------------------
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx
index 5b865038bb2b..600f78941cbe 100644
--- a/vcl/source/gdi/wall.cxx
+++ b/vcl/source/gdi/wall.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -637,3 +638,5 @@ SvStream& operator<<( SvStream& rOStm, const Wallpaper& rWallpaper )
{
return( rOStm << *rWallpaper.mpImplWallpaper );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index 4e94df4810da..6a27dac4330f 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,6 +48,8 @@
#include "osl/file.hxx"
#include "osl/thread.hxx"
+#include "sft.hxx"
+
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
@@ -77,10 +80,8 @@ typedef FT_Vector* FT_Vector_CPtr;
// TODO: move file mapping stuff to OSL
#if defined(UNX)
- #if !defined(HPUX)
- // PORTERS: dlfcn is used for getting symbols from FT versions newer than baseline
- #include <dlfcn.h>
- #endif
+ // PORTERS: dlfcn is used for getting symbols from FT versions newer than baseline
+ #include <dlfcn.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
@@ -135,7 +136,8 @@ FT_Error (*pFTOblique)(FT_GlyphSlot);
static bool bEnableSizeFT = false;
struct EqStr{ bool operator()(const char* a, const char* b) const { return !strcmp(a,b); } };
-typedef ::std::hash_map<const char*,FtFontFile*,::std::hash<const char*>, EqStr> FontFileList;
+struct HashStr { size_t operator()( const char* s ) const { return rtl_str_hashCode(s); } };
+typedef ::boost::unordered_map<const char*,FtFontFile*,HashStr, EqStr> FontFileList;
namespace { struct vclFontFileList : public rtl::Static< FontFileList, vclFontFileList > {}; }
// -----------------------------------------------------------------------
@@ -607,7 +609,7 @@ long FreetypeManager::AddFontDir( const String& rUrlName )
aDFA.maName = String::CreateFromAscii( aFaceFT->family_name );
if ( aFaceFT->style_name )
- aDFA.maStyleName = String::CreateFromAscii( aFaceFT->style_name );
+ aDFA.maStyleName = String::CreateFromAscii( aFaceFT->style_name );
aDFA.mbSymbolFlag = false;
for( int i = aFaceFT->num_charmaps; --i >= 0; )
@@ -724,11 +726,6 @@ FreetypeServerFont::FreetypeServerFont( const ImplFontSelectData& rFSD, FtFontIn
{
maFaceFT = pFI->GetFaceFT();
-#ifdef HDU_DEBUG
- fprintf( stderr, "FTSF::FTSF(\"%s\", h=%d, w=%d, sy=%d) => %d\n",
- pFI->GetFontFileName()->getStr(), rFSD.mnHeight, rFSD.mnWidth, pFI->IsSymbolFont(), maFaceFT!=0 );
-#endif
-
if( !maFaceFT )
return;
@@ -1227,11 +1224,6 @@ int FreetypeServerFont::GetRawGlyphIndex( sal_UCS4 aChar ) const
// check if symbol aliasing helps
if( (aChar <= 0x00FF) && mpFontInfo->IsSymbolFont() )
nGlyphIndex = FT_Get_Char_Index( maFaceFT, aChar | 0xF000 );
-#if 0 // disabled for now because it introduced ae bad side-effect (#i88376#)
- // Finally try the postscript name table
- if (!nGlyphIndex)
- nGlyphIndex = psp::PrintFontManager::get().FreeTypeCharIndex( maFaceFT, aChar );
-#endif
}
mpFontInfo->CacheGlyphIndex( aChar, nGlyphIndex );
}
@@ -1269,17 +1261,6 @@ int FreetypeServerFont::FixupGlyphIndex( int nGlyphIndex, sal_UCS4 aChar ) const
}
}
-#if 0
- // #95556# autohinting not yet optimized for non-western glyph styles
- if( !(mnLoadFlags & (FT_LOAD_NO_HINTING | FT_LOAD_FORCE_AUTOHINT) )
- && ( (aChar >= 0x0600 && aChar < 0x1E00) // south-east asian + arabic
- ||(aChar >= 0x2900 && aChar < 0xD800) // CJKV
- ||(aChar >= 0xF800) ) ) // presentation + symbols
- {
- nGlyphFlags |= GF_UNHINTED;
- }
-#endif
-
if( nGlyphIndex != 0 )
nGlyphIndex |= nGlyphFlags;
@@ -1824,6 +1805,29 @@ bool FtFontInfo::GetFontCodeRanges( CmapResult& rResult ) const
return true;
}
+bool FreetypeServerFont::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
+{
+ bool bRet = false;
+
+ sal_uLong nLength = 0;
+ // load GSUB table
+ const FT_Byte* pGSUB = mpFontInfo->GetTable("GSUB", &nLength);
+ if (pGSUB)
+ vcl::getTTScripts(rFontCapabilities.maGSUBScriptTags, pGSUB, nLength);
+
+ // load OS/2 table
+ const FT_Byte* pOS2 = mpFontInfo->GetTable("OS/2", &nLength);
+ if (pOS2)
+ {
+ bRet = vcl::getTTCoverage(
+ rFontCapabilities.maUnicodeRange,
+ rFontCapabilities.maCodePageRange,
+ pOS2, nLength);
+ }
+
+ return bRet;
+}
+
// -----------------------------------------------------------------------
// kerning stuff
// -----------------------------------------------------------------------
@@ -2057,7 +2061,7 @@ sal_uLong FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) con
// prepare glyphindex to character mapping
// TODO: this is needed to support VCL's existing kerning infrastructure,
// eliminate it up by redesigning kerning infrastructure to work with glyph indizes
- typedef std::hash_multimap<sal_uInt16,sal_Unicode> Cmap;
+ typedef boost::unordered_multimap<sal_uInt16,sal_Unicode> Cmap;
Cmap aCmap;
for( sal_Unicode aChar = 0x0020; aChar < 0xFFFE; ++aChar )
{
@@ -2146,6 +2150,7 @@ PolyArgs::PolyArgs( PolyPolygon& rPolyPoly, sal_uInt16 nMaxPoints )
mnMaxPoints(nMaxPoints),
mnPoints(0),
mnPoly(0),
+ mnHeight(0),
bHasOffline(false)
{
mpPointAry = new Point[ mnMaxPoints ];
@@ -2599,3 +2604,4 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
// =======================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/gcach_ftyp.hxx b/vcl/source/glyphs/gcach_ftyp.hxx
index e607af2a90a8..b644fbace2da 100644
--- a/vcl/source/glyphs/gcach_ftyp.hxx
+++ b/vcl/source/glyphs/gcach_ftyp.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114,8 +115,8 @@ private:
const ImplFontCharMap* mpFontCharMap;
// cache unicode->glyphid mapping because looking it up is expensive
- // TODO: change to hash_multimap when a use case requires a m:n mapping
- typedef ::std::hash_map<int,int> Int2IntMap;
+ // TODO: change to boost::unordered_multimap when a use case requires a m:n mapping
+ typedef ::boost::unordered_map<int,int> Int2IntMap;
mutable Int2IntMap* mpChar2Glyph;
mutable Int2IntMap* mpGlyph2Char;
void InitHashes() const;
@@ -161,7 +162,7 @@ public:
FreetypeServerFont* CreateFont( const ImplFontSelectData& );
private:
- typedef ::std::hash_map<sal_IntPtr,FtFontInfo*> FontList;
+ typedef ::boost::unordered_map<sal_IntPtr,FtFontInfo*> FontList;
FontList maFontList;
sal_IntPtr mnMaxFontId;
@@ -209,6 +210,7 @@ protected:
int ApplyGlyphTransform( int nGlyphFlags, FT_GlyphRec_*, bool ) const;
virtual void InitGlyphData( int nGlyphIndex, GlyphData& ) const;
+ virtual bool GetFontCapabilities(vcl::FontCapabilities &) const;
bool ApplyGSUB( const ImplFontSelectData& );
virtual ServerFontLayoutEngine* GetLayoutEngine();
@@ -228,7 +230,7 @@ private:
bool mbArtBold;
bool mbUseGamma;
- typedef ::std::hash_map<int,int> GlyphSubstitution;
+ typedef ::boost::unordered_map<int,int> GlyphSubstitution;
GlyphSubstitution maGlyphSubstitution;
rtl_UnicodeToTextConverter maRecodeConverter;
@@ -258,3 +260,5 @@ public:
// -----------------------------------------------------------------------
#endif // _SV_GCACHFTYP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/gcach_layout.cxx b/vcl/source/glyphs/gcach_layout.cxx
index 84f1eef2e477..63a332869664 100755
--- a/vcl/source/glyphs/gcach_layout.cxx
+++ b/vcl/source/glyphs/gcach_layout.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -389,6 +390,9 @@ static bool lcl_CharIsJoiner(sal_Unicode cChar)
return ((cChar == 0x200C) || (cChar == 0x200D));
}
+//See https://bugs.freedesktop.org/show_bug.cgi?id=31016
+#define ARABIC_BANDAID
+
bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rArgs )
{
LEUnicode* pIcuChars;
@@ -522,17 +526,6 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr
if( nCharPos >= 0 )
{
sal_UCS4 aChar = rArgs.mpStr[ nCharPos ];
-#if 0 // TODO: enable if some unicodes>0xFFFF should need glyph flags!=0
- if( (aChar >= 0xD800) && (aChar <= 0xDFFF) )
- {
- if( cChar >= 0xDC00 ) // this part of a surrogate pair was already processed
- continue;
- // calculate unicode scalar value of surrogate pair
- aChar = 0x10000 + ((aChar - 0xD800) << 10);
- sal_UCS4 aLow = rArgs.mpStr[ nCharPos+1 ];
- aChar += aLow & 0x03FF;
- }
-#endif
nGlyphIndex = rFont.FixupGlyphIndex( nGlyphIndex, aChar );
// #i99367# HACK: try to detect all diacritics
@@ -544,12 +537,40 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr
aNewPos = Point( (int)(pPos->fX+0.5), (int)(pPos->fY+0.5) );
const GlyphMetric& rGM = rFont.GetGlyphMetric( nGlyphIndex );
int nGlyphWidth = rGM.GetCharWidth();
+ int nNewWidth = nGlyphWidth;
if( nGlyphWidth <= 0 )
bDiacritic |= true;
// #i99367# force all diacritics to zero width
// TODO: we need mnOrigWidth/mnLogicWidth/mnNewWidth
else if( bDiacritic )
- nGlyphWidth = 0;
+ nGlyphWidth = nNewWidth = 0;
+ else
+ {
+ // Hack, find next +ve width glyph and calculate current
+ // glyph width by substracting the two posituons
+ const IcuPosition* pNextPos = pPos+1;
+ for ( int j = i + 1; j <= nRawRunGlyphCount; ++j, ++pNextPos )
+ {
+ if ( j == nRawRunGlyphCount )
+ {
+ nNewWidth = pNextPos->fX - pPos->fX;
+ break;
+ }
+
+ LEGlyphID nNextGlyphIndex = pIcuGlyphs[j];
+ if( (nNextGlyphIndex == ICU_MARKED_GLYPH)
+ || (nNextGlyphIndex == ICU_DELETED_GLYPH) )
+ continue;
+
+ const GlyphMetric& rNextGM = rFont.GetGlyphMetric( nNextGlyphIndex );
+ int nNextGlyphWidth = rNextGM.GetCharWidth();
+ if ( nNextGlyphWidth > 0 )
+ {
+ nNewWidth = pNextPos->fX - pPos->fX;
+ break;
+ }
+ }
+ }
// heuristic to detect glyph clusters
bool bInCluster = true;
@@ -603,7 +624,10 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr
nGlyphFlags |= GlyphItem::IS_DIACRITIC;
// add resulting glyph item to layout
- const GlyphItem aGI( nCharPos, nGlyphIndex, aNewPos, nGlyphFlags, nGlyphWidth );
+ GlyphItem aGI( nCharPos, nGlyphIndex, aNewPos, nGlyphFlags, nGlyphWidth );
+#ifdef ARABIC_BANDAID
+ aGI.mnNewWidth = nNewWidth;
+#endif
rLayout.AppendGlyph( aGI );
++nFilteredRunGlyphCount;
nLastCharPos = nCharPos;
@@ -642,3 +666,4 @@ ServerFontLayoutEngine* FreetypeServerFont::GetLayoutEngine()
// =======================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/gcach_rbmp.cxx b/vcl/source/glyphs/gcach_rbmp.cxx
index f5e259d8852c..161e4c6314e7 100755
--- a/vcl/source/glyphs/gcach_rbmp.cxx
+++ b/vcl/source/glyphs/gcach_rbmp.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -272,3 +273,5 @@ bool RawBitmap::Rotate( int nAngle )
}
//------------------------------------------------------------------------
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/gcach_vdev.cxx b/vcl/source/glyphs/gcach_vdev.cxx
index b2ed9e891516..944d9aee16a3 100644
--- a/vcl/source/glyphs/gcach_vdev.cxx
+++ b/vcl/source/glyphs/gcach_vdev.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -285,3 +286,5 @@ bool VirtDevServerFont::GetGlyphOutline( int nGlyphIndex, PolyPolygon& rPolyPoly
}
// =======================================================================
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/gcach_vdev.hxx b/vcl/source/glyphs/gcach_vdev.hxx
index 4e7d36a69f80..61cd02b1f9cc 100644
--- a/vcl/source/glyphs/gcach_vdev.hxx
+++ b/vcl/source/glyphs/gcach_vdev.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,3 +56,5 @@ private:
};
// -----------------------------------------------------------------------
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/glyphcache.cxx b/vcl/source/glyphs/glyphcache.cxx
index 3b4b77cb5358..4374ad2f6b1b 100644
--- a/vcl/source/glyphs/glyphcache.cxx
+++ b/vcl/source/glyphs/glyphcache.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -600,3 +601,4 @@ int ExtraKernInfo::GetUnscaledKernValue( sal_Unicode cLeft, sal_Unicode cRight )
// =======================================================================
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/graphite_adaptors.cxx b/vcl/source/glyphs/graphite_adaptors.cxx
index 8507e55065f2..c1b9794927fc 100644
--- a/vcl/source/glyphs/graphite_adaptors.cxx
+++ b/vcl/source/glyphs/graphite_adaptors.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -65,8 +66,7 @@ namespace
inline float from_hinted(const int x) {
return static_cast<float>(x + 32) / 64.0;
}
- typedef std::hash_map<long,bool> SilfMap;
- SilfMap sSilfMap;
+ typedef boost::unordered_map<long,bool> SilfMap;
}
extern FT_Error (*pFTEmbolden)(FT_GlyphSlot);
extern FT_Error (*pFTOblique)(FT_GlyphSlot);
@@ -174,7 +174,7 @@ GraphiteFontAdaptor::~GraphiteFontAdaptor() throw()
mpFeatures = NULL;
}
-void GraphiteFontAdaptor::UniqueCacheInfo(ext_std::wstring & face_name_out, bool & bold_out, bool & italic_out)
+void GraphiteFontAdaptor::UniqueCacheInfo(std::wstring & face_name_out, bool & bold_out, bool & italic_out)
{
face_name_out = maFontProperties.szFaceName;
bold_out = maFontProperties.fBold;
@@ -183,6 +183,7 @@ void GraphiteFontAdaptor::UniqueCacheInfo(ext_std::wstring & face_name_out, bool
bool GraphiteFontAdaptor::IsGraphiteEnabledFont(ServerFont & font) throw()
{
+ static SilfMap sSilfMap;
// NOTE: this assumes that the same FTFace pointer won't be reused,
// so FtFontInfo::ReleaseFaceFT must only be called at shutdown.
FreetypeServerFont & aFtFont = dynamic_cast<FreetypeServerFont &>(font);
@@ -334,3 +335,5 @@ void GraphiteFontAdaptor::getGlyphMetrics(gr::gid16 nGlyphId, gr::Rect & aBoundi
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/graphite_cache.cxx b/vcl/source/glyphs/graphite_cache.cxx
index 7682cdb6c8ba..b3f48aa1c476 100644
--- a/vcl/source/glyphs/graphite_cache.cxx
+++ b/vcl/source/glyphs/graphite_cache.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,10 +37,8 @@
#include <tools/debug.hxx>
#include <vcl/sallayout.hxx>
-#include <preextstl.h>
#include <graphite/GrClient.h>
#include <graphite/Segment.h>
-#include <postextstl.h>
#include <rtl/ustring.hxx>
#include <vcl/graphite_layout.hxx>
@@ -198,3 +197,5 @@ GrSegRecord * GraphiteSegmentCache::cacheSegment(TextSourceAdaptor * adapter, gr
record->m_lockCount++;
return record;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/graphite_features.cxx b/vcl/source/glyphs/graphite_features.cxx
index 1cb25306c4ee..a49505d7d9e5 100644
--- a/vcl/source/glyphs/graphite_features.cxx
+++ b/vcl/source/glyphs/graphite_features.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,7 +48,6 @@ using namespace grutils;
const char GrFeatureParser::FEAT_PREFIX = ':';
const char GrFeatureParser::FEAT_SEPARATOR = '&';
const char GrFeatureParser::FEAT_ID_VALUE_SEPARATOR = '=';
-const std::string GrFeatureParser::ISO_LANG("lang");
GrFeatureParser::GrFeatureParser(gr::Font & font, const std::string lang)
: mnNumSettings(0), mbErrors(false)
@@ -73,7 +73,7 @@ GrFeatureParser::GrFeatureParser(gr::Font & font, const std::string features, co
break;
}
// check for a lang=xxx specification
- if (features.compare(pos, nEquals - pos, ISO_LANG) == 0)
+ if (features.compare(pos, nEquals - pos, "lang") == 0)
{
pos = nEquals + 1;
nFeatEnd = features.find(FEAT_SEPARATOR, pos);
@@ -88,7 +88,7 @@ GrFeatureParser::GrFeatureParser(gr::Font & font, const std::string features, co
gr::isocode aLang = maLang;
for (size_t i = pos; i < nFeatEnd; i++)
aLang.rgch[i-pos] = features[i];
- ext_std::pair<gr::LanguageIterator,gr::LanguageIterator> aSupported
+ std::pair<gr::LanguageIterator,gr::LanguageIterator> aSupported
= font.getSupportedLanguages();
gr::LanguageIterator iL = aSupported.first;
while (iL != aSupported.second)
@@ -139,7 +139,7 @@ void GrFeatureParser::setLang(gr::Font & font, const std::string & lang)
if (lang[i] == '-') break;
aLang.rgch[i] = lang[i];
}
- ext_std::pair<gr::LanguageIterator,gr::LanguageIterator> aSupported
+ std::pair<gr::LanguageIterator,gr::LanguageIterator> aSupported
= font.getSupportedLanguages();
gr::LanguageIterator iL = aSupported.first;
while (iL != aSupported.second)
@@ -186,7 +186,7 @@ bool GrFeatureParser::isValid(gr::Font & font, gr::FeatureSetting & setting)
{
return false;
}
- ext_std::pair< gr::FeatureSettingIterator, gr::FeatureSettingIterator >
+ std::pair< gr::FeatureSettingIterator, gr::FeatureSettingIterator >
validValues = font.getFeatureSettings(i);
gr::FeatureSettingIterator j = validValues.first;
while (j != validValues.second)
@@ -284,3 +284,5 @@ sal_Int32 GrFeatureParser::hashCode() const
}
return hash;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index 8a011606ab41..0fb1d824a17f 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -67,13 +68,11 @@
#include <unicode/uscript.h>
// Graphite Libraries (must be after vcl headers on windows)
-#include <preextstl.h>
#include <graphite/GrClient.h>
#include <graphite/Font.h>
#include <graphite/ITextSource.h>
#include <graphite/Segment.h>
#include <graphite/SegmentPainter.h>
-#include <postextstl.h>
#include <vcl/graphite_layout.hxx>
#include <vcl/graphite_features.hxx>
@@ -108,8 +107,8 @@ FILE * grLog()
namespace
{
- typedef ext_std::pair<gr::GlyphIterator, gr::GlyphIterator> glyph_range_t;
- typedef ext_std::pair<gr::GlyphSetIterator, gr::GlyphSetIterator> glyph_set_range_t;
+ typedef std::pair<gr::GlyphIterator, gr::GlyphIterator> glyph_range_t;
+ typedef std::pair<gr::GlyphSetIterator, gr::GlyphSetIterator> glyph_set_range_t;
inline long round(const float n) {
return long(n + (n < 0 ? -0.5 : 0.5));
@@ -174,11 +173,10 @@ GraphiteLayout::Glyphs::fill_from(gr::Segment & rSegment, ImplLayoutArgs &rArgs,
bool bRtl, long &rWidth, float fScaling, std::vector<int> & rChar2Base, std::vector<int> & rGlyph2Char, std::vector<int> & rCharDxs)
{
// Create a glyph item for each of the glyph and append it to the base class glyph list.
- typedef ext_std::pair< gr::GlyphSetIterator, gr::GlyphSetIterator > GrGlyphSet;
+ typedef std::pair< gr::GlyphSetIterator, gr::GlyphSetIterator > GrGlyphSet;
int nChar = rArgs.mnEndCharPos - rArgs.mnMinCharPos;
glyph_range_t iGlyphs = rSegment.glyphs();
int nGlyphs = iGlyphs.second - iGlyphs.first;
- gr::GlyphIterator prevBase = iGlyphs.second;
float fSegmentAdvance = rSegment.advanceWidth();
float fMinX = fSegmentAdvance;
float fMaxX = 0.0f;
@@ -652,7 +650,7 @@ public:
sal_Int32 hashCode(const grutils::GrFeatureParser * mpFeatures)
{
// is this sufficient?
- ext_std::wstring aFace;
+ std::wstring aFace;
bool bBold;
bool bItalic;
UniqueCacheInfo(aFace, bBold, bItalic);
@@ -677,7 +675,7 @@ public:
return hash;
};
protected:
- virtual void UniqueCacheInfo( ext_std::wstring& stuFace, bool& fBold, bool& fItalic )
+ virtual void UniqueCacheInfo( std::wstring& stuFace, bool& fBold, bool& fItalic )
{
#ifdef WIN32
dynamic_cast<GraphiteWinFont&>(mrRealFont).UniqueCacheInfo(stuFace, fBold, fItalic);
@@ -1262,7 +1260,7 @@ void GraphiteLayout::kashidaJustify(std::vector<int>& rDeltaWidths, sal_GlyphId
{
(*(i)).maLinearPos.X() -= nGapWidth;
nGapWidth -= nKashidaWidth;
- i++;
+ ++i;
}
// fixup rightmost kashida for gap remainder
@@ -1348,12 +1346,10 @@ void GraphiteLayout::GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray
break;
}
}
- long nGWidth = gi.mnNewWidth;
// if no match position at end of cluster
if (nGlyph == static_cast<int>(mvGlyphs.size()) ||
mvGlyphs[nGlyph].IsClusterStart())
{
- nGWidth = prevClusterWidth;
if (bRtl)
{
pCaretXArray[i+1] = gi.maLinearPos.X();
@@ -1560,3 +1556,5 @@ void GraphiteLayout::Simplify( bool isBaseLayout )
// discard width from trailing dropped glyphs, but not those in the middle
mnWidth -= deltaX;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/graphite_serverfont.cxx b/vcl/source/glyphs/graphite_serverfont.cxx
index eda97f509f03..cda2cd434cba 100644
--- a/vcl/source/glyphs/graphite_serverfont.cxx
+++ b/vcl/source/glyphs/graphite_serverfont.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -83,3 +84,5 @@ sal_GlyphId GraphiteLayoutImpl::getKashidaGlyph(int & width)
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/graphite_textsrc.cxx b/vcl/source/glyphs/graphite_textsrc.cxx
index 5764ba9454c9..33508ae34712 100644
--- a/vcl/source/glyphs/graphite_textsrc.cxx
+++ b/vcl/source/glyphs/graphite_textsrc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -135,16 +136,16 @@ gr::isocode TextSourceAdaptor::getLanguage(gr::toffset)
return unknown;
}
-ext_std::pair<gr::toffset, gr::toffset> TextSourceAdaptor::propertyRange(gr::toffset nCharIdx)
+std::pair<gr::toffset, gr::toffset> TextSourceAdaptor::propertyRange(gr::toffset nCharIdx)
{
if (nCharIdx < unsigned(maLayoutArgs.mnMinCharPos))
- return ext_std::make_pair(0, maLayoutArgs.mnMinCharPos);
+ return std::make_pair(0, maLayoutArgs.mnMinCharPos);
if (nCharIdx < mnEnd)
- return ext_std::make_pair(maLayoutArgs.mnMinCharPos, mnEnd);
+ return std::make_pair(maLayoutArgs.mnMinCharPos, mnEnd);
- return ext_std::make_pair(mnEnd, maLayoutArgs.mnLength);
+ return std::make_pair(mnEnd, maLayoutArgs.mnLength);
}
size_t TextSourceAdaptor::getFontFeatures(gr::toffset, gr::FeatureSetting * settings)
@@ -156,7 +157,7 @@ size_t TextSourceAdaptor::getFontFeatures(gr::toffset, gr::FeatureSetting * sett
bool TextSourceAdaptor::sameSegment(gr::toffset char_idx1, gr::toffset char_idx2)
{
- const ext_std::pair<gr::toffset, gr::toffset>
+ const std::pair<gr::toffset, gr::toffset>
range1 = propertyRange(char_idx1),
range2 = propertyRange(char_idx2);
@@ -167,3 +168,5 @@ void TextSourceAdaptor::setFeatures(const grutils::GrFeatureParser * pFeatures)
{
mpFeatures = new grutils::GrFeatureParser(*pFeatures);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/graphite_textsrc.hxx b/vcl/source/glyphs/graphite_textsrc.hxx
index 388f8a631b49..c5ef0ac7b43d 100644
--- a/vcl/source/glyphs/graphite_textsrc.hxx
+++ b/vcl/source/glyphs/graphite_textsrc.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,31 +40,21 @@
#include <stdexcept>
// Platform
-#ifndef _SVWIN_H
#include <tools/svwin.h>
-#endif
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
-#ifndef _SV_SALGDI_HXX
#include <vcl/salgdi.hxx>
-#endif
-#ifndef _SV_SALLAYOUT_HXX
#include <vcl/sallayout.hxx>
-#endif
// Module
#include "vcl/dllapi.h"
// Libraries
-#include <preextstl.h>
#include <graphite/GrClient.h>
#include <graphite/Font.h>
#include <graphite/ITextSource.h>
-#include <postextstl.h>
// Module type definitions and forward declarations.
//
@@ -90,7 +81,7 @@ public:
virtual float getVerticalOffset(gr::toffset ich);
virtual gr::isocode getLanguage(gr::toffset ich);
- virtual ext_std::pair<gr::toffset, gr::toffset> propertyRange(gr::toffset ich);
+ virtual 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; }
@@ -129,3 +120,5 @@ inline void TextSourceAdaptor::switchLayoutArgs(ImplLayoutArgs & aNewArgs)
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/glyphs/makefile.mk b/vcl/source/glyphs/makefile.mk
index 74811aba6204..fa9af02ca75f 100644
--- a/vcl/source/glyphs/makefile.mk
+++ b/vcl/source/glyphs/makefile.mk
@@ -64,8 +64,6 @@ SLOFILES+= $(SLO)$/graphite_adaptors.obj \
.IF "$(ENABLE_GRAPHITE)" == "TRUE"
# Graphite support on non-UNX platforms
-# make use of stlport headerfiles
-EXT_USE_STLPORT=TRUE
SLOFILES=\
$(SLO)$/graphite_textsrc.obj \
$(SLO)$/graphite_cache.obj \
diff --git a/vcl/source/helper/canvasbitmap.cxx b/vcl/source/helper/canvasbitmap.cxx
index 711a985b6fe5..3138c55b2bb5 100644
--- a/vcl/source/helper/canvasbitmap.cxx
+++ b/vcl/source/helper/canvasbitmap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,7 +35,7 @@
#include <com/sun/star/rendering/RenderingIntent.hpp>
#include <rtl/instance.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/canvasbitmap.hxx>
@@ -367,7 +368,7 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) :
break;
default:
- DBG_ERROR( "unsupported bitmap format" );
+ OSL_FAIL( "unsupported bitmap format" );
break;
}
@@ -445,20 +446,20 @@ VclCanvasBitmap::~VclCanvasBitmap()
// XBitmap
geometry::IntegerSize2D SAL_CALL VclCanvasBitmap::getSize() throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
return integerSize2DFromSize( m_aBitmap.GetSizePixel() );
}
::sal_Bool SAL_CALL VclCanvasBitmap::hasAlpha() throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
return m_aBmpEx.IsTransparent();
}
uno::Reference< rendering::XBitmap > SAL_CALL VclCanvasBitmap::getScaledBitmap( const geometry::RealSize2D& newSize,
sal_Bool beFast ) throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
BitmapEx aNewBmp( m_aBitmap );
aNewBmp.Scale( sizeFromRealSize2D( newSize ), beFast ? BMP_SCALE_FAST : BMP_SCALE_INTERPOLATE );
@@ -471,7 +472,7 @@ uno::Sequence< sal_Int8 > SAL_CALL VclCanvasBitmap::getData( rendering::IntegerB
rendering::VolatileContentDestroyedException,
uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
bitmapLayout = getMemoryLayout();
@@ -576,7 +577,7 @@ uno::Sequence< sal_Int8 > SAL_CALL VclCanvasBitmap::getPixel( rendering::Integer
rendering::VolatileContentDestroyedException,
uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
bitmapLayout = getMemoryLayout();
@@ -642,7 +643,7 @@ uno::Sequence< sal_Int8 > SAL_CALL VclCanvasBitmap::getPixel( rendering::Integer
uno::Reference< rendering::XBitmapPalette > SAL_CALL VclCanvasBitmap::getPalette() throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
uno::Reference< XBitmapPalette > aRet;
if( m_bPalette )
@@ -653,7 +654,7 @@ uno::Reference< rendering::XBitmapPalette > SAL_CALL VclCanvasBitmap::getPalette
rendering::IntegerBitmapLayout SAL_CALL VclCanvasBitmap::getMemoryLayout() throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
rendering::IntegerBitmapLayout aLayout( m_aLayout );
@@ -670,7 +671,7 @@ rendering::IntegerBitmapLayout SAL_CALL VclCanvasBitmap::getMemoryLayout() throw
sal_Int32 SAL_CALL VclCanvasBitmap::getNumberOfEntries() throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
if( !m_pBmpAcc )
return 0;
@@ -680,13 +681,13 @@ sal_Int32 SAL_CALL VclCanvasBitmap::getNumberOfEntries() throw (uno::RuntimeExce
sal_Bool SAL_CALL VclCanvasBitmap::getIndex( uno::Sequence< double >& o_entry, sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
const sal_uInt16 nCount( m_pBmpAcc ?
(m_pBmpAcc->HasPalette() ? m_pBmpAcc->GetPaletteEntryCount() : 0 ) : 0 );
OSL_ENSURE(nIndex >= 0 && nIndex < nCount,"Palette index out of range");
if( nIndex < 0 || nIndex >= nCount )
- throw lang::IndexOutOfBoundsException(::rtl::OUString::createFromAscii("Palette index out of range"),
+ throw lang::IndexOutOfBoundsException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Palette index out of range")),
static_cast<rendering::XBitmapPalette*>(this));
const BitmapColor aCol = m_pBmpAcc->GetPaletteColor(sal::static_int_cast<sal_uInt16>(nIndex));
@@ -701,14 +702,14 @@ sal_Bool SAL_CALL VclCanvasBitmap::getIndex( uno::Sequence< double >& o_entry, s
sal_Bool SAL_CALL VclCanvasBitmap::setIndex( const uno::Sequence< double >&, sal_Bool, sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, lang::IllegalArgumentException, uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
const sal_uInt16 nCount( m_pBmpAcc ?
(m_pBmpAcc->HasPalette() ? m_pBmpAcc->GetPaletteEntryCount() : 0 ) : 0 );
OSL_ENSURE(nIndex >= 0 && nIndex < nCount,"Palette index out of range");
if( nIndex < 0 || nIndex >= nCount )
- throw lang::IndexOutOfBoundsException(::rtl::OUString::createFromAscii("Palette index out of range"),
+ throw lang::IndexOutOfBoundsException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Palette index out of range")),
static_cast<rendering::XBitmapPalette*>(this));
return sal_False; // read-only implementation
@@ -740,7 +741,7 @@ sal_Int8 SAL_CALL VclCanvasBitmap::getType( ) throw (uno::RuntimeException)
uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::getComponentTags( ) throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
return m_aComponentTags;
}
@@ -766,7 +767,7 @@ uno::Sequence< double > SAL_CALL VclCanvasBitmap::convertColorSpace( const uno::
uno::Sequence<rendering::RGBColor> SAL_CALL VclCanvasBitmap::convertToRGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException,uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
const sal_Size nLen( deviceColor.getLength() );
const sal_Int32 nComponentsPerPixel(m_aComponentTags.getLength());
@@ -815,7 +816,7 @@ uno::Sequence<rendering::RGBColor> SAL_CALL VclCanvasBitmap::convertToRGB( const
uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertToARGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException,uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
const sal_Size nLen( deviceColor.getLength() );
const sal_Int32 nComponentsPerPixel(m_aComponentTags.getLength());
@@ -868,7 +869,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertToARGB( con
uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertToPARGB( const uno::Sequence< double >& deviceColor ) throw (lang::IllegalArgumentException,uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
const sal_Size nLen( deviceColor.getLength() );
const sal_Int32 nComponentsPerPixel(m_aComponentTags.getLength());
@@ -921,7 +922,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertToPARGB( co
uno::Sequence< double > SAL_CALL VclCanvasBitmap::convertFromRGB( const uno::Sequence<rendering::RGBColor>& rgbColor ) throw (lang::IllegalArgumentException,uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
const sal_Size nLen( rgbColor.getLength() );
const sal_Int32 nComponentsPerPixel(m_aComponentTags.getLength());
@@ -961,7 +962,7 @@ uno::Sequence< double > SAL_CALL VclCanvasBitmap::convertFromRGB( const uno::Seq
uno::Sequence< double > SAL_CALL VclCanvasBitmap::convertFromARGB( const uno::Sequence<rendering::ARGBColor>& rgbColor ) throw (lang::IllegalArgumentException,uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
const sal_Size nLen( rgbColor.getLength() );
const sal_Int32 nComponentsPerPixel(m_aComponentTags.getLength());
@@ -1001,7 +1002,7 @@ uno::Sequence< double > SAL_CALL VclCanvasBitmap::convertFromARGB( const uno::Se
uno::Sequence< double > SAL_CALL VclCanvasBitmap::convertFromPARGB( const uno::Sequence<rendering::ARGBColor>& rgbColor ) throw (lang::IllegalArgumentException,uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
const sal_Size nLen( rgbColor.getLength() );
const sal_Int32 nComponentsPerPixel(m_aComponentTags.getLength());
@@ -1043,19 +1044,19 @@ uno::Sequence< double > SAL_CALL VclCanvasBitmap::convertFromPARGB( const uno::S
sal_Int32 SAL_CALL VclCanvasBitmap::getBitsPerPixel( ) throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
return m_nBitsPerOutputPixel;
}
uno::Sequence< ::sal_Int32 > SAL_CALL VclCanvasBitmap::getComponentBitCounts( ) throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
return m_aComponentBitCounts;
}
sal_Int8 SAL_CALL VclCanvasBitmap::getEndianness( ) throw (uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
return m_nEndianness;
}
@@ -1064,7 +1065,7 @@ uno::Sequence<double> SAL_CALL VclCanvasBitmap::convertFromIntegerColorSpace( co
{
if( dynamic_cast<VclCanvasBitmap*>(targetColorSpace.get()) )
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
const sal_Size nLen( deviceColor.getLength() );
const sal_Int32 nComponentsPerPixel(m_aComponentTags.getLength());
@@ -1143,7 +1144,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertToIntegerColorSpace
uno::Sequence<rendering::RGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToRGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException,uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
const sal_uInt8* pIn( reinterpret_cast<const sal_uInt8*>(deviceColor.getConstArray()) );
const sal_Size nLen( deviceColor.getLength() );
@@ -1198,7 +1199,7 @@ uno::Sequence<rendering::RGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToRGB
uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToARGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException,uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
const sal_uInt8* pIn( reinterpret_cast<const sal_uInt8*>(deviceColor.getConstArray()) );
const sal_Size nLen( deviceColor.getLength() );
@@ -1256,7 +1257,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToAR
uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToPARGB( const uno::Sequence< ::sal_Int8 >& deviceColor ) throw (lang::IllegalArgumentException,uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
const sal_uInt8* pIn( reinterpret_cast<const sal_uInt8*>(deviceColor.getConstArray()) );
const sal_Size nLen( deviceColor.getLength() );
@@ -1315,7 +1316,7 @@ uno::Sequence<rendering::ARGBColor> SAL_CALL VclCanvasBitmap::convertIntegerToPA
uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromRGB( const uno::Sequence<rendering::RGBColor>& rgbColor ) throw (lang::IllegalArgumentException,uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
const sal_Size nLen( rgbColor.getLength() );
const sal_Int32 nNumBytes((nLen*m_nBitsPerOutputPixel+7)/8);
@@ -1364,7 +1365,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromRGB( con
uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromARGB( const uno::Sequence<rendering::ARGBColor>& rgbColor ) throw (lang::IllegalArgumentException,uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
const sal_Size nLen( rgbColor.getLength() );
const sal_Int32 nNumBytes((nLen*m_nBitsPerOutputPixel+7)/8);
@@ -1413,7 +1414,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromARGB( co
uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromPARGB( const uno::Sequence<rendering::ARGBColor>& rgbColor ) throw (lang::IllegalArgumentException,uno::RuntimeException)
{
- vos::OGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexGuard aGuard;
const sal_Size nLen( rgbColor.getLength() );
const sal_Int32 nNumBytes((nLen*m_nBitsPerOutputPixel+7)/8);
@@ -1465,3 +1466,5 @@ BitmapEx VclCanvasBitmap::getBitmapEx() const
{
return m_aBmpEx;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/helper/canvastools.cxx b/vcl/source/helper/canvastools.cxx
index 36fdd514efe9..3bf73ca7588d 100644
--- a/vcl/source/helper/canvastools.cxx
+++ b/vcl/source/helper/canvastools.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,7 +72,7 @@
#include <vcl/canvasbitmap.hxx>
#include <vcl/canvastools.hxx>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
using namespace ::com::sun::star;
@@ -186,8 +187,8 @@ namespace vcl
const uno::Sequence< sal_Int8 > getTunnelIdentifier( TunnelIdentifierType eType )
{
- static std::hash_map< int, uno::Sequence< sal_Int8 > > aIds;
- std::hash_map< int, uno::Sequence< sal_Int8 > >::iterator it =
+ static boost::unordered_map< int, uno::Sequence< sal_Int8 > > aIds;
+ boost::unordered_map< int, uno::Sequence< sal_Int8 > >::iterator it =
aIds.find( eType );
if( it == aIds.end() )
{
@@ -819,13 +820,13 @@ namespace vcl
const uno::Sequence< double > rColor,
const uno::Reference< rendering::XColorSpace >& xColorSpace )
{
- const rendering::ARGBColor& rARGBColor(
+ const rendering::ARGBColor aARGBColor(
xColorSpace->convertToARGB(rColor)[0]);
- return Color( 255-toByteColor(rARGBColor.Alpha),
- toByteColor(rARGBColor.Red),
- toByteColor(rARGBColor.Green),
- toByteColor(rARGBColor.Blue) );
+ return Color( 255-toByteColor(aARGBColor.Alpha),
+ toByteColor(aARGBColor.Red),
+ toByteColor(aARGBColor.Green),
+ toByteColor(aARGBColor.Blue) );
}
//---------------------------------------------------------------------------------------
@@ -835,3 +836,5 @@ namespace vcl
} // namespace canvas
// eof
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/helper/evntpost.cxx b/vcl/source/helper/evntpost.cxx
index 9e200a3136c3..a8a68640ec36 100644
--- a/vcl/source/helper/evntpost.cxx
+++ b/vcl/source/helper/evntpost.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,3 +64,5 @@ IMPL_LINK_INLINE_START( EventPoster, DoEvent_Impl, UserEvent*, pEvent )
IMPL_LINK_INLINE_END( EventPoster, DoEvent_Impl, UserEvent*, pEvent )
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/helper/lazydelete.cxx b/vcl/source/helper/lazydelete.cxx
index f5ecd02f39ae..9173474af759 100644
--- a/vcl/source/helper/lazydelete.cxx
+++ b/vcl/source/helper/lazydelete.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -123,3 +124,4 @@ void DeleteOnDeinitBase::ImplDeleteOnDeInit()
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx
index b1da78ebbf23..c8b5cc7fbf22 100644
--- a/vcl/source/helper/strhelper.cxx
+++ b/vcl/source/helper/strhelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -440,3 +441,5 @@ ByteString WhitespaceToSpace( const ByteString& rLine, sal_Bool bProtect )
}
} // namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/helper/threadex.cxx b/vcl/source/helper/threadex.cxx
index cff1ec4a7d82..ad351410e2c2 100644
--- a/vcl/source/helper/threadex.cxx
+++ b/vcl/source/helper/threadex.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -101,7 +102,7 @@ IMPL_LINK( SolarThreadExecutor, worker, void*, EMPTYARG )
long SolarThreadExecutor::impl_execute( const TimeValue* _pTimeout )
{
- if( ::vos::OThread::getCurrentIdentifier() == Application::GetMainThreadIdentifier() )
+ if( ::osl::Thread::getCurrentIdentifier() == Application::GetMainThreadIdentifier() )
{
osl_setCondition( m_aStart );
m_nReturn = doIt();
@@ -125,3 +126,5 @@ long SolarThreadExecutor::impl_execute( const TimeValue* _pTimeout )
}
return m_nReturn;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/helper/xconnection.cxx b/vcl/source/helper/xconnection.cxx
index a0cc8c35e5e2..d6aa0429bcf3 100644
--- a/vcl/source/helper/xconnection.cxx
+++ b/vcl/source/helper/xconnection.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,31 +42,12 @@ namespace css = com::sun::star;
}
-namespace vcl
-{
- class SolarMutexReleaser
- {
- sal_uLong mnReleased;
- public:
- SolarMutexReleaser()
- {
- mnReleased = Application::ReleaseSolarMutex();
- }
-
- ~SolarMutexReleaser()
- {
- if( mnReleased )
- Application::AcquireSolarMutex( mnReleased );
- }
- };
-}
-
-using namespace rtl;
using namespace osl;
using namespace vcl;
using namespace com::sun::star::uno;
using namespace com::sun::star::awt;
+using ::rtl::OUString;
DisplayConnection::DisplayConnection()
{
@@ -179,3 +161,5 @@ bool DisplayConnection::dispatchErrorEvent( void* pData, int nBytes )
return false;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/salmain/salmain.cxx b/vcl/source/salmain/salmain.cxx
index c2e3af01635a..e5135b9aa241 100644
--- a/vcl/source/salmain/salmain.cxx
+++ b/vcl/source/salmain/salmain.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,5 +37,7 @@
SAL_IMPLEMENT_MAIN() {
tools::extendApplicationEnvironment();
- return SVMain() ? EXIT_SUCCESS : EXIT_FAILURE;
+ return SVMain();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/src/btntext.src b/vcl/source/src/btntext.src
index b786184fa2f3..a6792b202b3d 100644
--- a/vcl/source/src/btntext.src
+++ b/vcl/source/src/btntext.src
@@ -80,4 +80,3 @@ String SV_BUTTONTEXT_ABORT
{
Text [ en-US ] = "~Abort";
};
-
diff --git a/vcl/source/src/helptext.src b/vcl/source/src/helptext.src
index a42a9531d9ee..59d7ea3d443e 100644
--- a/vcl/source/src/helptext.src
+++ b/vcl/source/src/helptext.src
@@ -138,26 +138,3 @@ String SV_SHORTCUT_SPLITTER
{
Text [ en-US ] = "Split window separator" ;
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/vcl/source/src/images.src b/vcl/source/src/images.src
index 000d7215d80d..541ac34c29e7 100644
--- a/vcl/source/src/images.src
+++ b/vcl/source/src/images.src
@@ -35,7 +35,7 @@
Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_STDOFFSET)
{
- File = "check.bmp";
+ File = "check.png";
};
@@ -46,19 +46,19 @@ Bitmap (SV_RESID_BITMAP_CHECK + SV_RESID_MONOOFFSET)
Bitmap (SV_RESID_BITMAP_SCROLLBMP)
{
- File = "scrbmp.bmp";
+ File = "scrbmp.png";
};
Bitmap (SV_RESID_BITMAP_SCROLLMSK)
{
- File = "scrmsk.bmp";
+ File = "scrmsk.png";
};
// -----------------------------------------------------------------------
Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_STDOFFSET)
{
- File = "radio.bmp";
+ File = "radio.png";
};
Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_MONOOFFSET)
@@ -66,63 +66,41 @@ Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_MONOOFFSET)
File = "radiomono.bmp";
};
-// -----------------------------------------------------------------------
-
Bitmap SV_RESID_BITMAP_MSGBOX
{
File = "msgbox.png";
};
-// -----------------------------------------------------------------------
-
-Bitmap SV_RESID_BITMAP_MSGBOX_HC
-{
- File = "msgbox_hc.png";
-};
-
-// -----------------------------------------------------------------------
-
Bitmap SV_RESID_BITMAP_PIN
{
- File = "pin.bmp";
+ File = "pin.png";
};
-// -----------------------------------------------------------------------
-
Bitmap SV_RESID_BITMAP_CLOSEDOC
{
- File = "closedoc.bmp";
-};
-
-Bitmap SV_RESID_BITMAP_CLOSEDOCHC
-{
- File = "closedochc.bmp";
+ File = "closedoc.png";
};
-// -----------------------------------------------------------------------
-
Bitmap SV_RESID_BITMAP_SPLITHPIN
{
- File = "splhpin.bmp";
+ File = "splhpin.png";
};
Bitmap SV_RESID_BITMAP_SPLITVPIN
{
- File = "splvpin.bmp";
+ File = "splvpin.png";
};
Bitmap SV_RESID_BITMAP_SPLITHARW
{
- File = "splharw.bmp";
+ File = "splharw.png";
};
Bitmap SV_RESID_BITMAP_SPLITVARW
{
- File = "splvarw.bmp";
+ File = "splvarw.png";
};
-// -----------------------------------------------------------------------
-
Bitmap (SV_ICON_SIZE48_START)
{
File = "mainapp_48_8.png" ;
@@ -421,16 +399,6 @@ Bitmap (SV_ICON_SMALL_START)
File = "mainapp_16.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START)
-{
- File = "mainapp_32_h.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START)
-{
- File = "mainapp_16_h.png" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_OFFICE)
{
File = "mainapp_32.png" ;
@@ -441,16 +409,6 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_OFFICE)
File = "mainapp_16.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_OFFICE)
-{
- File = "mainapp_32_h.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_OFFICE)
-{
- File = "mainapp_16_h" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_TEXT)
{
File = "lx03251.png" ;
@@ -461,16 +419,6 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_TEXT)
File = "sx03251.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_TEXT)
-{
- File = "lxh03251.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_TEXT)
-{
- File = "sxh03251.png" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_TEXT_TEMPLATE)
{
File = "lx03255.png" ;
@@ -481,16 +429,6 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_TEXT_TEMPLATE)
File = "sx03255.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_TEXT_TEMPLATE)
-{
- File = "lxh03255.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_TEXT_TEMPLATE)
-{
- File = "sxh03255.png" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_SPREADSHEET)
{
File = "lx03250.png" ;
@@ -501,16 +439,6 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_SPREADSHEET)
File = "sx03250.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_SPREADSHEET)
-{
- File = "lxh03250.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_SPREADSHEET)
-{
- File = "sxh03250.png" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_SPREADSHEET_TEMPLATE)
{
File = "lx03254.png" ;
@@ -521,16 +449,6 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_SPREADSHEET_TEMPLATE)
File = "sx03254.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_SPREADSHEET_TEMPLATE)
-{
- File = "lxh03254.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_SPREADSHEET_TEMPLATE)
-{
- File = "sxh03254.png" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_DRAWING)
{
File = "lx03246.png" ;
@@ -541,16 +459,6 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_DRAWING)
File = "sx03246.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_DRAWING)
-{
- File = "lxh03246.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_DRAWING)
-{
- File = "sxh03246.png" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_DRAWING_TEMPLATE)
{
File = "lx03252.png" ;
@@ -561,16 +469,6 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_DRAWING_TEMPLATE)
File = "sx03252.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_DRAWING_TEMPLATE)
-{
- File = "lxh03252.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_DRAWING_TEMPLATE)
-{
- File = "sxh03252.png" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_PRESENTATION)
{
File = "lx03249.png" ;
@@ -581,16 +479,6 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_PRESENTATION)
File = "sx03249.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_PRESENTATION)
-{
- File = "lxh03249.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_PRESENTATION)
-{
- File = "sxh03249.png" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_PRESENTATION_TEMPLATE)
{
File = "lx03253.png" ;
@@ -601,16 +489,6 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_PRESENTATION_TEMPLATE)
File = "sx03253.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_PRESENTATION_TEMPLATE)
-{
- File = "lxh03253.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_PRESENTATION_TEMPLATE)
-{
- File = "sxh03253.png" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_PRESENTATION_COMPRESSED)
{
File = "lx03241.png" ;
@@ -621,16 +499,6 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_PRESENTATION_COMPRESSED)
File = "sx03241.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_PRESENTATION_COMPRESSED)
-{
- File = "lxh03241.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_PRESENTATION_COMPRESSED)
-{
- File = "sxh03241.png" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_MASTER_DOCUMENT)
{
File = "lx03248.png" ;
@@ -641,16 +509,6 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_MASTER_DOCUMENT)
File = "sx03248.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_MASTER_DOCUMENT)
-{
- File = "lxh03248.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_MASTER_DOCUMENT)
-{
- File = "sxh03248.png" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_HTML_DOCUMENT)
{
File = "lx03139.png" ;
@@ -661,16 +519,6 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_HTML_DOCUMENT)
File = "sx03139.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_HTML_DOCUMENT)
-{
- File = "lxh03139.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_HTML_DOCUMENT)
-{
- File = "sxh03139.png" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_CHART)
{
File = "lx03128.png" ;
@@ -681,16 +529,6 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_CHART)
File = "sx03128.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_CHART)
-{
- File = "lxh03128.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_CHART)
-{
- File = "sxh03128.png" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_DATABASE)
{
File = "lx03245.png" ;
@@ -701,16 +539,6 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_DATABASE)
File = "sx03245.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_DATABASE)
-{
- File = "lxh03245.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_DATABASE)
-{
- File = "sxh03245.png" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_FORMULA)
{
File = "lx03247.png" ;
@@ -721,16 +549,6 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_FORMULA)
File = "sx03247.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_FORMULA)
-{
- File = "lxh03247.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_FORMULA)
-{
- File = "sxh03247.png" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_TEMPLATE)
{
File = "lx03242.png" ;
@@ -741,16 +559,6 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_TEMPLATE)
File = "sx03242.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_TEMPLATE)
-{
- File = "lxh03242.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_TEMPLATE)
-{
- File = "sxh03242.png" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_MACRO)
{
File = "lx03216.png" ;
@@ -761,16 +569,6 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_MACRO)
File = "sx03216.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_MACRO)
-{
- File = "lxh03216.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_MACRO)
-{
- File = "sxh03216.png" ;
-};
-
Bitmap (SV_ICON_LARGE_START + SV_ICON_ID_PRINTERADMIN)
{
File = "printeradmin_32.png" ;
@@ -781,33 +579,13 @@ Bitmap (SV_ICON_SMALL_START + SV_ICON_ID_PRINTERADMIN)
File = "printeradmin_16.png" ;
};
-Bitmap (SV_ICON_LARGE_HC_START + SV_ICON_ID_PRINTERADMIN)
-{
- File = "printeradmin_32_h.png" ;
-};
-
-Bitmap (SV_ICON_SMALL_HC_START + SV_ICON_ID_PRINTERADMIN)
-{
- File = "printeradmin_16_h.png" ;
-};
-
Bitmap SV_DISCLOSURE_PLUS
{
File = "plus.png";
};
-Bitmap SV_DISCLOSURE_PLUS_HC
-{
- File = "plus_sch.png";
-};
-
Bitmap SV_DISCLOSURE_MINUS
{
File = "minus.png";
};
-Bitmap SV_DISCLOSURE_MINUS_HC
-{
- File = "minus_sch.png";
-};
-
diff --git a/vcl/source/src/makefile.mk b/vcl/source/src/makefile.mk
index 161d821573b9..2db77b7ffc74 100644
--- a/vcl/source/src/makefile.mk
+++ b/vcl/source/src/makefile.mk
@@ -45,7 +45,6 @@ SRC1FILES= images.src \
units.src \
btntext.src \
print.src \
- throbber.src \
RESLIB1NAME= $(RESTARGET)
RESLIB1IMAGES= $(PRJ)$/source/src
diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src
index f41e65f4939f..b4f4d56029e1 100644
--- a/vcl/source/src/print.src
+++ b/vcl/source/src/print.src
@@ -403,16 +403,6 @@ ModalDialog SV_DLG_PRINT
ImageBitmap = Bitmap { File = "ncollate.png" ; };
};
- Image SV_PRINT_COLLATE_HC_IMG
- {
- ImageBitmap = Bitmap { File = "collate_h.png" ; };
- };
-
- Image SV_PRINT_NOCOLLATE_HC_IMG
- {
- ImageBitmap = Bitmap { File = "ncollate_h.png" ; };
- };
-
CheckBox SV_PRINT_OPT_REVERSE
{
HelpID = ".HelpID:vcl:PrintDialog:OptPage:ToReverse";
diff --git a/vcl/source/src/units.src b/vcl/source/src/units.src
index 16b40b3f41a3..0a680fcb1913 100644
--- a/vcl/source/src/units.src
+++ b/vcl/source/src/units.src
@@ -30,6 +30,7 @@
#include <vcl/svids.hrc>
#endif
+// Amelia : adds two units , 'ch' and 'line'
StringArray SV_FUNIT_STRINGS
{
ItemList [ en-US ] =
@@ -51,6 +52,8 @@ StringArray SV_FUNIT_STRINGS
< "feet" ; FUNIT_FOOT ; > ;
< "miles" ; FUNIT_MILE ; > ;
< "mile" ; FUNIT_MILE ; > ;
+ < "ch" ; FUNIT_CHAR ; > ;
+ < "line" ; FUNIT_LINE ; > ;
< "%" ; FUNIT_PERCENT ; > ;
};
};
diff --git a/vcl/source/window/abstdlg.cxx b/vcl/source/window/abstdlg.cxx
index 7f00b73b0808..d60dbb83b6c5 100644
--- a/vcl/source/window/abstdlg.cxx
+++ b/vcl/source/window/abstdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,7 +45,7 @@ VclAbstractDialogFactory* VclAbstractDialogFactory::Create()
static ::osl::Module aDialogLibrary;
if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, String( RTL_CONSTASCII_USTRINGPARAM( DLL_NAME ) ) ) )
fp = ( VclAbstractDialogFactory* (__LOADONCALLAPI*)() )
- aDialogLibrary.getFunctionSymbol( ::rtl::OUString::createFromAscii("CreateDialogFactory") );
+ aDialogLibrary.getFunctionSymbol( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CreateDialogFactory")) );
if ( fp )
return fp();
return 0;
@@ -62,3 +63,5 @@ VclAbstractDialog2::~VclAbstractDialog2()
VclAbstractDialogFactory::~VclAbstractDialogFactory()
{
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx
index be71aa3e02e6..0f0caecfe856 100644
--- a/vcl/source/window/accel.cxx
+++ b/vcl/source/window/accel.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,24 +28,19 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <tools/list.hxx>
-#ifndef _TABLE_HXX
+
#include <tools/table.hxx>
-#endif
#include <tools/debug.hxx>
#include <vcl/svapp.hxx>
#include <vcl/accel.h>
#include <vcl/accel.hxx>
-#ifndef _RC_H
#include <tools/rc.h>
-#endif
-
-
+#include <vector>
// =======================================================================
DECLARE_TABLE( ImplAccelTable, ImplAccelEntry* )
-DECLARE_LIST( ImplAccelList, ImplAccelEntry* )
+typedef ::std::vector< ImplAccelEntry* > ImplAccelList;
#define ACCELENTRY_NOTFOUND ((sal_uInt16)0xFFFF)
@@ -66,14 +62,14 @@ DBG_NAME( Accelerator )
sal_uInt16 ImplAccelEntryGetIndex( ImplAccelList* pList, sal_uInt16 nId,
sal_uInt16* pIndex = NULL )
{
- sal_uLong nLow;
- sal_uLong nHigh;
- sal_uLong nMid;
- sal_uLong nCount = pList->Count();
+ size_t nLow;
+ size_t nHigh;
+ size_t nMid;
+ size_t nCount = pList->size();
sal_uInt16 nCompareId;
// Abpruefen, ob der erste Key groesser als der Vergleichskey ist
- if ( !nCount || (nId < pList->GetObject( 0 )->mnId) )
+ if ( !nCount || (nId < (*pList)[ 0 ]->mnId) )
{
if ( pIndex )
*pIndex = 0;
@@ -86,7 +82,7 @@ sal_uInt16 ImplAccelEntryGetIndex( ImplAccelList* pList, sal_uInt16 nId,
do
{
nMid = (nLow + nHigh) / 2;
- nCompareId = pList->GetObject( nMid )->mnId;
+ nCompareId = (*pList)[ nMid ]->mnId;
if ( nId < nCompareId )
nHigh = nMid-1;
else
@@ -122,16 +118,29 @@ static void ImplAccelEntryInsert( ImplAccelList* pList, ImplAccelEntry* pEntry )
do
{
nIndex++;
- ImplAccelEntry* pTempEntry = pList->GetObject( nIndex );
+ ImplAccelEntry* pTempEntry = (*pList)[ nIndex ];
if ( !pTempEntry || (pTempEntry->mnId != pEntry->mnId) )
break;
}
- while ( nIndex < pList->Count() );
-
- pList->Insert( pEntry, (sal_uLong)nIndex );
+ while ( nIndex < pList->size() );
+
+ if ( nIndex < pList->size() ) {
+ ImplAccelList::iterator it = pList->begin();
+ ::std::advance( it, nIndex );
+ pList->insert( it, pEntry );
+ } else {
+ pList->push_back( pEntry );
+ }
+ }
+ else {
+ if ( nInsIndex < pList->size() ) {
+ ImplAccelList::iterator it = pList->begin();
+ ::std::advance( it, nInsIndex );
+ pList->insert( it, pEntry );
+ } else {
+ pList->push_back( pEntry );
+ }
}
- else
- pList->Insert( pEntry, (sal_uLong)nInsIndex );
}
// -----------------------------------------------------------------------
@@ -144,11 +153,11 @@ static sal_uInt16 ImplAccelEntryGetFirstPos( ImplAccelList* pList, sal_uInt16 nI
while ( nIndex )
{
nIndex--;
- if ( pList->GetObject( nIndex )->mnId != nId )
+ if ( (*pList)[ nIndex ]->mnId != nId )
break;
}
- if ( pList->GetObject( nIndex )->mnId != nId )
+ if ( (*pList)[ nIndex ]->mnId != nId )
nIndex++;
}
@@ -177,10 +186,9 @@ ImplAccelEntry* Accelerator::ImplGetAccelData( const KeyCode& rKeyCode ) const
void Accelerator::ImplCopyData( ImplAccelData& rAccelData )
{
// Tabellen kopieren
- ImplAccelEntry* pEntry = rAccelData.maIdList.First();
- while ( pEntry )
+ for ( size_t i = 0, n = rAccelData.maIdList.size(); i < n; ++i )
{
- pEntry = new ImplAccelEntry( *pEntry );
+ ImplAccelEntry* pEntry = new ImplAccelEntry( *rAccelData.maIdList[ i ] );
// Folge-Accelerator, dann auch kopieren
if ( pEntry->mpAccel )
@@ -192,9 +200,7 @@ void Accelerator::ImplCopyData( ImplAccelData& rAccelData )
pEntry->mpAutoAccel = NULL;
mpData->maKeyTable.Insert( (sal_uLong)pEntry->maKeyCode.GetFullKeyCode(), pEntry );
- mpData->maIdList.Insert( pEntry, LIST_APPEND );
-
- pEntry = rAccelData.maIdList.Next();
+ mpData->maIdList.push_back( pEntry );
}
}
@@ -203,16 +209,14 @@ void Accelerator::ImplCopyData( ImplAccelData& rAccelData )
void Accelerator::ImplDeleteData()
{
// Accelerator-Eintraege ueber die Id-Tabelle loeschen
- ImplAccelEntry* pEntry = mpData->maIdList.First();
- while ( pEntry )
- {
- // AutoResAccel zerstoeren
- if ( pEntry->mpAutoAccel )
+ for ( size_t i = 0, n = mpData->maIdList.size(); i < n; ++i ) {
+ ImplAccelEntry* pEntry = mpData->maIdList[ i ];
+ if ( pEntry->mpAutoAccel ) {
delete pEntry->mpAutoAccel;
+ }
delete pEntry;
-
- pEntry = mpData->maIdList.Next();
}
+ mpData->maIdList.clear();
}
// -----------------------------------------------------------------------
@@ -259,7 +263,7 @@ void Accelerator::ImplInsertAccel( sal_uInt16 nItemId, const KeyCode& rKeyCode,
sal_uLong nCode = rKeyCode.GetFullKeyCode();
if ( !nCode )
{
- DBG_ERROR( "Accelerator::InsertItem(): KeyCode with KeyCode 0 not allowed" );
+ OSL_FAIL( "Accelerator::InsertItem(): KeyCode with KeyCode 0 not allowed" );
delete pEntry;
}
else if ( !mpData->maKeyTable.Insert( nCode, pEntry ) )
@@ -414,11 +418,14 @@ void Accelerator::RemoveItem( sal_uInt16 nItemId )
sal_uInt16 nItemCount = GetItemCount();
do
{
- ImplAccelEntry* pEntry = mpData->maIdList.GetObject( (sal_uLong)nIndex );
+ ImplAccelEntry* pEntry = ( nIndex < mpData->maIdList.size() ) ? mpData->maIdList[ nIndex ] : NULL;
if ( pEntry && pEntry->mnId == nItemId )
{
mpData->maKeyTable.Remove( pEntry->maKeyCode.GetFullKeyCode() );
- mpData->maIdList.Remove( (sal_uLong)nIndex );
+
+ ImplAccelList::iterator it = mpData->maIdList.begin();
+ ::std::advance( it, nIndex );
+ mpData->maIdList.erase( it );
// AutoResAccel zerstoeren
if ( pEntry->mpAutoAccel )
@@ -447,14 +454,17 @@ void Accelerator::RemoveItem( const KeyCode rKeyCode )
sal_uInt16 nItemCount = GetItemCount();
do
{
- if ( mpData->maIdList.GetObject( (sal_uLong)nIndex ) == pEntry )
+ if ( mpData->maIdList[ nIndex ] == pEntry )
break;
nIndex++;
}
while ( nIndex < nItemCount );
mpData->maKeyTable.Remove( rKeyCode.GetFullKeyCode() );
- mpData->maIdList.Remove( (sal_uLong)nIndex );
+
+ ImplAccelList::iterator it = mpData->maIdList.begin();
+ ::std::advance( it, nIndex );
+ mpData->maIdList.erase( it );
// AutoResAccel zerstoeren
if ( pEntry->mpAutoAccel )
@@ -472,7 +482,6 @@ void Accelerator::Clear()
ImplDeleteData();
mpData->maKeyTable.Clear();
- mpData->maIdList.Clear();
}
// -----------------------------------------------------------------------
@@ -481,7 +490,7 @@ sal_uInt16 Accelerator::GetItemCount() const
{
DBG_CHKTHIS( Accelerator, NULL );
- return (sal_uInt16)mpData->maIdList.Count();
+ return (sal_uInt16)mpData->maIdList.size();
}
// -----------------------------------------------------------------------
@@ -490,7 +499,7 @@ sal_uInt16 Accelerator::GetItemId( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- ImplAccelEntry* pEntry = mpData->maIdList.GetObject( (sal_uLong)nPos );
+ ImplAccelEntry* pEntry = ( nPos < mpData->maIdList.size() ) ? mpData->maIdList[ nPos ] : NULL;
if ( pEntry )
return pEntry->mnId;
else
@@ -503,7 +512,7 @@ KeyCode Accelerator::GetItemKeyCode( sal_uInt16 nPos ) const
{
DBG_CHKTHIS( Accelerator, NULL );
- ImplAccelEntry* pEntry = mpData->maIdList.GetObject( (sal_uLong)nPos );
+ ImplAccelEntry* pEntry = ( nPos < mpData->maIdList.size() ) ? mpData->maIdList[ nPos ] : NULL;
if ( pEntry )
return pEntry->maKeyCode;
else
@@ -531,7 +540,7 @@ KeyCode Accelerator::GetKeyCode( sal_uInt16 nItemId ) const
sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
- return mpData->maIdList.GetObject( (sal_uLong)nIndex )->maKeyCode;
+ return mpData->maIdList[ nIndex ]->maKeyCode;
else
return KeyCode();
}
@@ -599,7 +608,7 @@ void Accelerator::SetAccel( sal_uInt16 nItemId, Accelerator* pAccel )
sal_uInt16 nItemCount = GetItemCount();
do
{
- ImplAccelEntry* pEntry = mpData->maIdList.GetObject( (sal_uLong)nIndex );
+ ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ];
if ( pEntry->mnId != nItemId )
break;
@@ -618,7 +627,7 @@ Accelerator* Accelerator::GetAccel( sal_uInt16 nItemId ) const
sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
- return mpData->maIdList.GetObject( (sal_uLong)nIndex )->mpAccel;
+ return mpData->maIdList[ nIndex ]->mpAccel;
else
return NULL;
}
@@ -659,7 +668,7 @@ void Accelerator::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable )
sal_uInt16 nItemCount = GetItemCount();
do
{
- ImplAccelEntry* pEntry = mpData->maIdList.GetObject( (sal_uLong)nIndex );
+ ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ];
if ( pEntry->mnId != nItemId )
break;
@@ -678,7 +687,7 @@ sal_Bool Accelerator::IsItemEnabled( sal_uInt16 nItemId ) const
sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId );
if ( nIndex != ACCELENTRY_NOTFOUND )
- return mpData->maIdList.GetObject( (sal_uLong)nIndex )->mbEnabled;
+ return mpData->maIdList[ nIndex ]->mbEnabled;
else
return sal_False;
}
@@ -724,8 +733,9 @@ Accelerator& Accelerator::operator=( const Accelerator& rAccel )
// Tabellen loeschen und kopieren
ImplDeleteData();
mpData->maKeyTable.Clear();
- mpData->maIdList.Clear();
ImplCopyData( *((ImplAccelData*)(rAccel.mpData)) );
return *this;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/accmgr.cxx b/vcl/source/window/accmgr.cxx
index 6b30dd3a3c23..c8b1e42c5ed1 100644
--- a/vcl/source/window/accmgr.cxx
+++ b/vcl/source/window/accmgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,18 +28,12 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <tools/list.hxx>
+
#include <tools/debug.hxx>
#include <vcl/accel.h>
#include <vcl/accel.hxx>
#include <vcl/accmgr.hxx>
-
-
-// =======================================================================
-
-DECLARE_LIST( ImplAccelList, Accelerator* )
-
// =======================================================================
DBG_NAMEEX( Accelerator )
@@ -57,18 +52,17 @@ ImplAccelManager::~ImplAccelManager()
sal_Bool ImplAccelManager::InsertAccel( Accelerator* pAccel )
{
- if ( !mpAccelList )
+ if ( !mpAccelList ) {
mpAccelList = new ImplAccelList;
- else
- {
- // Gibts den schon ?
- if ( mpAccelList->GetPos( pAccel ) != LIST_ENTRY_NOTFOUND )
- return sal_False;
+ } else {
+ for ( size_t i = 0, n = mpAccelList->size(); i < n; ++i ) {
+ if ( (*mpAccelList)[ i ] == pAccel ) {
+ return sal_False;
+ }
+ }
}
- // Am Anfang der Liste einfuegen
- mpAccelList->Insert( pAccel, (sal_uLong)0 );
-
+ mpAccelList->insert( mpAccelList->begin(), pAccel );
return sal_True;
}
@@ -84,21 +78,29 @@ void ImplAccelManager::RemoveAccel( Accelerator* pAccel )
//end it, and then closes the dialog, deleting the accelerators. So if
//we're removing an accelerator that a sub-accelerator which is in the
//sequence list, throw away the entire sequence
- if ( mpSequenceList )
- {
- for (sal_uInt16 i = 0; i < pAccel->GetItemCount(); ++i)
- {
- Accelerator* pSubAccel = pAccel->GetAccel(pAccel->GetItemId(i));
- if ( mpSequenceList->GetPos( pSubAccel ) != LIST_ENTRY_NOTFOUND )
- {
- EndSequence( true );
- break;
+ if ( mpSequenceList ) {
+ for (sal_uInt16 i = 0; i < pAccel->GetItemCount(); ++i) {
+ Accelerator* pSubAccel = pAccel->GetAccel( pAccel->GetItemId(i) );
+ for ( size_t j = 0, n = mpSequenceList->size(); j < n; ++j ) {
+ if ( (*mpSequenceList)[ j ] == pSubAccel ) {
+ EndSequence( true );
+ i = pAccel->GetItemCount();
+ break;
+ }
}
}
}
// Raus damit
- mpAccelList->Remove( pAccel );
+ for ( ImplAccelList::iterator it = mpAccelList->begin();
+ it < mpAccelList->end();
+ ++it
+ ) {
+ if ( *it == pAccel ) {
+ mpAccelList->erase( it );
+ break;
+ }
+ }
}
// -----------------------------------------------------------------------
@@ -110,9 +112,9 @@ void ImplAccelManager::EndSequence( sal_Bool bCancel )
return;
// Alle Deactivate-Handler der Acceleratoren in der Sequenz rufen
- Accelerator* pTempAccel = mpSequenceList->First();
- while( pTempAccel )
+ for ( size_t i = 0, n = mpSequenceList->size(); i < n; ++i )
{
+ Accelerator* pTempAccel = (*mpSequenceList)[ i ];
sal_Bool bDel = sal_False;
pTempAccel->mbIsCancel = bCancel;
pTempAccel->mpDel = &bDel;
@@ -122,8 +124,6 @@ void ImplAccelManager::EndSequence( sal_Bool bCancel )
pTempAccel->mbIsCancel = sal_False;
pTempAccel->mpDel = NULL;
}
-
- pTempAccel = mpSequenceList->Next();
}
// Sequenz-Liste loeschen
@@ -140,13 +140,13 @@ sal_Bool ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepe
// Haben wir ueberhaupt Acceleratoren ??
if ( !mpAccelList )
return sal_False;
- if ( !mpAccelList->Count() )
+ if ( mpAccelList->empty() )
return sal_False;
// Sind wir in einer Sequenz ?
if ( mpSequenceList )
{
- pAccel = mpSequenceList->GetObject( 0 );
+ pAccel = mpSequenceList->empty() ? NULL : (*mpSequenceList)[ 0 ];
DBG_CHKOBJ( pAccel, Accelerator, NULL );
// Nicht Gefunden ?
@@ -168,7 +168,7 @@ sal_Bool ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepe
{
DBG_CHKOBJ( pNextAccel, Accelerator, NULL );
- mpSequenceList->Insert( pNextAccel, (sal_uLong)0 );
+ mpSequenceList->insert( mpSequenceList->begin(), pNextAccel );
// Activate-Handler vom Neuen rufen
pNextAccel->Activate();
@@ -221,9 +221,9 @@ sal_Bool ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepe
}
// Durch die Liste der Acceleratoren wuehlen
- pAccel = mpAccelList->First();
- while ( pAccel )
+ for ( size_t i = 0, n = mpAccelList->size(); i < n; ++i )
{
+ pAccel = (*mpAccelList)[ i ];
DBG_CHKOBJ( pAccel, Accelerator, NULL );
// Ist der Eintrag da drin ?
@@ -239,8 +239,8 @@ sal_Bool ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepe
// Sequenz-Liste erzeugen
mpSequenceList = new ImplAccelList;
- mpSequenceList->Insert( pAccel, (sal_uLong)0 );
- mpSequenceList->Insert( pNextAccel, (sal_uLong)0 );
+ mpSequenceList->insert( mpSequenceList->begin(), pAccel );
+ mpSequenceList->insert( mpSequenceList->begin(), pNextAccel );
// Activate-Handler vom Neuen rufen
pNextAccel->Activate();
@@ -281,10 +281,9 @@ sal_Bool ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepe
return sal_False;
}
}
-
- // Nicht gefunden, vielleicht im naechsten Accelerator
- pAccel = mpAccelList->Next();
}
return sal_False;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/arrange.cxx b/vcl/source/window/arrange.cxx
index f016ef2c053b..28e0d8ae65fe 100644
--- a/vcl/source/window/arrange.cxx
+++ b/vcl/source/window/arrange.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1072,3 +1073,4 @@ void MatrixArranger::remove( boost::shared_ptr<WindowArranger> const &i_pChild )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 79454d8b1fe5..a71aadc3cdad 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,9 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVIDS_HRC
#include <vcl/svids.hrc>
-#endif
#include <vcl/svdata.hxx>
#include <vcl/event.hxx>
#include <vcl/decoview.hxx>
@@ -211,7 +210,7 @@ void ImplBorderWindowView::ImplInitTitle( ImplBorderFrameData* pData )
{
ImplBorderWindow* pBorderWindow = pData->mpBorderWindow;
- if ( !(pBorderWindow->GetStyle() & WB_MOVEABLE) ||
+ if ( !(pBorderWindow->GetStyle() & (WB_MOVEABLE | WB_POPUP)) ||
(pData->mnTitleType == BORDERWINDOW_TITLE_NONE) )
{
pData->mnTitleType = BORDERWINDOW_TITLE_NONE;
@@ -276,7 +275,7 @@ sal_uInt16 ImplBorderWindowView::ImplHitTest( ImplBorderFrameData* pData, const
// no corner resize for floating toolbars, which would lead to jumps while formatting
// setting nSizeWidth = 0 will only return pure left,top,right,bottom
- if( pBorderWindow->GetStyle() & WB_OWNERDRAWDECORATION )
+ if( pBorderWindow->GetStyle() & (WB_OWNERDRAWDECORATION | WB_POPUP) )
nSizeWidth = 0;
if ( rPos.X() < pData->mnLeftBorder )
@@ -1496,7 +1495,7 @@ void ImplStdBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHeigh
pData->mnTitleType = pBorderWindow->mnTitleType;
pData->mbFloatWindow = pBorderWindow->mbFloatWindow;
- if ( !(pBorderWindow->GetStyle() & WB_MOVEABLE) || (pData->mnTitleType == BORDERWINDOW_TITLE_NONE) )
+ if ( !(pBorderWindow->GetStyle() & (WB_MOVEABLE | WB_POPUP)) || (pData->mnTitleType == BORDERWINDOW_TITLE_NONE) )
pData->mnBorderSize = 0;
else if ( pData->mnTitleType == BORDERWINDOW_TITLE_TEAROFF )
pData->mnBorderSize = 0;
@@ -1521,7 +1520,7 @@ void ImplStdBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHeigh
// set a proper background for drawing
// highlighted buttons in the title
- pBorderWindow->SetBackground( rStyleSettings.GetWindowColor() );
+ pBorderWindow->SetBackground( rStyleSettings.GetFaceColor() );
pData->maTitleRect.Left() = pData->mnLeftBorder;
pData->maTitleRect.Right() = nWidth-pData->mnRightBorder-1;
@@ -1664,19 +1663,43 @@ void ImplStdBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* p
Rectangle aInRect( aTmpPoint, Size( pData->mnWidth, pData->mnHeight ) );
const StyleSettings& rStyleSettings = pData->mpOutDev->GetSettings().GetStyleSettings();
DecorationView aDecoView( pDev );
- Color aFrameColor( rStyleSettings.GetFaceColor() );
+ Color aFaceColor( rStyleSettings.GetFaceColor() );
+ Color aFrameColor( aFaceColor );
aFrameColor.DecreaseContrast( (sal_uInt8) (0.50 * 255));
// Draw Frame
if ( nDrawFlags & BORDERWINDOW_DRAW_FRAME )
{
+ Region oldClipRgn( pDev->GetClipRegion( ) );
+
+ // for popups, don't draw part of the frame
+ if ( pData->mnTitleType == BORDERWINDOW_TITLE_POPUP )
+ {
+ FloatingWindow *pWin = dynamic_cast< FloatingWindow* >( pData->mpBorderWindow->GetWindow( WINDOW_CLIENT ) );
+ if ( pWin )
+ {
+ Region aClipRgn( aInRect );
+ Rectangle aItemClipRect( pWin->ImplGetItemEdgeClipRect() );
+ if( !aItemClipRect.IsEmpty() )
+ {
+ aItemClipRect.SetPos( pData->mpBorderWindow->AbsoluteScreenToOutputPixel( aItemClipRect.TopLeft() ) );
+ aClipRgn.Exclude( aItemClipRect );
+ pDev->SetClipRegion( aClipRgn );
+ }
+ }
+ }
+
// single line frame
pDev->SetLineColor( aFrameColor );
pDev->SetFillColor();
pDev->DrawRect( aInRect );
aInRect.nLeft++; aInRect.nRight--;
aInRect.nTop++; aInRect.nBottom--;
+
+ // restore
+ if ( pData->mnTitleType == BORDERWINDOW_TITLE_POPUP )
+ pDev->SetClipRegion( oldClipRgn );
}
else
aInRect = aDecoView.DrawFrame( aInRect, FRAME_DRAW_DOUBLEOUT | FRAME_DRAW_NODRAW);
@@ -1703,7 +1726,11 @@ void ImplStdBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* p
aInRect = pData->maTitleRect;
// use no gradient anymore, just a static titlecolor
- pDev->SetFillColor( aFrameColor );
+ if ( pData->mnTitleType != BORDERWINDOW_TITLE_POPUP )
+ pDev->SetFillColor( aFrameColor );
+ else
+ pDev->SetFillColor( aFaceColor );
+
pDev->SetTextColor( rStyleSettings.GetButtonTextColor() );
Rectangle aTitleRect( pData->maTitleRect );
if( pOffset )
@@ -1838,7 +1865,7 @@ void ImplBorderWindow::ImplInit( Window* pParent,
{
// Alle WindowBits entfernen, die wir nicht haben wollen
WinBits nOrgStyle = nStyle;
- WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_PINABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN | WB_INTROWIN | WB_DEFAULTWIN | WB_TOOLTIPWIN | WB_NOSHADOW | WB_OWNERDRAWDECORATION | WB_SYSTEMCHILDWINDOW | WB_NEEDSFOCUS);
+ WinBits nTestStyle = (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_PINABLE | WB_CLOSEABLE | WB_STANDALONE | WB_DIALOGCONTROL | WB_NODIALOGCONTROL | WB_SYSTEMFLOATWIN | WB_INTROWIN | WB_DEFAULTWIN | WB_TOOLTIPWIN | WB_NOSHADOW | WB_OWNERDRAWDECORATION | WB_SYSTEMCHILDWINDOW | WB_NEEDSFOCUS | WB_POPUP);
if ( nTypeStyle & BORDERWINDOW_STYLE_APP )
nTestStyle |= WB_APP;
nStyle &= nTestStyle;
@@ -1853,7 +1880,7 @@ void ImplBorderWindow::ImplInit( Window* pParent,
mpWindowImpl->mbFrame = sal_True;
mbFrameBorder = sal_False;
}
- else if( (nStyle & WB_OWNERDRAWDECORATION) )
+ else if( (nStyle & (WB_OWNERDRAWDECORATION | WB_POPUP)) )
{
mpWindowImpl->mbOverlapWin = sal_True;
mpWindowImpl->mbFrame = sal_True;
@@ -2105,7 +2132,7 @@ void ImplBorderWindow::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- if ( !mpWindowImpl->mbFrame || (GetStyle() & WB_OWNERDRAWDECORATION) )
+ if ( !mpWindowImpl->mbFrame || (GetStyle() & (WB_OWNERDRAWDECORATION | WB_POPUP)) )
UpdateView( sal_True, ImplGetWindow()->GetOutputSizePixel() );
}
@@ -2353,3 +2380,5 @@ Rectangle ImplBorderWindow::GetMenuRect() const
{
return mpBorderView->GetMenuRect();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index 4ce3c34d65e4..cf9697b4f602 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,52 +29,38 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <tools/ref.hxx>
#include <tools/debug.hxx>
-#include <vcl/svdata.hxx>
+#include <tools/rc.h>
#include <vcl/button.hxx>
#include <vcl/btndlg.hxx>
+#include <vcl/svdata.hxx>
-#ifndef _SV_RC_H
-#include <tools/rc.h>
-#endif
-
-
-
-// =======================================================================
+typedef boost::ptr_vector<ImplBtnDlgItem>::iterator btn_iterator;
+typedef boost::ptr_vector<ImplBtnDlgItem>::const_iterator btn_const_iterator;
struct ImplBtnDlgItem
{
sal_uInt16 mnId;
- sal_Bool mbOwnButton;
- sal_Bool mbDummyAlign;
+ bool mbOwnButton;
+ bool mbDummyAlign;
long mnSepSize;
PushButton* mpPushButton;
};
-DECLARE_LIST( ImplBtnDlgItemList, ImplBtnDlgItem* )
-
-// =======================================================================
-
void ButtonDialog::ImplInitButtonDialogData()
{
- mpItemList = new ImplBtnDlgItemList( 8, 8 );
mnButtonSize = 0;
mnCurButtonId = 0;
mnFocusButtonId = BUTTONDIALOG_BUTTON_NOTFOUND;
mbFormat = sal_True;
}
-// -----------------------------------------------------------------------
-
ButtonDialog::ButtonDialog( WindowType nType ) :
Dialog( nType )
{
ImplInitButtonDialogData();
}
-// -----------------------------------------------------------------------
-
ButtonDialog::ButtonDialog( Window* pParent, WinBits nStyle ) :
Dialog( WINDOW_BUTTONDIALOG )
{
@@ -81,8 +68,6 @@ ButtonDialog::ButtonDialog( Window* pParent, WinBits nStyle ) :
ImplInit( pParent, nStyle );
}
-// -----------------------------------------------------------------------
-
ButtonDialog::ButtonDialog( Window* pParent, const ResId& rResId ) :
Dialog( WINDOW_BUTTONDIALOG )
{
@@ -92,24 +77,15 @@ ButtonDialog::ButtonDialog( Window* pParent, const ResId& rResId ) :
ImplLoadRes( rResId );
}
-// -----------------------------------------------------------------------
-
ButtonDialog::~ButtonDialog()
{
- ImplBtnDlgItem* pItem = mpItemList->First();
- while ( pItem )
+ for ( btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
{
- if ( pItem->mpPushButton && pItem->mbOwnButton )
- delete pItem->mpPushButton;
- delete pItem;
- pItem = mpItemList->Next();
+ if ( it->mpPushButton && it->mbOwnButton )
+ delete it->mpPushButton;
}
-
- delete mpItemList;
}
-// -----------------------------------------------------------------------
-
PushButton* ButtonDialog::ImplCreatePushButton( sal_uInt16 nBtnFlags )
{
PushButton* pBtn;
@@ -132,60 +108,53 @@ PushButton* ButtonDialog::ImplCreatePushButton( sal_uInt16 nBtnFlags )
return pBtn;
}
-// -----------------------------------------------------------------------
-
ImplBtnDlgItem* ButtonDialog::ImplGetItem( sal_uInt16 nId ) const
{
- ImplBtnDlgItem* pItem = mpItemList->First();
- while ( pItem )
+ for ( btn_const_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
{
- if ( pItem->mnId == nId )
- return pItem;
-
- pItem = mpItemList->Next();
+ if (it->mnId == nId)
+ return const_cast<ImplBtnDlgItem*>(&(*it));
}
return NULL;
}
-// -----------------------------------------------------------------------
-
long ButtonDialog::ImplGetButtonSize()
{
if ( !mbFormat )
return mnButtonSize;
// Calculate ButtonSize
- long nLastSepSize = 0;
- long nSepSize = 0;
- long nButtonCount = 0;
+ long nLastSepSize = 0;
+ long nSepSize = 0;
maCtrlSize = Size( IMPL_MINSIZE_BUTTON_WIDTH, IMPL_MINSIZE_BUTTON_HEIGHT );
- ImplBtnDlgItem* pItem = mpItemList->First();
- while ( pItem )
+
+ for ( btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
{
nSepSize += nLastSepSize;
- long nTxtWidth = pItem->mpPushButton->GetCtrlTextWidth( pItem->mpPushButton->GetText() );
+ long nTxtWidth = it->mpPushButton->GetCtrlTextWidth(it->mpPushButton->GetText());
nTxtWidth += IMPL_EXTRA_BUTTON_WIDTH;
+
if ( nTxtWidth > maCtrlSize.Width() )
maCtrlSize.Width() = nTxtWidth;
- long nTxtHeight = pItem->mpPushButton->GetTextHeight();
+
+ long nTxtHeight = it->mpPushButton->GetTextHeight();
nTxtHeight += IMPL_EXTRA_BUTTON_HEIGHT;
+
if ( nTxtHeight > maCtrlSize.Height() )
maCtrlSize.Height() = nTxtHeight;
- nSepSize += pItem->mnSepSize;
+ nSepSize += it->mnSepSize;
if ( GetStyle() & WB_HORZ )
nLastSepSize = IMPL_SEP_BUTTON_X;
else
nLastSepSize = IMPL_SEP_BUTTON_Y;
-
- nButtonCount++;
-
- pItem = mpItemList->Next();
}
+ long nButtonCount = maItemList.size();
+
if ( GetStyle() & WB_HORZ )
mnButtonSize = nSepSize + (nButtonCount*maCtrlSize.Width());
else
@@ -194,8 +163,6 @@ long ButtonDialog::ImplGetButtonSize()
return mnButtonSize;
}
-// -----------------------------------------------------------------------
-
void ButtonDialog::ImplPosControls()
{
if ( !mbFormat )
@@ -205,7 +172,6 @@ void ButtonDialog::ImplPosControls()
ImplGetButtonSize();
// determine dialog size
- ImplBtnDlgItem* pItem;
Size aDlgSize = maPageSize;
long nX;
long nY;
@@ -239,21 +205,20 @@ void ButtonDialog::ImplPosControls()
}
// Arrange PushButtons
- pItem = mpItemList->First();
- while ( pItem )
+ for ( btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
{
if ( GetStyle() & WB_HORZ )
- nX += pItem->mnSepSize;
+ nX += it->mnSepSize;
else
- nY += pItem->mnSepSize;
- pItem->mpPushButton->SetPosSizePixel( Point( nX, nY ), maCtrlSize );
- pItem->mpPushButton->Show();
+ nY += it->mnSepSize;
+
+ it->mpPushButton->SetPosSizePixel( Point( nX, nY ), maCtrlSize );
+ it->mpPushButton->Show();
+
if ( GetStyle() & WB_HORZ )
nX += maCtrlSize.Width()+IMPL_SEP_BUTTON_X;
else
nY += maCtrlSize.Height()+IMPL_SEP_BUTTON_Y;
-
- pItem = mpItemList->Next();
}
SetOutputSizePixel( aDlgSize );
@@ -261,54 +226,43 @@ void ButtonDialog::ImplPosControls()
mbFormat = sal_False;
}
-// -----------------------------------------------------------------------
-
IMPL_LINK( ButtonDialog, ImplClickHdl, PushButton*, pBtn )
{
- ImplBtnDlgItem* pItem = mpItemList->First();
- while ( pItem )
+ for ( btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
{
- if ( pItem->mpPushButton == pBtn )
+ if ( it->mpPushButton == pBtn )
{
- mnCurButtonId = pItem->mnId;
+ mnCurButtonId = it->mnId;
Click();
break;
}
-
- pItem = mpItemList->Next();
}
return 0;
}
-// -----------------------------------------------------------------------
-
void ButtonDialog::Resize()
{
}
-// -----------------------------------------------------------------------
-
void ButtonDialog::StateChanged( StateChangedType nType )
{
if ( nType == STATE_CHANGE_INITSHOW )
{
ImplPosControls();
- // Focus evt. auf den entsprechenden Button setzen
+ // Set focus on default button.
if ( mnFocusButtonId != BUTTONDIALOG_BUTTON_NOTFOUND )
{
- ImplBtnDlgItem* pItem = mpItemList->First();
- while ( pItem )
+ for ( btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
{
- if ( pItem->mnId == mnFocusButtonId )
+ if (it->mnId == mnFocusButtonId )
{
- if ( pItem->mpPushButton->IsVisible() )
- pItem->mpPushButton->GrabFocus();
+ if (it->mpPushButton->IsVisible())
+ it->mpPushButton->GrabFocus();
+
break;
}
-
- pItem = mpItemList->Next();
}
}
}
@@ -316,8 +270,6 @@ void ButtonDialog::StateChanged( StateChangedType nType )
Dialog::StateChanged( nType );
}
-// -----------------------------------------------------------------------
-
void ButtonDialog::Click()
{
if ( !maClickHdl )
@@ -329,8 +281,6 @@ void ButtonDialog::Click()
maClickHdl.Call( this );
}
-// -----------------------------------------------------------------------
-
void ButtonDialog::AddButton( const XubString& rText, sal_uInt16 nId,
sal_uInt16 nBtnFlags, long nSepPixel )
{
@@ -340,11 +290,11 @@ void ButtonDialog::AddButton( const XubString& rText, sal_uInt16 nId,
pItem->mbOwnButton = sal_True;
pItem->mnSepSize = nSepPixel;
pItem->mpPushButton = ImplCreatePushButton( nBtnFlags );
+
if ( rText.Len() )
pItem->mpPushButton->SetText( rText );
- // In die Liste eintragen
- mpItemList->Insert( pItem, LIST_APPEND );
+ maItemList.push_back(pItem);
if ( nBtnFlags & BUTTONDIALOG_FOCUSBUTTON )
mnFocusButtonId = nId;
@@ -352,8 +302,6 @@ void ButtonDialog::AddButton( const XubString& rText, sal_uInt16 nId,
mbFormat = sal_True;
}
-// -----------------------------------------------------------------------
-
void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId,
sal_uInt16 nBtnFlags, long nSepPixel )
{
@@ -383,14 +331,11 @@ void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId,
if ( nBtnFlags & BUTTONDIALOG_FOCUSBUTTON )
mnFocusButtonId = nId;
- // In die Liste eintragen
- mpItemList->Insert( pItem, LIST_APPEND );
+ maItemList.push_back(pItem);
mbFormat = sal_True;
}
-// -----------------------------------------------------------------------
-
void ButtonDialog::AddButton( PushButton* pBtn, sal_uInt16 nId,
sal_uInt16 nBtnFlags, long nSepPixel )
{
@@ -404,73 +349,59 @@ void ButtonDialog::AddButton( PushButton* pBtn, sal_uInt16 nId,
if ( nBtnFlags & BUTTONDIALOG_FOCUSBUTTON )
mnFocusButtonId = nId;
- // In die View-Liste eintragen
- mpItemList->Insert( pItem, LIST_APPEND );
+ maItemList.push_back(pItem);
mbFormat = sal_True;
}
-// -----------------------------------------------------------------------
-
void ButtonDialog::RemoveButton( sal_uInt16 nId )
{
- ImplBtnDlgItem* pItem = mpItemList->First();
- while ( pItem )
+ btn_iterator it;
+ for (it = maItemList.begin(); it != maItemList.end(); ++it)
{
- if ( pItem->mnId == nId )
+ if (it->mnId == nId)
{
- pItem->mpPushButton->Hide();
- if ( pItem->mbOwnButton )
- delete pItem->mpPushButton;
- delete pItem;
- mpItemList->Remove();
- mbFormat = sal_True;
+ it->mpPushButton->Hide();
+
+ if (it->mbOwnButton )
+ delete it->mpPushButton;
+
+ maItemList.erase(it);
break;
}
-
- pItem = mpItemList->Next();
}
- DBG_ERRORFILE( "ButtonDialog::RemoveButton(): ButtonId invalid" );
+ if (it == maItemList.end())
+ DBG_ERRORFILE( "ButtonDialog::RemoveButton(): ButtonId invalid" );
}
-// -----------------------------------------------------------------------
-
void ButtonDialog::Clear()
{
- ImplBtnDlgItem* pItem = mpItemList->First();
- while ( pItem )
+ for (btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
{
- pItem->mpPushButton->Hide();
- if ( pItem->mbOwnButton )
- delete pItem->mpPushButton;
- delete pItem;
- pItem = mpItemList->Next();
+ it->mpPushButton->Hide();
+
+ if (it->mbOwnButton )
+ delete it->mpPushButton;
}
- mpItemList->Clear();
+ maItemList.clear();
mbFormat = sal_True;
}
-// -----------------------------------------------------------------------
-
sal_uInt16 ButtonDialog::GetButtonCount() const
{
- return (sal_uInt16)mpItemList->Count();
+ return (sal_uInt16)maItemList.size();
}
-// -----------------------------------------------------------------------
-
sal_uInt16 ButtonDialog::GetButtonId( sal_uInt16 nButton ) const
{
- if ( nButton < mpItemList->Count() )
- return (sal_uInt16)mpItemList->GetObject( nButton )->mnId;
+ if ( nButton < maItemList.size() )
+ return maItemList[nButton].mnId;
else
return BUTTONDIALOG_BUTTON_NOTFOUND;
}
-// -----------------------------------------------------------------------
-
PushButton* ButtonDialog::GetPushButton( sal_uInt16 nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -481,8 +412,6 @@ PushButton* ButtonDialog::GetPushButton( sal_uInt16 nId ) const
return NULL;
}
-// -----------------------------------------------------------------------
-
void ButtonDialog::SetButtonText( sal_uInt16 nId, const XubString& rText )
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -494,8 +423,6 @@ void ButtonDialog::SetButtonText( sal_uInt16 nId, const XubString& rText )
}
}
-// -----------------------------------------------------------------------
-
XubString ButtonDialog::GetButtonText( sal_uInt16 nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -506,8 +433,6 @@ XubString ButtonDialog::GetButtonText( sal_uInt16 nId ) const
return ImplGetSVEmptyStr();
}
-// -----------------------------------------------------------------------
-
void ButtonDialog::SetButtonHelpText( sal_uInt16 nId, const XubString& rText )
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -516,8 +441,6 @@ void ButtonDialog::SetButtonHelpText( sal_uInt16 nId, const XubString& rText )
pItem->mpPushButton->SetHelpText( rText );
}
-// -----------------------------------------------------------------------
-
XubString ButtonDialog::GetButtonHelpText( sal_uInt16 nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -528,8 +451,6 @@ XubString ButtonDialog::GetButtonHelpText( sal_uInt16 nId ) const
return ImplGetSVEmptyStr();
}
-// -----------------------------------------------------------------------
-
void ButtonDialog::SetButtonHelpId( sal_uInt16 nId, const rtl::OString& rHelpId )
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
@@ -538,11 +459,11 @@ void ButtonDialog::SetButtonHelpId( sal_uInt16 nId, const rtl::OString& rHelpId
pItem->mpPushButton->SetHelpId( rHelpId );
}
-// -----------------------------------------------------------------------
-
rtl::OString ButtonDialog::GetButtonHelpId( sal_uInt16 nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
return pItem ? rtl::OString( pItem->mpPushButton->GetHelpId() ) : rtl::OString();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/cmdevt.cxx b/vcl/source/window/cmdevt.cxx
index e10d33028fbc..1fa77a3621cd 100644
--- a/vcl/source/window/cmdevt.cxx
+++ b/vcl/source/window/cmdevt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,13 +29,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _STRING_H
#include <string.h>
-#endif
-#ifndef _SV_CMDEVT_HXX
#include <vcl/cmdevt.hxx>
-#endif
// =======================================================================
@@ -99,3 +96,5 @@ CommandExtTextInputData::~CommandExtTextInputData()
if ( mpTextAttr )
delete [] mpTextAttr;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index 3be6fad02366..318529dcc7d9 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -460,3 +461,5 @@ sal_Bool Cursor::operator==( const Cursor& rCursor ) const
else
return sal_False;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx
index b82f029370c7..125c927bf673 100644
--- a/vcl/source/window/decoview.cxx
+++ b/vcl/source/window/decoview.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -1286,3 +1287,4 @@ void DecorationView::DrawSeparator( const Point& rStart, const Point& rStop, boo
mpOutDev->Pop();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 73a3bc7eb981..4db82d23b0e5 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include "precompiled_vcl.hxx"
#include <tools/debug.hxx>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/svdata.hxx>
#include <vcl/svapp.hxx>
#include <vcl/window.h>
@@ -559,7 +558,18 @@ sal_Bool Dialog::Close()
{
ImplDelData aDelData;
ImplAddDel( &aDelData );
+ //liuchen 2009-7-22, support Excel VBA UserForm_QueryClose event
+ mnCancelClose = 0;
ImplCallEventListeners( VCLEVENT_WINDOW_CLOSE );
+ // basic boolean ( and what the user might use in the event handler) can
+ // be ambiguous ( e.g. basic true = -1 )
+ // test agains 0 ( false ) and assume anything else is true
+ // ( Note: ) this used to work ( something changes somewhere )
+ if (mnCancelClose != 0)
+ {
+ return sal_False;
+ }
+ //liuchen 2009-7-22
if ( aDelData.IsDelete() )
return sal_False;
ImplRemoveDel( &aDelData );
@@ -712,7 +722,7 @@ short Dialog::Execute()
if( ! aParentDelData.IsDelete() )
pDialogParent->ImplRemoveDel( &aParentDelData );
else
- DBG_ERROR( "Dialog::Execute() - Parent of dialog destroyed in Execute()" );
+ OSL_FAIL( "Dialog::Execute() - Parent of dialog destroyed in Execute()" );
}
#endif
if ( !aDelData.IsDelete() )
@@ -720,7 +730,7 @@ short Dialog::Execute()
#ifdef DBG_UTIL
else
{
- DBG_ERROR( "Dialog::Execute() - Dialog destroyed in Execute()" );
+ OSL_FAIL( "Dialog::Execute() - Dialog destroyed in Execute()" );
}
#endif
@@ -1026,3 +1036,5 @@ ModalDialog::ModalDialog( Window* pParent, const ResId& rResId ) :
ImplInit( pParent, ImplInitRes( rResId ) );
ImplLoadRes( rResId );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index 32fc4755a62d..ce7b6dca8119 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -895,10 +896,8 @@ sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput )
sal_Bool Window::ImplHasDlgCtrl()
{
Window* pDlgCtrlParent;
- Window* pDlgCtrl;
// lookup window for dialog control
- pDlgCtrl = this;
pDlgCtrlParent = ImplGetParent();
while ( pDlgCtrlParent &&
!pDlgCtrlParent->ImplIsOverlapWindow() &&
@@ -1332,3 +1331,5 @@ KeyEvent Window::GetActivationKey() const
}
return aKeyEvent;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/dndevdis.cxx b/vcl/source/window/dndevdis.cxx
index e4d5a8c4c0eb..d9417e3bacf0 100644
--- a/vcl/source/window/dndevdis.cxx
+++ b/vcl/source/window/dndevdis.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,11 +33,9 @@
#include <vcl/dndlcon.hxx>
#include <vcl/window.h>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <vcl/svdata.hxx>
-using namespace ::osl;
-using namespace ::vos;
using namespace ::cppu;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
@@ -61,20 +60,11 @@ DNDEventDispatcher::~DNDEventDispatcher()
{
}
-//==================================================================================================
-// DNDEventDispatcher::drop
-//==================================================================================================
-
-void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde )
- throw(RuntimeException)
+Window* DNDEventDispatcher::findTopLevelWindow(Point location)
{
- MutexGuard aImplGuard( m_aMutex );
-
- Point location( dtde.LocationX, dtde.LocationY );
+ SolarMutexGuard aSolarGuard;
// find the window that is toplevel for this coordinates
- OClearableGuard aSolarGuard( Application::GetSolarMutex() );
-
// because those coordinates come from outside, they must be mirrored if RTL layout is active
if( Application::GetSettings().GetLayoutRTL() )
m_pTopWindow->ImplMirrorFramePos( location );
@@ -89,7 +79,21 @@ void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde )
if( pChildWindow->ImplIsAntiparallel() )
pChildWindow->ImplReMirror( location );
- aSolarGuard.clear();
+ return pChildWindow;
+}
+
+//==================================================================================================
+// DNDEventDispatcher::drop
+//==================================================================================================
+
+void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde )
+ throw(RuntimeException)
+{
+ osl::MutexGuard aImplGuard( m_aMutex );
+
+ Point location( dtde.LocationX, dtde.LocationY );
+
+ Window* pChildWindow = findTopLevelWindow(location);
// handle the case that drop is in an other vcl window than the last dragOver
if( pChildWindow != m_pCurrentWindow )
@@ -125,27 +129,10 @@ void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde )
void SAL_CALL DNDEventDispatcher::dragEnter( const DropTargetDragEnterEvent& dtdee )
throw(RuntimeException)
{
- MutexGuard aImplGuard( m_aMutex );
+ osl::MutexGuard aImplGuard( m_aMutex );
Point location( dtdee.LocationX, dtdee.LocationY );
- // find the window that is toplevel for this coordinates
- OClearableGuard aSolarGuard( Application::GetSolarMutex() );
-
- // because those coordinates come from outside, they must be mirrored if RTL layout is active
- if( Application::GetSettings().GetLayoutRTL() )
- m_pTopWindow->ImplMirrorFramePos( location );
- Window * pChildWindow = m_pTopWindow->ImplFindWindow( location );
-
- if( NULL == pChildWindow )
- pChildWindow = m_pTopWindow;
-
- while( pChildWindow->ImplGetClientWindow() )
- pChildWindow = pChildWindow->ImplGetClientWindow();
-
- if( pChildWindow->ImplIsAntiparallel() )
- pChildWindow->ImplReMirror( location );
-
- aSolarGuard.clear();
+ Window * pChildWindow = findTopLevelWindow(location);
// assume pointer write operation to be atomic
m_pCurrentWindow = pChildWindow;
@@ -170,7 +157,7 @@ void SAL_CALL DNDEventDispatcher::dragEnter( const DropTargetDragEnterEvent& dtd
void SAL_CALL DNDEventDispatcher::dragExit( const DropTargetEvent& /*dte*/ )
throw(RuntimeException)
{
- MutexGuard aImplGuard( m_aMutex );
+ osl::MutexGuard aImplGuard( m_aMutex );
fireDragExitEvent( m_pCurrentWindow );
@@ -186,29 +173,12 @@ void SAL_CALL DNDEventDispatcher::dragExit( const DropTargetEvent& /*dte*/ )
void SAL_CALL DNDEventDispatcher::dragOver( const DropTargetDragEvent& dtde )
throw(RuntimeException)
{
- MutexGuard aImplGuard( m_aMutex );
+ osl::MutexGuard aImplGuard( m_aMutex );
Point location( dtde.LocationX, dtde.LocationY );
sal_Int32 nListeners;
- // find the window that is toplevel for this coordinates
- OClearableGuard aSolarGuard( Application::GetSolarMutex() );
-
- // because those coordinates come from outside, they must be mirrored if RTL layout is active
- if( Application::GetSettings().GetLayoutRTL() )
- m_pTopWindow->ImplMirrorFramePos( location );
- Window * pChildWindow = m_pTopWindow->ImplFindWindow( location );
-
- if( NULL == pChildWindow )
- pChildWindow = m_pTopWindow;
-
- while( pChildWindow->ImplGetClientWindow() )
- pChildWindow = pChildWindow->ImplGetClientWindow();
-
- if( pChildWindow->ImplIsAntiparallel() )
- pChildWindow->ImplReMirror( location );
-
- aSolarGuard.clear();
+ Window * pChildWindow = findTopLevelWindow(location);
if( pChildWindow != m_pCurrentWindow )
{
@@ -244,29 +214,12 @@ void SAL_CALL DNDEventDispatcher::dragOver( const DropTargetDragEvent& dtde )
void SAL_CALL DNDEventDispatcher::dropActionChanged( const DropTargetDragEvent& dtde )
throw(RuntimeException)
{
- MutexGuard aImplGuard( m_aMutex );
+ osl::MutexGuard aImplGuard( m_aMutex );
Point location( dtde.LocationX, dtde.LocationY );
sal_Int32 nListeners;
- // find the window that is toplevel for this coordinates
- OClearableGuard aSolarGuard( Application::GetSolarMutex() );
-
- // because those coordinates come from outside, they must be mirrored if RTL layout is active
- if( Application::GetSettings().GetLayoutRTL() )
- m_pTopWindow->ImplMirrorFramePos( location );
- Window * pChildWindow = m_pTopWindow->ImplFindWindow( location );
-
- if( NULL == pChildWindow )
- pChildWindow = m_pTopWindow;
-
- while( pChildWindow->ImplGetClientWindow() )
- pChildWindow = pChildWindow->ImplGetClientWindow();
-
- if( pChildWindow->ImplIsAntiparallel() )
- pChildWindow->ImplReMirror( location );
-
- aSolarGuard.clear();
+ Window* pChildWindow = findTopLevelWindow(location);
if( pChildWindow != m_pCurrentWindow )
{
@@ -302,28 +255,12 @@ void SAL_CALL DNDEventDispatcher::dropActionChanged( const DropTargetDragEvent&
void SAL_CALL DNDEventDispatcher::dragGestureRecognized( const DragGestureEvent& dge )
throw(RuntimeException)
-{ MutexGuard aImplGuard( m_aMutex );
+{
+ osl::MutexGuard aImplGuard( m_aMutex );
Point origin( dge.DragOriginX, dge.DragOriginY );
- // find the window that is toplevel for this coordinates
- OClearableGuard aSolarGuard( Application::GetSolarMutex() );
-
- // because those coordinates come from outside, they must be mirrored if RTL layout is active
- if( Application::GetSettings().GetLayoutRTL() )
- m_pTopWindow->ImplMirrorFramePos( origin );
- Window * pChildWindow = m_pTopWindow->ImplFindWindow( origin );
-
- if( NULL == pChildWindow )
- pChildWindow = m_pTopWindow;
-
- while( pChildWindow->ImplGetClientWindow() )
- pChildWindow = pChildWindow->ImplGetClientWindow();
-
- if( pChildWindow->ImplIsAntiparallel() )
- pChildWindow->ImplReMirror( origin );
-
- aSolarGuard.clear();
+ Window* pChildWindow = findTopLevelWindow(origin);
fireDragGestureEvent( pChildWindow, dge.DragSource, dge.Event, origin, dge.DragAction );
}
@@ -367,7 +304,7 @@ sal_Int32 DNDEventDispatcher::fireDragEnterEvent( Window *pWindow,
if( pWindow && pWindow->IsInputEnabled() && ! pWindow->IsInModalMode() )
{
- OClearableGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexClearableGuard aSolarGuard;
// set an UI lock
pWindow->IncrementLockCount();
@@ -379,7 +316,7 @@ sal_Int32 DNDEventDispatcher::fireDragEnterEvent( Window *pWindow,
{
// retrieve relative mouse position
Point relLoc = pWindow->ImplFrameToOutput( rLocation );
- aGuard.clear();
+ aSolarGuard.clear();
n = static_cast < DNDListenerContainer * > ( xDropTarget.get() )->fireDragEnterEvent(
xContext, nDropAction, relLoc.X(), relLoc.Y(), nSourceActions, aFlavorList );
@@ -403,7 +340,7 @@ sal_Int32 DNDEventDispatcher::fireDragOverEvent( Window *pWindow,
if( pWindow && pWindow->IsInputEnabled() && ! pWindow->IsInModalMode() )
{
- OClearableGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexClearableGuard aSolarGuard;
// query DropTarget from window
Reference< XDropTarget > xDropTarget = pWindow->GetDropTarget();
@@ -412,7 +349,7 @@ sal_Int32 DNDEventDispatcher::fireDragOverEvent( Window *pWindow,
{
// retrieve relative mouse position
Point relLoc = pWindow->ImplFrameToOutput( rLocation );
- aGuard.clear();
+ aSolarGuard.clear();
n = static_cast < DNDListenerContainer * > ( xDropTarget.get() )->fireDragOverEvent(
xContext, nDropAction, relLoc.X(), relLoc.Y(), nSourceActions );
@@ -432,7 +369,7 @@ sal_Int32 DNDEventDispatcher::fireDragExitEvent( Window *pWindow ) throw(Runtime
if( pWindow && pWindow->IsInputEnabled() && ! pWindow->IsInModalMode() )
{
- OClearableGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexClearableGuard aGuard;
// query DropTarget from window
Reference< XDropTarget > xDropTarget = pWindow->GetDropTarget();
@@ -463,7 +400,7 @@ sal_Int32 DNDEventDispatcher::fireDropActionChangedEvent( Window *pWindow,
if( pWindow && pWindow->IsInputEnabled() && ! pWindow->IsInModalMode() )
{
- OClearableGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexClearableGuard aGuard;
// query DropTarget from window
Reference< XDropTarget > xDropTarget = pWindow->GetDropTarget();
@@ -496,7 +433,7 @@ sal_Int32 DNDEventDispatcher::fireDropEvent( Window *pWindow,
if( pWindow && pWindow->IsInputEnabled() && ! pWindow->IsInModalMode() )
{
- OClearableGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexClearableGuard aGuard;
// query DropTarget from window
Reference< XDropTarget > xDropTarget = pWindow->GetDropTarget();
@@ -541,7 +478,7 @@ sal_Int32 DNDEventDispatcher::fireDragGestureEvent( Window *pWindow,
if( pWindow && pWindow->IsInputEnabled() && ! pWindow->IsInModalMode() )
{
- OClearableGuard aGuard( Application::GetSolarMutex() );
+ SolarMutexClearableGuard aGuard;
// query DropTarget from window
Reference< XDragGestureRecognizer > xDragGestureRecognizer = pWindow->GetDragGestureRecognizer();
@@ -562,3 +499,5 @@ sal_Int32 DNDEventDispatcher::fireDragGestureEvent( Window *pWindow,
return n;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/dndlcon.cxx b/vcl/source/window/dndlcon.cxx
index 07819e76f957..4566852bc966 100644
--- a/vcl/source/window/dndlcon.cxx
+++ b/vcl/source/window/dndlcon.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -565,3 +566,5 @@ void SAL_CALL DNDListenerContainer::dropComplete( sal_Bool success ) throw (Runt
m_xDropTargetDropContext.clear();
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx
index 6c8519b68a1e..ded887c59933 100644
--- a/vcl/source/window/dockingarea.cxx
+++ b/vcl/source/window/dockingarea.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -244,3 +245,4 @@ void DockingAreaWindow::Resize()
// -----------------------------------------------------------------------
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index c59cb4da5dc8..017fdc5390db 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,13 +29,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <tools/time.hxx>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/event.hxx>
#include <vcl/brdwin.hxx>
#include <vcl/floatwin.hxx>
@@ -1687,3 +1684,5 @@ sal_Bool ImplDockingWindowWrapper::IsLocked() const
{
return mbLocked;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index eb16832e5c00..c9b71b01f78e 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,13 +29,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <tools/time.hxx>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/event.hxx>
#include <vcl/brdwin.hxx>
#include <vcl/floatwin.hxx>
@@ -1118,3 +1115,5 @@ const Size& DockingWindow::GetMaxOutputSizePixel() const
return mpFloatWin->GetMaxOutputSizePixel();
return mpImplData->maMaxOutSize;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 170fcbd65cee..2c21ec7a83d1 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/svdata.hxx>
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
@@ -39,9 +38,7 @@
#include <vcl/toolbox.hxx>
#include <vcl/floatwin.hxx>
#include <vcl/window.h>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/salframe.hxx>
#include <tools/debug.hxx>
@@ -138,7 +135,7 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle )
mpNextFloat = NULL;
mpFirstPopupModeWin = NULL;
mnPostId = 0;
- mnTitle = (nStyle & WB_MOVEABLE) ? FLOATWIN_TITLE_NORMAL : FLOATWIN_TITLE_NONE;
+ mnTitle = (nStyle & (WB_MOVEABLE | WB_POPUP)) ? FLOATWIN_TITLE_NORMAL : FLOATWIN_TITLE_NONE;
mnOldTitle = mnTitle;
mnPopupModeFlags = 0;
mbInPopupMode = sal_False;
@@ -652,6 +649,8 @@ void FloatingWindow::SetTitleType( sal_uInt16 nTitle )
nTitleStyle = BORDERWINDOW_TITLE_SMALL;
else if ( nTitle == FLOATWIN_TITLE_TEAROFF )
nTitleStyle = BORDERWINDOW_TITLE_TEAROFF;
+ else if ( nTitle == FLOATWIN_TITLE_POPUP )
+ nTitleStyle = BORDERWINDOW_TITLE_POPUP;
else // nTitle == FLOATWIN_TITLE_NONE
nTitleStyle = BORDERWINDOW_TITLE_NONE;
((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetTitleType( nTitleStyle, aOutSize );
@@ -672,7 +671,9 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags )
// remove title
mnOldTitle = mnTitle;
- if ( nFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF )
+ if ( ( mpWindowImpl->mnStyle & WB_POPUP ) && GetText().Len() )
+ SetTitleType( FLOATWIN_TITLE_POPUP );
+ else if ( nFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF )
SetTitleType( FLOATWIN_TITLE_TEAROFF );
else
SetTitleType( FLOATWIN_TITLE_NONE );
@@ -876,3 +877,4 @@ void FloatingWindow::RemovePopupModeWindow( Window* pWindow )
mpFirstPopupModeWin = NULL;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/introwin.cxx b/vcl/source/window/introwin.cxx
index 03f88adc3566..a0926ec789ad 100644
--- a/vcl/source/window/introwin.cxx
+++ b/vcl/source/window/introwin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/salframe.hxx>
#include <tools/debug.hxx>
#include <vcl/svdata.hxx>
@@ -86,3 +85,5 @@ void IntroWindow::SetBackgroundBitmap( const BitmapEx& rBitmapEx )
ImplGetFrame()->SetBackgroundBitmap( pBmp );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/javachild.cxx b/vcl/source/window/javachild.cxx
index aa198c85c138..1f15019999e5 100644
--- a/vcl/source/window/javachild.cxx
+++ b/vcl/source/window/javachild.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,3 +62,5 @@ sal_IntPtr JavaChildWindow::getParentWindowHandleForJava()
{
return SystemChildWindow::GetParentWindowHandle( sal_True );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/keycod.cxx b/vcl/source/window/keycod.cxx
index 968c72abd383..05370f3a029f 100644
--- a/vcl/source/window/keycod.cxx
+++ b/vcl/source/window/keycod.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,20 +29,14 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/salinst.hxx>
#include <vcl/salframe.hxx>
#include <vcl/svdata.hxx>
#include <vcl/window.hxx>
-#ifndef _SV_KEYCOD_HXX
#include <vcl/keycod.hxx>
-#endif
-#ifndef _RC_H
#include <tools/rc.h>
-#endif
@@ -158,3 +153,5 @@ KeyFuncType KeyCode::GetFunction() const
return KEYFUNC_DONTKNOW;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/keyevent.cxx b/vcl/source/window/keyevent.cxx
index 9d6854430611..db8144c3d648 100644
--- a/vcl/source/window/keyevent.cxx
+++ b/vcl/source/window/keyevent.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114,3 +115,4 @@ const Point& HelpEvent::GetMousePosPixel() const
return maPos;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index dda796ba41e4..6ab9dda55fc2 100755
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1,3 +1,5 @@
+
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +32,6 @@
#include "svsys.h"
#include "vcl/salinst.hxx"
-#include "tools/list.hxx"
#include "tools/debug.hxx"
#include "tools/diagnose_ex.h"
#include "vcl/svdata.hxx"
@@ -560,7 +561,6 @@ public:
Size getMinSize();
Image maImage;
- Image maImageHC;
};
DecoToolBox::DecoToolBox( Window* pParent, WinBits nStyle ) :
@@ -638,8 +638,7 @@ void DecoToolBox::SetImages( long nMaxHeight, bool bForce )
Color aEraseColor( 255, 255, 255, 255 );
BitmapEx aBmpExDst( maImage.GetBitmapEx() );
- BitmapEx aBmpExSrc( GetSettings().GetStyleSettings().GetHighContrastMode() ?
- maImageHC.GetBitmapEx() : aBmpExDst );
+ BitmapEx aBmpExSrc( aBmpExDst );
aEraseColor.SetTransparency( 255 );
aBmpExDst.Erase( aEraseColor );
@@ -964,7 +963,7 @@ void Menu::ImplInit()
{
mnHighlightedItemPos = ITEMPOS_INVALID;
mpSalMenu = NULL;
- nMenuFlags = MENU_FLAG_SHOWCHECKIMAGES;
+ nMenuFlags = 0;
nDefaultItem = 0;
//bIsMenuBar = sal_False; // this is now set in the ctor, must not be changed here!!!
nSelectedId = 0;
@@ -1101,9 +1100,6 @@ void Menu::Deactivate()
if( !aDelData.isDeleted() )
{
bInCallback = sal_False;
-
- if ( this == pStartMenu )
- GetpApp()->HideHelpStatusText();
}
}
@@ -1117,9 +1113,6 @@ void Menu::Highlight()
if ( pStartMenu && ( pStartMenu != this ) )
pStartMenu->aHighlightHdl.Call( this );
}
-
- if ( !aDelData.isDeleted() && GetCurItemId() )
- GetpApp()->ShowHelpStatusText( GetHelpText( GetCurItemId() ) );
}
void Menu::ImplSelect()
@@ -1189,7 +1182,7 @@ void Menu::ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos )
ImplGetSVData()->mpApp->ImplCallEventListeners( &aEvent );
}
- if ( !aDelData.isDeleted() && !maEventListeners.empty() )
+ if ( !aDelData.isDeleted() )
maEventListeners.Call( &aEvent );
if( !aDelData.isDeleted() )
@@ -1197,8 +1190,7 @@ void Menu::ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos )
Menu* pMenu = this;
while ( pMenu )
{
- if ( !maChildEventListeners.empty() )
- maChildEventListeners.Call( &aEvent );
+ maChildEventListeners.Call( &aEvent );
if( aDelData.isDeleted() )
break;
@@ -1210,12 +1202,12 @@ void Menu::ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos )
void Menu::AddEventListener( const Link& rEventListener )
{
- maEventListeners.push_back( rEventListener );
+ maEventListeners.addListener( rEventListener );
}
void Menu::RemoveEventListener( const Link& rEventListener )
{
- maEventListeners.remove( rEventListener );
+ maEventListeners.removeListener( rEventListener );
}
// -----------------------------------------------------------------------
@@ -2368,6 +2360,10 @@ Size Menu::ImplCalcSize( Window* pWin )
if( nMax > nMinMenuItemHeight )
nMinMenuItemHeight = nMax;
+ // When no native rendering of the checkbox & no image in the menu, we
+ // have to add some extra space even in the MENU_FLAG_SHOWCHECKIMAGES case
+ bool bSpaceForCheckbox = ( nMax == 0 );
+
const StyleSettings& rSettings = pWin->GetSettings().GetStyleSettings();
if ( rSettings.GetUseImagesInMenus() )
{
@@ -2377,6 +2373,9 @@ Size Menu::ImplCalcSize( Window* pWin )
MenuItemData* pData = pItemList->GetDataFromPos( --i );
if ( ImplIsVisible( i ) && (( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE )))
{
+ // we have an icon, don't add the extra space
+ bSpaceForCheckbox = false;
+
Size aImgSz = pData->aImage.GetSizePixel();
if ( aImgSz.Height() > aMaxImgSz.Height() )
aMaxImgSz.Height() = aImgSz.Height();
@@ -2423,7 +2422,7 @@ Size Menu::ImplCalcSize( Window* pWin )
if ( !bIsMenuBar && pData->HasCheck() )
{
nCheckWidth = nMaxCheckWidth;
- if (nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES)
+ if ( ( nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES ) || bSpaceForCheckbox )
{
// checks / images take the same place
if( ! ( ( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE ) ) )
@@ -2497,7 +2496,7 @@ Size Menu::ImplCalcSize( Window* pWin )
sal_uInt16 gfxExtra = (sal_uInt16) Max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text
nCheckPos = (sal_uInt16)nExtra;
- if (nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES)
+ if ( ( nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES ) || bSpaceForCheckbox )
{
long nImgOrChkWidth = 0;
nImagePos = nCheckPos;
@@ -5219,18 +5218,14 @@ MenuBarWindow::MenuBarWindow( Window* pParent ) :
if( pResMgr )
{
BitmapEx aBitmap( ResId( SV_RESID_BITMAP_CLOSEDOC, *pResMgr ) );
- BitmapEx aBitmapHC( ResId( SV_RESID_BITMAP_CLOSEDOCHC, *pResMgr ) );
-
aCloser.maImage = Image( aBitmap );
- aCloser.maImageHC = Image( aBitmapHC );
aCloser.SetOutStyle( TOOLBOX_STYLE_FLAT );
aCloser.SetBackground();
aCloser.SetPaintTransparent( sal_True );
aCloser.SetParentClipMode( PARENTCLIPMODE_NOCLIP );
- aCloser.InsertItem( IID_DOCUMENTCLOSE,
- GetSettings().GetStyleSettings().GetHighContrastMode() ? aCloser.maImageHC : aCloser.maImage, 0 );
+ aCloser.InsertItem( IID_DOCUMENTCLOSE, aCloser.maImage, 0 );
aCloser.SetSelectHdl( LINK( this, MenuBarWindow, CloserHdl ) );
aCloser.AddEventListener( LINK( this, MenuBarWindow, ToolboxEventHdl ) );
aCloser.SetQuickHelpText( IID_DOCUMENTCLOSE, XubString( ResId( SV_HELPTEXT_CLOSEDOCUMENT, *pResMgr ) ) );
@@ -6159,3 +6154,5 @@ ImplMenuDelData::~ImplMenuDelData()
if( mpMenu )
const_cast< Menu* >( mpMenu )->ImplRemoveDel( *this );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/mnemonic.cxx b/vcl/source/window/mnemonic.cxx
index c6d6afa4a2d2..ca8bcf3c2917 100644
--- a/vcl/source/window/mnemonic.cxx
+++ b/vcl/source/window/mnemonic.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -417,3 +418,5 @@ String MnemonicGenerator::EraseAllMnemonicChars( const String& rStr )
return aStr;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/mnemonicengine.cxx b/vcl/source/window/mnemonicengine.cxx
index f277ee0c1265..1ca9f2c22d57 100644
--- a/vcl/source/window/mnemonicengine.cxx
+++ b/vcl/source/window/mnemonicengine.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -128,3 +129,5 @@ namespace vcl
//........................................................................
} // namespace vcl
//........................................................................
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/mouseevent.cxx b/vcl/source/window/mouseevent.cxx
index afb0b5f68a07..2e76750e1cf5 100644
--- a/vcl/source/window/mouseevent.cxx
+++ b/vcl/source/window/mouseevent.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -90,3 +91,5 @@ void MouseEvent::InitMouseEvent( ::com::sun::star::awt::MouseEvent& rEvent ) con
rEvent.ClickCount = GetClicks();
rEvent.PopupTrigger = sal_False;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 6e0c109a564d..ae4c148d5807 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVIDS_HRC
#include <vcl/svids.hrc>
-#endif
#include <vcl/svdata.hxx>
#include <vcl/metric.hxx>
#include <vcl/svapp.hxx>
@@ -40,9 +39,7 @@
#include <vcl/brdwin.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/button.hxx>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/mnemonic.hxx>
#include <vcl/window.h>
@@ -57,14 +54,11 @@ static void ImplInitMsgBoxImageList()
{
ResMgr* pResMgr = ImplGetResMgr();
pSVData->maWinData.mpMsgBoxImgList = new ImageList(4);
- pSVData->maWinData.mpMsgBoxHCImgList = new ImageList(4);
if( pResMgr )
{
Color aNonAlphaMask( 0xC0, 0xC0, 0xC0 );
pSVData->maWinData.mpMsgBoxImgList->InsertFromHorizontalBitmap
( ResId( SV_RESID_BITMAP_MSGBOX, *pResMgr ), 4, &aNonAlphaMask );
- pSVData->maWinData.mpMsgBoxHCImgList->InsertFromHorizontalBitmap
- ( ResId( SV_RESID_BITMAP_MSGBOX_HC, *pResMgr ), 4, &aNonAlphaMask );
}
}
}
@@ -211,7 +205,7 @@ MessBox::MessBox( Window* pParent, const ResId& rResId ) :
void MessBox::ImplLoadRes( const ResId& )
{
- SetText( ReadStringRes() );
+ SetText( ReadStringRes() );
SetMessText( ReadStringRes() );
SetHelpText( ReadStringRes() );
}
@@ -314,9 +308,6 @@ void MessBox::ImplPosControls()
IMPL_DIALOG_OFFSET-2+IMPL_MSGBOX_OFFSET_EXTRA_Y ),
aImageSize );
mpFixedImage->SetImage( maImage );
- // forward the HC image
- if( !!maImageHC )
- mpFixedImage->SetModeImage( maImageHC, BMP_COLOR_HIGHCONTRAST );
mpFixedImage->Show();
nMaxWidth -= aImageSize.Width()+IMPL_SEP_MSGBOX_IMAGE;
}
@@ -469,37 +460,41 @@ void MessBox::SetDefaultCheckBoxText()
// -----------------------------------------------------------------------
-sal_Bool MessBox::SetModeImage( const Image& rImage, BmpColorMode eMode )
+sal_Bool MessBox::SetModeImage( const Image& rImage )
{
- if( eMode == BMP_COLOR_NORMAL )
- SetImage( rImage );
- else if( eMode == BMP_COLOR_HIGHCONTRAST )
- maImageHC = rImage;
- else
- return sal_False;
+ SetImage( rImage );
return sal_True;
}
// -----------------------------------------------------------------------
-const Image& MessBox::GetModeImage( BmpColorMode eMode ) const
+const Image& MessBox::GetModeImage( ) const
{
- if( eMode == BMP_COLOR_HIGHCONTRAST )
- return maImageHC;
- else
- return maImage;
+ return maImage;
}
// -----------------------------------------------------------------------
+Size MessBox::GetOptimalSize(WindowSizeType eType) const
+{
+ switch( eType ) {
+ case WINDOWSIZE_MINIMUM:
+ // FIXME: base me on the font size ?
+ return Size( 250, 100 );
+ default:
+ return Window::GetOptimalSize( eType );
+ }
+}
+
+// ============================================================================
+
void InfoBox::ImplInitInfoBoxData()
{
// Default Text is the display title from the application
if ( !GetText().Len() )
SetText( Application::GetDisplayName() );
- SetImage( GetSettings().GetStyleSettings().GetHighContrastMode() ?
- InfoBox::GetStandardImageHC() : InfoBox::GetStandardImage() );
+ SetImage( InfoBox::GetStandardImage() );
mnSoundType = ((sal_uInt16)SOUND_INFO)+1;
}
@@ -527,15 +522,7 @@ Image InfoBox::GetStandardImage()
return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 4 );
}
-// -----------------------------------------------------------------------
-
-Image InfoBox::GetStandardImageHC()
-{
- ImplInitMsgBoxImageList();
- return ImplGetSVData()->maWinData.mpMsgBoxHCImgList->GetImage( 4 );
-}
-
-// -----------------------------------------------------------------------
+// ============================================================================
void WarningBox::ImplInitWarningBoxData()
{
@@ -581,7 +568,7 @@ Image WarningBox::GetStandardImage()
return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 3 );
}
-// -----------------------------------------------------------------------
+// ============================================================================
void ErrorBox::ImplInitErrorBoxData()
{
@@ -589,8 +576,7 @@ void ErrorBox::ImplInitErrorBoxData()
if ( !GetText().Len() )
SetText( Application::GetDisplayName() );
- SetImage( GetSettings().GetStyleSettings().GetHighContrastMode() ?
- ErrorBox::GetStandardImageHC() : ErrorBox::GetStandardImage() );
+ SetImage( ErrorBox::GetStandardImage() );
mnSoundType = ((sal_uInt16)SOUND_ERROR)+1;
}
@@ -619,15 +605,7 @@ Image ErrorBox::GetStandardImage()
return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 1 );
}
-// -----------------------------------------------------------------------
-
-Image ErrorBox::GetStandardImageHC()
-{
- ImplInitMsgBoxImageList();
- return ImplGetSVData()->maWinData.mpMsgBoxHCImgList->GetImage( 1 );
-}
-
-// -----------------------------------------------------------------------
+// ============================================================================
void QueryBox::ImplInitQueryBoxData()
{
@@ -635,8 +613,7 @@ void QueryBox::ImplInitQueryBoxData()
if ( !GetText().Len() )
SetText( Application::GetDisplayName() );
- SetImage( GetSettings().GetStyleSettings().GetHighContrastMode() ?
- QueryBox::GetStandardImageHC() : QueryBox::GetStandardImage() );
+ SetImage( QueryBox::GetStandardImage() );
mnSoundType = ((sal_uInt16)SOUND_QUERY)+1;
}
@@ -673,23 +650,4 @@ Image QueryBox::GetStandardImage()
return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 2 );
}
-// -----------------------------------------------------------------------
-
-Image QueryBox::GetStandardImageHC()
-{
- ImplInitMsgBoxImageList();
- return ImplGetSVData()->maWinData.mpMsgBoxHCImgList->GetImage( 2 );
-}
-
-// -----------------------------------------------------------------------
-
-Size MessBox::GetOptimalSize(WindowSizeType eType) const
-{
- switch( eType ) {
- case WINDOWSIZE_MINIMUM:
- // FIXME: base me on the font size ?
- return Size( 250, 100 );
- default:
- return Window::GetOptimalSize( eType );
- }
-}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/popupmenuwindow.cxx b/vcl/source/window/popupmenuwindow.cxx
index 78ef0bcf1068..46fc51d8176d 100644
--- a/vcl/source/window/popupmenuwindow.cxx
+++ b/vcl/source/window/popupmenuwindow.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,3 +78,4 @@ bool PopupMenuFloatingWindow::IsPopupMenu() const
return mpImplData->mnMenuStackLevel != ::std::numeric_limits<sal_uInt16>::max();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 5569759a3fff..40b80e234ff3 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,10 +72,7 @@ PrintDialog::PrintPreviewWindow::PrintPreviewWindow( Window* i_pParent, const Re
{
SetPaintTransparent( sal_True );
SetBackground();
- if( useHCColorReplacement() )
- maPageVDev.SetBackground( GetSettings().GetStyleSettings().GetWindowColor() );
- else
- maPageVDev.SetBackground( Color( COL_WHITE ) );
+ maPageVDev.SetBackground( Color( COL_WHITE ) );
maHorzDim.Show();
maVertDim.Show();
@@ -86,79 +84,12 @@ PrintDialog::PrintPreviewWindow::~PrintPreviewWindow()
{
}
-bool PrintDialog::PrintPreviewWindow::useHCColorReplacement() const
-{
- bool bRet = false;
- if( GetSettings().GetStyleSettings().GetHighContrastMode() )
- {
- try
- {
- // get service provider
- Reference< XMultiServiceFactory > xSMgr( unohelper::GetMultiServiceFactory() );
- // create configuration hierachical access name
- if( xSMgr.is() )
- {
- try
- {
- Reference< XMultiServiceFactory > xConfigProvider(
- Reference< XMultiServiceFactory >(
- xSMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationProvider" ))),
- UNO_QUERY )
- );
- if( xConfigProvider.is() )
- {
- Sequence< Any > aArgs(1);
- PropertyValue aVal;
- aVal.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) );
- aVal.Value <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/Accessibility" ) );
- aArgs.getArray()[0] <<= aVal;
- Reference< XNameAccess > xConfigAccess(
- Reference< XNameAccess >(
- xConfigProvider->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationAccess" )),
- aArgs ),
- UNO_QUERY )
- );
- if( xConfigAccess.is() )
- {
- try
- {
- sal_Bool bValue = sal_False;
- Any aAny = xConfigAccess->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsForPagePreviews" ) ) );
- if( aAny >>= bValue )
- bRet = bool(bValue);
- }
- catch( NoSuchElementException& )
- {
- }
- catch( WrappedTargetException& )
- {
- }
- }
- }
- }
- catch( Exception& )
- {
- }
- }
- }
- catch( WrappedTargetException& )
- {
- }
- }
- return bRet;
-}
-
void PrintDialog::PrintPreviewWindow::DataChanged( const DataChangedEvent& i_rDCEvt )
{
// react on settings changed
if( i_rDCEvt.GetType() == DATACHANGED_SETTINGS )
{
- if( useHCColorReplacement() )
- maPageVDev.SetBackground( GetSettings().GetStyleSettings().GetWindowColor() );
- else
- maPageVDev.SetBackground( Color( COL_WHITE ) );
+ maPageVDev.SetBackground( Color( COL_WHITE ) );
}
Window::DataChanged( i_rDCEvt );
}
@@ -321,10 +252,6 @@ void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPrevi
aBuf.append( maToolTipString );
SetQuickHelpText( aBuf.makeStringAndClear() );
maMtf = i_rNewPreview;
- if( useHCColorReplacement() )
- {
- maMtf.ReplaceColors( Color( COL_BLACK ), Color( COL_WHITE ), 30 );
- }
maOrigSize = i_rOrigSize;
maReplacementString = i_rReplacement;
@@ -622,13 +549,12 @@ PrintDialog::JobTabPage::JobTabPage( Window* i_pParent, const ResId& rResId )
, maCollateImage( this, VclResId( SV_PRINT_COLLATE_IMAGE ) )
, maReverseOrderBox( this, VclResId( SV_PRINT_OPT_REVERSE ) )
, maCollateImg( VclResId( SV_PRINT_COLLATE_IMG ) )
- , maCollateHCImg( VclResId( SV_PRINT_COLLATE_HC_IMG ) )
, maNoCollateImg( VclResId( SV_PRINT_NOCOLLATE_IMG ) )
- , maNoCollateHCImg( VclResId( SV_PRINT_NOCOLLATE_HC_IMG ) )
, mnCollateUIMode( 0 )
{
FreeResource();
+
maCopySpacer.Show();
maStatusTxt.Show();
maCommentTxt.Show();
@@ -706,15 +632,6 @@ void PrintDialog::JobTabPage::readFromSettings()
SettingsConfigItem* pItem = SettingsConfigItem::get();
rtl::OUString aValue;
- #if 0
- // do not actually make copy count persistent
- // the assumption is that this would lead to a lot of unwanted copies
- aValue = pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CopyCount" ) ) );
- sal_Int32 nVal = aValue.toInt32();
- maCopyCountField.SetValue( sal_Int64(nVal > 1 ? nVal : 1) );
- #endif
-
aValue = pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CollateBox" ) ) );
if( aValue.equalsIgnoreAsciiCaseAscii( "alwaysoff" ) )
@@ -741,7 +658,8 @@ void PrintDialog::JobTabPage::storeToSettings()
maCopyCountField.GetText() );
pItem->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Collate" ) ),
- rtl::OUString::createFromAscii( maCollateBox.IsChecked() ? "true" : "false" ) );
+ maCollateBox.IsChecked() ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("true")) :
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("false")) );
}
PrintDialog::OutputOptPage::OutputOptPage( Window* i_pParent, const ResId& i_rResId )
@@ -776,14 +694,6 @@ void PrintDialog::OutputOptPage::setupLayout()
void PrintDialog::OutputOptPage::readFromSettings()
{
- #if 0
- SettingsConfigItem* pItem = SettingsConfigItem::get();
- rtl::OUString aValue;
-
- aValue = pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ToFile" ) ) );
- maToFileBox.Check( aValue.equalsIgnoreAsciiCaseAscii( "true" ) );
- #endif
}
void PrintDialog::OutputOptPage::storeToSettings()
@@ -791,7 +701,8 @@ void PrintDialog::OutputOptPage::storeToSettings()
SettingsConfigItem* pItem = SettingsConfigItem::get();
pItem->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ToFile" ) ),
- rtl::OUString::createFromAscii( maToFileBox.IsChecked() ? "true" : "false" ) );
+ maToFileBox.IsChecked() ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("true"))
+ : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("false")) );
}
PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterController>& i_rController )
@@ -841,6 +752,7 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont
// init reverse print
maJobPage.maReverseOrderBox.Check( maPController->getReversePrint() );
+
// fill printer listbox
const std::vector< rtl::OUString >& rQueues( Printer::GetPrinterQueues() );
for( std::vector< rtl::OUString >::const_iterator it = rQueues.begin();
@@ -1147,7 +1059,6 @@ void PrintDialog::setupOptionalUI()
rOptions[i].Value >>= aOptProp;
// extract ui element
- bool bEnabled = true;
rtl::OUString aCtrlType;
rtl::OUString aText;
rtl::OUString aPropertyName;
@@ -1165,59 +1076,58 @@ void PrintDialog::setupOptionalUI()
for( int n = 0; n < aOptProp.getLength(); n++ )
{
const beans::PropertyValue& rEntry( aOptProp[ n ] );
- if( rEntry.Name.equalsAscii( "Text" ) )
+ if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Text" ) ) )
{
rEntry.Value >>= aText;
}
- else if( rEntry.Name.equalsAscii( "ControlType" ) )
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ControlType" ) ) )
{
rEntry.Value >>= aCtrlType;
}
- else if( rEntry.Name.equalsAscii( "Choices" ) )
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Choices" ) ) )
{
rEntry.Value >>= aChoices;
}
- else if( rEntry.Name.equalsAscii( "ChoicesDisabled" ) )
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ChoicesDisabled" ) ) )
{
rEntry.Value >>= aChoicesDisabled;
}
- else if( rEntry.Name.equalsAscii( "Property" ) )
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Property" ) ) )
{
PropertyValue aVal;
rEntry.Value >>= aVal;
aPropertyName = aVal.Name;
}
- else if( rEntry.Name.equalsAscii( "Enabled" ) )
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Enabled" ) ) )
{
sal_Bool bValue = sal_True;
rEntry.Value >>= bValue;
- bEnabled = bValue;
}
- else if( rEntry.Name.equalsAscii( "GroupingHint" ) )
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "GroupingHint" ) ) )
{
rEntry.Value >>= aGroupingHint;
}
- else if( rEntry.Name.equalsAscii( "DependsOnName" ) )
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DependsOnName" ) ) )
{
rEntry.Value >>= aDependsOnName;
}
- else if( rEntry.Name.equalsAscii( "DependsOnEntry" ) )
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DependsOnEntry" ) ) )
{
rEntry.Value >>= nDependsOnValue;
}
- else if( rEntry.Name.equalsAscii( "AttachToDependency" ) )
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "AttachToDependency" ) ) )
{
rEntry.Value >>= bUseDependencyRow;
}
- else if( rEntry.Name.equalsAscii( "MinValue" ) )
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MinValue" ) ) )
{
rEntry.Value >>= nMinValue;
}
- else if( rEntry.Name.equalsAscii( "MaxValue" ) )
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MaxValue" ) ) )
{
rEntry.Value >>= nMaxValue;
}
- else if( rEntry.Name.equalsAscii( "HelpText" ) )
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "HelpText" ) ) )
{
if( ! (rEntry.Value >>= aHelpTexts) )
{
@@ -1229,7 +1139,7 @@ void PrintDialog::setupOptionalUI()
}
}
}
- else if( rEntry.Name.equalsAscii( "HelpId" ) )
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "HelpId" ) ) )
{
if( ! (rEntry.Value >>= aHelpIds ) )
{
@@ -1241,7 +1151,7 @@ void PrintDialog::setupOptionalUI()
}
}
}
- else if( rEntry.Name.equalsAscii( "HintNoLayoutPage" ) )
+ else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "HintNoLayoutPage" ) ) )
{
sal_Bool bNoLayoutPage = sal_False;
rEntry.Value >>= bNoLayoutPage;
@@ -1256,7 +1166,7 @@ void PrintDialog::setupOptionalUI()
bool bSwitchPage = false;
if( aGroupingHint.getLength() )
bSwitchPage = true;
- else if( aCtrlType.equalsAscii( "Subgroup" ) || (bOnStaticPage && ! bSubgroupOnStaticPage ) )
+ else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Subgroup" ) ) || (bOnStaticPage && ! bSubgroupOnStaticPage ) )
bSwitchPage = true;
if( bSwitchPage )
{
@@ -1269,25 +1179,25 @@ void PrintDialog::setupOptionalUI()
bOnStaticPage = false;
bSubgroupOnStaticPage = false;
- if( aGroupingHint.equalsAscii( "PrintRange" ) )
+ if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintRange" ) ) )
{
pCurColumn = maJobPage.mxPrintRange;
pCurParent = &maJobPage; // set job page as current parent
bOnStaticPage = true;
}
- else if( aGroupingHint.equalsAscii( "OptionsPage" ) )
+ else if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OptionsPage" ) ) )
{
pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maOptionsPage.getLayout());
pCurParent = &maOptionsPage; // set options page as current parent
bOnStaticPage = true;
}
- else if( aGroupingHint.equalsAscii( "OptionsPageOptGroup" ) )
+ else if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OptionsPageOptGroup" ) ) )
{
pCurColumn = maOptionsPage.mxOptGroup;
pCurParent = &maOptionsPage; // set options page as current parent
bOnStaticPage = true;
}
- else if( aGroupingHint.equalsAscii( "LayoutPage" ) )
+ else if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "LayoutPage" ) ) )
{
pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maNUpPage.getLayout());
pCurParent = &maNUpPage; // set layout page as current parent
@@ -1301,7 +1211,7 @@ void PrintDialog::setupOptionalUI()
}
}
- if( aCtrlType.equalsAscii( "Group" ) ||
+ if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Group" ) ) ||
( ! pCurParent && ! (bOnStaticPage || aGroupingHint.getLength() ) ) )
{
// add new tab page
@@ -1326,16 +1236,16 @@ void PrintDialog::setupOptionalUI()
bSubgroupOnStaticPage = false;
bOnStaticPage = false;
}
- else if( aCtrlType.equalsAscii( "Subgroup" ) && (pCurParent || aGroupingHint.getLength() ) )
+ else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Subgroup" ) ) && (pCurParent || aGroupingHint.getLength() ) )
{
bSubgroupOnStaticPage = (aGroupingHint.getLength() != 0);
// create group FixedLine
- if( ! aGroupingHint.equalsAscii( "PrintRange" ) ||
+ if( ! aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintRange" ) ) ||
! pCurColumn->countElements() == 0
)
{
Window* pNewSub = NULL;
- if( aGroupingHint.equalsAscii( "PrintRange" ) )
+ if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintRange" ) ) )
pNewSub = new FixedText( pCurParent, WB_VCENTER );
else
pNewSub = new FixedLine( pCurParent );
@@ -1359,9 +1269,9 @@ void PrintDialog::setupOptionalUI()
pIndent->setChild( pCurColumn );
}
// EVIL
- else if( aCtrlType.equalsAscii( "Bool" ) &&
- aGroupingHint.equalsAscii( "LayoutPage" ) &&
- aPropertyName.equalsAscii( "PrintProspect" )
+ else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Bool" ) ) &&
+ aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "LayoutPage" ) ) &&
+ aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintProspect" ) )
)
{
maNUpPage.maBrochureBtn.SetText( aText );
@@ -1405,7 +1315,7 @@ void PrintDialog::setupOptionalUI()
}
}
}
- if( aCtrlType.equalsAscii( "Bool" ) && pCurParent )
+ if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Bool" ) ) && pCurParent )
{
// add a check box
CheckBox* pNewBox = new CheckBox( pCurParent );
@@ -1435,7 +1345,7 @@ void PrintDialog::setupOptionalUI()
// add checkbox to current column
pDependencyRow->addWindow( pNewBox );
}
- else if( aCtrlType.equalsAscii( "Radio" ) && pCurParent )
+ else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Radio" ) ) && pCurParent )
{
boost::shared_ptr<vcl::RowOrColumn> pRadioColumn( pCurColumn );
if( aText.getLength() )
@@ -1494,9 +1404,9 @@ void PrintDialog::setupOptionalUI()
pLabel->setLabel( pBtn );
}
}
- else if( ( aCtrlType.equalsAscii( "List" ) ||
- aCtrlType.equalsAscii( "Range" ) ||
- aCtrlType.equalsAscii( "Edit" )
+ else if( ( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "List" ) ) ||
+ aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Range" ) ) ||
+ aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Edit" ) )
) && pCurParent )
{
// create a row in the current column
@@ -1513,13 +1423,14 @@ void PrintDialog::setupOptionalUI()
pHeading->SetText( aText );
pHeading->Show();
+
// add to row
pLabel = new vcl::LabeledElement( pFieldColumn.get(), 2 );
pFieldColumn->addChild( pLabel );
pLabel->setLabel( pHeading );
}
- if( aCtrlType.equalsAscii( "List" ) )
+ if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "List" ) ) )
{
ListBox* pList = new ListBox( pCurParent, WB_DROPDOWN | WB_BORDER );
maControls.push_front( pList );
@@ -1552,7 +1463,7 @@ void PrintDialog::setupOptionalUI()
else
pFieldColumn->addWindow( pList );
}
- else if( aCtrlType.equalsAscii( "Range" ) )
+ else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Range" ) ) )
{
NumericField* pField = new NumericField( pCurParent, WB_BORDER | WB_SPIN );
maControls.push_front( pField );
@@ -1585,7 +1496,7 @@ void PrintDialog::setupOptionalUI()
else
pFieldColumn->addWindow( pField );
}
- else if( aCtrlType.equalsAscii( "Edit" ) )
+ else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Edit" ) ) )
{
Edit* pField = new Edit( pCurParent, WB_BORDER );
maControls.push_front( pField );
@@ -1615,7 +1526,7 @@ void PrintDialog::setupOptionalUI()
}
else
{
- DBG_ERROR( "Unsupported UI option" );
+ OSL_FAIL( "Unsupported UI option" );
}
pCurColumn = pSaveCurColumn;
@@ -1708,6 +1619,7 @@ void PrintDialog::setupOptionalUI()
}
Size aSz = getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED );
+
SetOutputSizePixel( aSz );
}
@@ -1727,21 +1639,12 @@ void PrintDialog::checkControlDependencies()
maJobPage.maCollateBox.Enable( sal_False );
Image aImg( maJobPage.maCollateBox.IsChecked() ? maJobPage.maCollateImg : maJobPage.maNoCollateImg );
- Image aHCImg( maJobPage.maCollateBox.IsChecked() ? maJobPage.maCollateHCImg : maJobPage.maNoCollateHCImg );
- bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
Size aImgSize( aImg.GetSizePixel() );
- Size aHCImgSize( aHCImg.GetSizePixel() );
-
- if( aHCImgSize.Width() > aImgSize.Width() )
- aImgSize.Width() = aHCImgSize.Width();
- if( aHCImgSize.Height() > aImgSize.Height() )
- aImgSize.Height() = aHCImgSize.Height();
// adjust size of image
maJobPage.maCollateImage.SetSizePixel( aImgSize );
- maJobPage.maCollateImage.SetImage( bHC ? aHCImg : aImg );
- maJobPage.maCollateImage.SetModeImage( aHCImg, BMP_COLOR_HIGHCONTRAST );
+ maJobPage.maCollateImage.SetImage( aImg );
maJobPage.getLayout()->resize();
// enable setup button only for printers that can be setup
@@ -2270,7 +2173,7 @@ PropertyValue* PrintDialog::getValueForWindow( Window* i_pWindow ) const
}
else
{
- DBG_ERROR( "changed control not in property map" );
+ OSL_FAIL( "changed control not in property map" );
}
return pVal;
}
@@ -2294,7 +2197,7 @@ void PrintDialog::updateWindowFromProperty( const rtl::OUString& i_rProperty )
{
pBox->Check( bVal );
}
- else if( i_rProperty.equalsAscii( "PrintProspect" ) )
+ else if( i_rProperty.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintProspect" ) ) )
{
// EVIL special case
if( bVal )
@@ -2598,3 +2501,4 @@ void PrintProgressDialog::Paint( const Rectangle& )
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx
index 31740214532b..588f4d4fa1fa 100644
--- a/vcl/source/window/scrwnd.cxx
+++ b/vcl/source/window/scrwnd.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,24 +29,15 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-// #include <math.h>
#include <limits.h>
#include <tools/time.hxx>
#include <tools/debug.hxx>
-#ifndef _SV_SVIDS_HRC
#include <vcl/svids.hrc>
-#endif
#include <vcl/svdata.hxx>
-#ifndef _VCL_TIMER_HXX
#include <vcl/timer.hxx>
-#endif
-#ifndef _VCL_EVENT_HXX
#include <vcl/event.hxx>
-#endif
-#ifndef _VCL_SCRWND_HXX
#include <scrwnd.hxx>
-#endif
#include <math.h>
#include <limits.h>
@@ -407,7 +399,7 @@ IMPL_LINK( ImplWheelWindow, ImplScrollHdl, Timer*, EMPTYARG )
pWindow->Command( aCEvt );
if( aDel.IsDead() )
return 0;
- mnRepaintTime = Max( Time::GetSystemTicks() - nTime, 1UL );
+ mnRepaintTime = Max( Time::GetSystemTicks() - nTime, (sal_uLong)1 );
ImplRecalcScrollValues();
}
}
@@ -418,3 +410,5 @@ IMPL_LINK( ImplWheelWindow, ImplScrollHdl, Timer*, EMPTYARG )
return 0L;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/scrwnd.hxx b/vcl/source/window/scrwnd.hxx
index 1b9011aa7859..ccc38c778c99 100644
--- a/vcl/source/window/scrwnd.hxx
+++ b/vcl/source/window/scrwnd.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -90,3 +91,5 @@ public:
void ImplSetWheelMode( sal_uLong nWheelMode );
sal_uLong ImplGetWheelMode() const { return mnWheelMode; }
};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx
index 9d7727493490..b8b6735d81ca 100644
--- a/vcl/source/window/seleng.cxx
+++ b/vcl/source/window/seleng.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,14 +50,12 @@ inline sal_Bool SelectionEngine::ShouldDeselect( sal_Bool bModifierKey1 ) const
|*
|* SelectionEngine::SelectionEngine()
|*
-|* Beschreibung SELENG.SDW
-|* Ersterstellung OV 10.10.94
-|* Letzte Aenderung OV 10.10.94
-|*
*************************************************************************/
-SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet ) :
- pWin( pWindow )
+SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet,
+ sal_uLong nAutoRepeatInterval ) :
+ pWin( pWindow ),
+ nUpdateInterval( nAutoRepeatInterval )
{
eSelMode = SINGLE_SELECTION;
pFunctionSet = pFuncSet;
@@ -64,17 +63,13 @@ SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet ) :
nLockedMods = 0;
aWTimer.SetTimeoutHdl( LINK( this, SelectionEngine, ImpWatchDog ) );
- aWTimer.SetTimeout( SELENG_AUTOREPEAT_INTERVAL );
+ aWTimer.SetTimeout( nUpdateInterval );
}
/*************************************************************************
|*
|* SelectionEngine::~SelectionEngine()
|*
-|* Beschreibung SELENG.SDW
-|* Ersterstellung OV 10.10.94
-|* Letzte Aenderung OV 10.10.94
-|*
*************************************************************************/
SelectionEngine::~SelectionEngine()
@@ -86,10 +81,6 @@ SelectionEngine::~SelectionEngine()
|*
|* SelectionEngine::ImpWatchDog()
|*
-|* Beschreibung SELENG.SDW
-|* Ersterstellung OV 10.10.94
-|* Letzte Aenderung OV 10.10.94
-|*
*************************************************************************/
IMPL_LINK( SelectionEngine, ImpWatchDog, Timer*, EMPTYARG )
@@ -103,10 +94,6 @@ IMPL_LINK( SelectionEngine, ImpWatchDog, Timer*, EMPTYARG )
|*
|* SelectionEngine::SetSelectionMode()
|*
-|* Beschreibung SELENG.SDW
-|* Ersterstellung OV 10.10.94
-|* Letzte Aenderung OV 10.10.94
-|*
*************************************************************************/
void SelectionEngine::SetSelectionMode( SelectionMode eMode )
@@ -118,10 +105,6 @@ void SelectionEngine::SetSelectionMode( SelectionMode eMode )
|*
|* SelectionEngine::ActivateDragMode()
|*
-|* Beschreibung SELENG.SDW
-|* Ersterstellung OV 10.10.94
-|* Letzte Aenderung OV 10.10.94
-|*
*************************************************************************/
void SelectionEngine::ActivateDragMode()
@@ -133,10 +116,6 @@ void SelectionEngine::ActivateDragMode()
|*
|* SelectionEngine::CursorPosChanging()
|*
-|* Beschreibung SELENG.SDW
-|* Ersterstellung OV 10.10.94
-|* Letzte Aenderung GT 2002-04-04
-|*
*************************************************************************/
void SelectionEngine::CursorPosChanging( sal_Bool bShift, sal_Bool bMod1 )
@@ -191,10 +170,6 @@ void SelectionEngine::CursorPosChanging( sal_Bool bShift, sal_Bool bMod1 )
|*
|* SelectionEngine::SelMouseButtonDown()
|*
-|* Beschreibung SELENG.SDW
-|* Ersterstellung OV 10.10.94
-|* Letzte Aenderung OV 07.06.95
-|*
*************************************************************************/
sal_Bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
@@ -328,10 +303,6 @@ sal_Bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt )
|*
|* SelectionEngine::SelMouseButtonUp()
|*
-|* Beschreibung SELENG.SDW
-|* Ersterstellung OV 10.10.94
-|* Letzte Aenderung OV 10.10.94
-|*
*************************************************************************/
sal_Bool SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
@@ -382,10 +353,6 @@ sal_Bool SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
|*
|* SelectionEngine::SelMouseMove()
|*
-|* Beschreibung SELENG.SDW
-|* Ersterstellung OV 10.10.94
-|* Letzte Aenderung OV 10.10.94
-|*
*************************************************************************/
sal_Bool SelectionEngine::SelMouseMove( const MouseEvent& rMEvt )
@@ -404,7 +371,7 @@ sal_Bool SelectionEngine::SelMouseMove( const MouseEvent& rMEvt )
if( aWTimer.IsActive() && !aArea.IsInside( rMEvt.GetPosPixel() ))
return sal_True;
-
+ aWTimer.SetTimeout( nUpdateInterval );
aWTimer.Start();
if ( eSelMode != SINGLE_SELECTION )
{
@@ -426,10 +393,6 @@ sal_Bool SelectionEngine::SelMouseMove( const MouseEvent& rMEvt )
|*
|* SelectionEngine::SetWindow()
|*
-|* Beschreibung SELENG.SDW
-|* Ersterstellung OV 10.10.94
-|* Letzte Aenderung OV 10.10.94
-|*
*************************************************************************/
void SelectionEngine::SetWindow( Window* pNewWin )
@@ -448,10 +411,6 @@ void SelectionEngine::SetWindow( Window* pNewWin )
|*
|* SelectionEngine::Reset()
|*
-|* Beschreibung SELENG.SDW
-|* Ersterstellung OV 07.07.95
-|* Letzte Aenderung OV 07.07.95
-|*
*************************************************************************/
void SelectionEngine::Reset()
@@ -467,10 +426,6 @@ void SelectionEngine::Reset()
|*
|* SelectionEngine::Command()
|*
-|* Beschreibung SELENG.SDW
-|* Ersterstellung OV 07.07.95
-|* Letzte Aenderung OV 07.07.95
-|*
*************************************************************************/
void SelectionEngine::Command( const CommandEvent& rCEvt )
@@ -500,3 +455,29 @@ void SelectionEngine::Command( const CommandEvent& rCEvt )
nFlags &= ~SELENG_CMDEVT;
}
}
+
+void SelectionEngine::SetUpdateInterval( sal_uLong nInterval )
+{
+ if (nInterval < SELENG_AUTOREPEAT_INTERVAL_MIN)
+ // Set a lower threshold. On Windows, setting this value too low
+ // would cause selection to get updated indefinitely.
+ nInterval = SELENG_AUTOREPEAT_INTERVAL_MIN;
+
+ if (nUpdateInterval == nInterval)
+ // no update needed.
+ return;
+
+ if (aWTimer.IsActive())
+ {
+ // reset the timer right away on interval change.
+ aWTimer.Stop();
+ aWTimer.SetTimeout(nInterval);
+ aWTimer.Start();
+ }
+ else
+ aWTimer.SetTimeout(nInterval);
+
+ nUpdateInterval = nInterval;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx
index face35a179d8..1d4c8bfae815 100644
--- a/vcl/source/window/split.cxx
+++ b/vcl/source/window/split.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/event.hxx>
#include <vcl/split.hxx>
#include <vcl/svapp.hxx>
@@ -804,3 +803,5 @@ void Splitter::Paint( const Rectangle& rPaintRect )
Window::Paint( rPaintRect );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx
index 3a66ead3944c..d0bf60b6412c 100644
--- a/vcl/source/window/splitwin.cxx
+++ b/vcl/source/window/splitwin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,6 @@
#include "precompiled_vcl.hxx"
#include <string.h>
-#include <tools/list.hxx>
#include <tools/debug.hxx>
#include <tools/rcid.h>
#include <vcl/event.hxx>
@@ -37,16 +37,13 @@
#include <vcl/bitmap.hxx>
#include <vcl/decoview.hxx>
#include <vcl/symbol.hxx>
-#ifndef _SV_SVIDS_HRC
#include <vcl/svids.hrc>
-#endif
#include <vcl/image.hxx>
#include <vcl/svdata.hxx>
#include <vcl/help.hxx>
#include <vcl/splitwin.hxx>
-
// =======================================================================
// Attention: Must not contain non-PODs because array is enlarged/copied
@@ -123,10 +120,6 @@ namespace {
#define SPLIT_WINDOW ((sal_uInt16)0x0004)
#define SPLIT_NOSPLIT ((sal_uInt16)0x8000)
-// -----------------------------------------------------------------------
-
-DECLARE_LIST( ImplSplitList, SplitWindow* )
-
// =======================================================================
static void ImplCalcBorder( WindowAlign eAlign, sal_Bool bNoAlign,
@@ -189,42 +182,7 @@ void SplitWindow::ImplDrawBorder( SplitWindow* pWin )
aDecoView.DrawFrame( aRect, FRAME_DRAW_DOUBLEIN );
}
else
- {/*
- if ( pWin->meAlign == WINDOWALIGN_BOTTOM )
- {
- pWin->SetLineColor( rStyleSettings.GetShadowColor() );
- pWin->DrawLine( Point( 0, nDY-2 ), Point( nDX-1, nDY-2 ) );
- pWin->SetLineColor( rStyleSettings.GetLightColor() );
- pWin->DrawLine( Point( 0, nDY-1 ), Point( nDX-1, nDY-1 ) );
- }
- else
- {
- pWin->SetLineColor( rStyleSettings.GetShadowColor() );
- pWin->DrawLine( Point( 0, 0 ), Point( nDX-1, 0 ) );
- pWin->SetLineColor( rStyleSettings.GetLightColor() );
- pWin->DrawLine( Point( 0, 1 ), Point( nDX-1, 1 ) );
- if ( (pWin->meAlign == WINDOWALIGN_LEFT) || (pWin->meAlign == WINDOWALIGN_RIGHT) )
- {
- if ( pWin->meAlign == WINDOWALIGN_LEFT )
- {
- pWin->SetLineColor( rStyleSettings.GetShadowColor() );
- pWin->DrawLine( Point( 0, 0 ), Point( 0, nDY-1 ) );
- pWin->DrawLine( Point( 0, nDY-2 ), Point( nDX-1, nDY-2 ) );
- pWin->SetLineColor( rStyleSettings.GetLightColor() );
- pWin->DrawLine( Point( 1, 1 ), Point( 1, nDY-3 ) );
- pWin->DrawLine( Point( 0, nDY-1 ), Point( nDX-1, nDY-1 ) );
- }
- else
- {
- pWin->SetLineColor( rStyleSettings.GetShadowColor() );
- pWin->DrawLine( Point( nDX-2, 0 ), Point( nDX-2, nDY-3 ) );
- pWin->DrawLine( Point( 0, nDY-2 ), Point( nDX-2, nDY-2 ) );
- pWin->SetLineColor( rStyleSettings.GetLightColor() );
- pWin->DrawLine( Point( nDX-1, 0 ), Point( nDX-1, nDY-1 ) );
- pWin->DrawLine( Point( 0, nDY-1 ), Point( nDX-1, nDY-1 ) );
- }
- }
- }*/
+ {
if ( pWin->meAlign == WINDOWALIGN_BOTTOM )
{
pWin->SetLineColor( rStyleSettings.GetShadowColor() );
@@ -3938,3 +3896,5 @@ Rectangle SplitWindow::GetFadeOutRect() const
ImplGetFadeOutRect( aRect, sal_True );
return aRect;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index a261b6bd96a7..9280bb25b80c 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <tools/list.hxx>
#include <tools/debug.hxx>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/svdata.hxx>
#include <vcl/event.hxx>
#include <vcl/decoview.hxx>
@@ -96,8 +94,6 @@ struct ImplStatusItem
XubString maCommand;
};
-DECLARE_LIST( ImplStatusItemList, ImplStatusItem* )
-
// =======================================================================
inline long ImplCalcProgessWidth( sal_uInt16 nMax, long nSize )
@@ -197,18 +193,13 @@ StatusBar::StatusBar( Window* pParent, const ResId& rResId ) :
StatusBar::~StatusBar()
{
// Alle Items loeschen
- ImplStatusItem* pItem = mpItemList->First();
- while ( pItem )
- {
- delete pItem;
- pItem = mpItemList->Next();
+ for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
+ delete (*mpItemList)[ i ];
}
-
delete mpItemList;
// VirtualDevice loeschen
delete mpImplData->mpVirDev;
-
delete mpImplData;
}
@@ -280,19 +271,17 @@ void StatusBar::ImplFormat()
// Breiten zusammenrechnen
mnItemsWidth = STATUSBAR_OFFSET_X;
long nOffset = 0;
- pItem = mpItemList->First();
- while ( pItem )
- {
+ for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
+ pItem = (*mpItemList)[ i ];
if ( pItem->mbVisible )
{
- if ( pItem->mnBits & SIB_AUTOSIZE )
+ if ( pItem->mnBits & SIB_AUTOSIZE ) {
nAutoSizeItems++;
+ }
mnItemsWidth += pItem->mnWidth + nOffset;
nOffset = pItem->mnOffset;
}
-
- pItem = mpItemList->Next();
}
if ( GetStyle() & WB_RIGHT )
@@ -324,28 +313,22 @@ void StatusBar::ImplFormat()
nX += ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset;
}
- pItem = mpItemList->First();
- while ( pItem )
- {
- if ( pItem->mbVisible )
- {
- if ( pItem->mnBits & SIB_AUTOSIZE )
- {
+ for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
+ pItem = (*mpItemList)[ i ];
+ if ( pItem->mbVisible ) {
+ if ( pItem->mnBits & SIB_AUTOSIZE ) {
pItem->mnExtraWidth = nExtraWidth;
- if ( nExtraWidth2 )
- {
+ if ( nExtraWidth2 ) {
pItem->mnExtraWidth++;
nExtraWidth2--;
}
- }
- else
+ } else {
pItem->mnExtraWidth = 0;
+ }
pItem->mnX = nX;
nX += pItem->mnWidth + pItem->mnExtraWidth + pItem->mnOffset;
}
-
- pItem = mpItemList->Next();
}
mbFormat = sal_False;
@@ -357,7 +340,7 @@ Rectangle StatusBar::ImplGetItemRectPos( sal_uInt16 nPos ) const
{
Rectangle aRect;
ImplStatusItem* pItem;
- pItem = mpItemList->GetObject( nPos );
+ pItem = ( nPos < mpItemList->size() ) ? (*mpItemList)[ nPos ] : NULL;
if ( pItem )
{
if ( pItem->mbVisible )
@@ -380,13 +363,13 @@ sal_uInt16 StatusBar::ImplGetFirstVisiblePos() const
{
ImplStatusItem* pItem;
- for( sal_uInt16 nPos = 0; nPos < mpItemList->Count(); nPos++ )
+ for( size_t nPos = 0; nPos < mpItemList->size(); nPos++ )
{
- pItem = mpItemList->GetObject( nPos );
+ pItem = (*mpItemList)[ nPos ];
if ( pItem )
{
if ( pItem->mbVisible )
- return nPos;
+ return sal_uInt16(nPos);
}
}
@@ -440,7 +423,7 @@ void StatusBar::ImplDrawItem( sal_Bool bOffScreen, sal_uInt16 nPos, sal_Bool bDr
return;
// Ausgabebereich berechnen
- ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+ ImplStatusItem* pItem = (*mpItemList)[ nPos ];
long nW = mpImplData->mnItemBorderWidth + 1;
Rectangle aTextRect( aRect.Left()+nW, aRect.Top()+nW,
aRect.Right()-nW, aRect.Bottom()-nW );
@@ -743,14 +726,13 @@ void StatusBar::MouseButtonDown( const MouseEvent& rMEvt )
if ( mbVisibleItems )
{
Point aMousePos = rMEvt.GetPosPixel();
- sal_uInt16 i = 0;
// Item suchen, das geklickt wurde
- ImplStatusItem* pItem = mpItemList->First();
- while ( pItem )
+ for ( size_t i = 0; i < mpItemList->size(); ++i )
{
+ ImplStatusItem* pItem = (*mpItemList)[ i ];
// Ist es dieses Item
- if ( ImplGetItemRectPos( i ).IsInside( aMousePos ) )
+ if ( ImplGetItemRectPos( sal_uInt16(i) ).IsInside( aMousePos ) )
{
mnCurItemId = pItem->mnId;
if ( rMEvt.GetClicks() == 2 )
@@ -762,9 +744,6 @@ void StatusBar::MouseButtonDown( const MouseEvent& rMEvt )
// Item wurde gefunden
return;
}
-
- i++;
- pItem = mpItemList->Next();
}
}
@@ -783,7 +762,7 @@ void StatusBar::Paint( const Rectangle& )
if ( mbFormat )
ImplFormat();
- sal_uInt16 nItemCount = (sal_uInt16)mpItemList->Count();
+ sal_uInt16 nItemCount = sal_uInt16( mpItemList->size() );
if ( mbProgressMode )
ImplDrawProgress( sal_True, 0, mnPercent );
@@ -962,22 +941,23 @@ void StatusBar::DataChanged( const DataChangedEvent& rDCEvt )
{
Window::DataChanged( rDCEvt );
- if ( (rDCEvt.GetType() == DATACHANGED_DISPLAY) ||
- (rDCEvt.GetType() == DATACHANGED_FONTS) ||
- (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
- ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
- (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
+ if ( (rDCEvt.GetType() == DATACHANGED_DISPLAY )
+ || (rDCEvt.GetType() == DATACHANGED_FONTS )
+ || (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION)
+ || ( (rDCEvt.GetType() == DATACHANGED_SETTINGS)
+ && (rDCEvt.GetFlags() & SETTINGS_STYLE )
+ )
+ )
{
mbFormat = sal_True;
ImplInitSettings( sal_True, sal_True, sal_True );
- ImplStatusItem* pItem = mpItemList->First();
long nFudge = GetTextHeight() / 4;
- while ( pItem )
+ for ( size_t i = 0, n = mpItemList->size(); i < n; ++i )
{
+ ImplStatusItem* pItem = (*mpItemList)[ i ];
long nWidth = GetTextWidth( pItem->maText ) + nFudge;
if( nWidth > pItem->mnWidth + STATUSBAR_OFFSET )
pItem->mnWidth = nWidth + STATUSBAR_OFFSET;
- pItem = mpItemList->Next();
}
Size aSize = GetSizePixel();
// do not disturb current width, since
@@ -1037,7 +1017,11 @@ void StatusBar::InsertItem( sal_uInt16 nItemId, sal_uLong nWidth,
pItem->mbVisible = sal_True;
// Item in die Liste einfuegen
- mpItemList->Insert( pItem, nPos );
+ if ( nPos < mpItemList->size() ) {
+ mpItemList->insert( mpItemList->begin() + nPos, pItem );
+ } else {
+ mpItemList->push_back( pItem );
+ }
mbFormat = sal_True;
if ( ImplIsItemUpdate() )
@@ -1053,8 +1037,8 @@ void StatusBar::RemoveItem( sal_uInt16 nItemId )
sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = mpItemList->Remove( nPos );
- delete pItem;
+ delete (*mpItemList)[ nPos ];
+ mpItemList->erase( mpItemList->begin() + nPos );
mbFormat = sal_True;
if ( ImplIsItemUpdate() )
@@ -1072,7 +1056,7 @@ void StatusBar::ShowItem( sal_uInt16 nItemId )
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+ ImplStatusItem* pItem = (*mpItemList)[ nPos ];
if ( !pItem->mbVisible )
{
pItem->mbVisible = sal_True;
@@ -1094,7 +1078,7 @@ void StatusBar::HideItem( sal_uInt16 nItemId )
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+ ImplStatusItem* pItem = (*mpItemList)[ nPos ];
if ( pItem->mbVisible )
{
pItem->mbVisible = sal_False;
@@ -1115,7 +1099,7 @@ sal_Bool StatusBar::IsItemVisible( sal_uInt16 nItemId ) const
sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return mpItemList->GetObject( nPos )->mbVisible;
+ return (*mpItemList)[ nPos ]->mbVisible;
else
return sal_False;
}
@@ -1153,24 +1137,14 @@ void StatusBar::HideItems()
void StatusBar::CopyItems( const StatusBar& rStatusBar )
{
// Alle Items entfernen
- ImplStatusItem* pItem = mpItemList->First();
- while ( pItem )
- {
- delete pItem;
- pItem = mpItemList->Next();
+ for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
+ delete (*mpItemList)[ i ];
}
-
- // Items aus der Liste loeschen
- mpItemList->Clear();
+ mpItemList->clear();
// Items kopieren
- sal_uLong i = 0;
- pItem = rStatusBar.mpItemList->GetObject( i );
- while ( pItem )
- {
- mpItemList->Insert( new ImplStatusItem( *pItem ), LIST_APPEND );
- i++;
- pItem = rStatusBar.mpItemList->GetObject( i );
+ for ( size_t i = 0, n = rStatusBar.mpItemList->size(); i < n; ++i ) {
+ mpItemList->push_back( new ImplStatusItem( *(*rStatusBar.mpItemList)[ i ] ) );
}
mbFormat = sal_True;
@@ -1183,15 +1157,10 @@ void StatusBar::CopyItems( const StatusBar& rStatusBar )
void StatusBar::Clear()
{
// Alle Item loeschen
- ImplStatusItem* pItem = mpItemList->First();
- while ( pItem )
- {
- delete pItem;
- pItem = mpItemList->Next();
+ for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
+ delete (*mpItemList)[ i ];
}
-
- // Items aus der Liste loeschen
- mpItemList->Clear();
+ mpItemList->clear();
mbFormat = sal_True;
if ( ImplIsItemUpdate() )
@@ -1204,31 +1173,26 @@ void StatusBar::Clear()
sal_uInt16 StatusBar::GetItemCount() const
{
- return (sal_uInt16)mpItemList->Count();
+ return (sal_uInt16)mpItemList->size();
}
// -----------------------------------------------------------------------
sal_uInt16 StatusBar::GetItemId( sal_uInt16 nPos ) const
{
- ImplStatusItem* pItem = mpItemList->GetObject( nPos );
- if ( pItem )
- return pItem->mnId;
- else
- return 0;
+ if ( nPos < mpItemList->size() )
+ return (*mpItemList)[ nPos ]->mnId;
+ return 0;
}
// -----------------------------------------------------------------------
sal_uInt16 StatusBar::GetItemPos( sal_uInt16 nItemId ) const
{
- ImplStatusItem* pItem = mpItemList->First();
- while ( pItem )
- {
- if ( pItem->mnId == nItemId )
- return (sal_uInt16)mpItemList->GetCurPos();
-
- pItem = mpItemList->Next();
+ for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) {
+ if ( (*mpItemList)[ i ]->mnId == nItemId ) {
+ return sal_uInt16( i );
+ }
}
return STATUSBAR_ITEM_NOTFOUND;
@@ -1247,7 +1211,7 @@ sal_uInt16 StatusBar::GetItemId( const Point& rPos ) const
// Rechteck holen
Rectangle aRect = ImplGetItemRectPos( nPos );
if ( aRect.IsInside( rPos ) )
- return mpItemList->GetObject( nPos )->mnId;
+ return (*mpItemList)[ nPos ]->mnId;
}
}
@@ -1289,7 +1253,7 @@ Point StatusBar::GetItemTextPos( sal_uInt16 nItemId ) const
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
// Rechteck holen
- ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+ ImplStatusItem* pItem = (*mpItemList)[ nPos ];
Rectangle aRect = ImplGetItemRectPos( nPos );
long nW = mpImplData->mnItemBorderWidth + 1;
Rectangle aTextRect( aRect.Left()+nW, aRect.Top()+nW,
@@ -1316,9 +1280,9 @@ sal_uLong StatusBar::GetItemWidth( sal_uInt16 nItemId ) const
sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return mpItemList->GetObject( nPos )->mnWidth;
- else
- return 0;
+ return (*mpItemList)[ nPos ]->mnWidth;
+
+ return 0;
}
// -----------------------------------------------------------------------
@@ -1328,9 +1292,9 @@ StatusBarItemBits StatusBar::GetItemBits( sal_uInt16 nItemId ) const
sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return mpItemList->GetObject( nPos )->mnBits;
- else
- return 0;
+ return (*mpItemList)[ nPos ]->mnBits;
+
+ return 0;
}
// -----------------------------------------------------------------------
@@ -1340,9 +1304,9 @@ long StatusBar::GetItemOffset( sal_uInt16 nItemId ) const
sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return mpItemList->GetObject( nPos )->mnOffset;
- else
- return 0;
+ return (*mpItemList)[ nPos ]->mnOffset;
+
+ return 0;
}
// -----------------------------------------------------------------------
@@ -1353,7 +1317,7 @@ void StatusBar::SetItemText( sal_uInt16 nItemId, const XubString& rText )
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+ ImplStatusItem* pItem = (*mpItemList)[ nPos ];
if ( pItem->maText != rText )
{
@@ -1389,9 +1353,9 @@ const XubString& StatusBar::GetItemText( sal_uInt16 nItemId ) const
sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return mpItemList->GetObject( nPos )->maText;
- else
- return ImplGetSVEmptyStr();
+ return (*mpItemList)[ nPos ]->maText;
+
+ return ImplGetSVEmptyStr();
}
// -----------------------------------------------------------------------
@@ -1402,7 +1366,7 @@ void StatusBar::SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand )
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+ ImplStatusItem* pItem = (*mpItemList)[ nPos ];
if ( pItem->maCommand != rCommand )
pItem->maCommand = rCommand;
@@ -1416,9 +1380,9 @@ const XubString& StatusBar::GetItemCommand( sal_uInt16 nItemId )
sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return mpItemList->GetObject( nPos )->maCommand;
- else
- return ImplGetSVEmptyStr();
+ return (*mpItemList)[ nPos ]->maCommand;
+
+ return ImplGetSVEmptyStr();
}
// -----------------------------------------------------------------------
@@ -1429,7 +1393,7 @@ void StatusBar::SetItemData( sal_uInt16 nItemId, void* pNewData )
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+ ImplStatusItem* pItem = (*mpItemList)[ nPos ];
pItem->mpUserData = pNewData;
// Wenn es ein User-Item ist, DrawItem-Aufrufen
@@ -1450,9 +1414,9 @@ void* StatusBar::GetItemData( sal_uInt16 nItemId ) const
sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return mpItemList->GetObject( nPos )->mpUserData;
- else
- return NULL;
+ return (*mpItemList)[ nPos ]->mpUserData;
+
+ return NULL;
}
// -----------------------------------------------------------------------
@@ -1462,7 +1426,7 @@ void StatusBar::SetHelpText( sal_uInt16 nItemId, const XubString& rText )
sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- mpItemList->GetObject( nPos )->maHelpText = rText;
+ (*mpItemList)[ nPos ]->maHelpText = rText;
}
// -----------------------------------------------------------------------
@@ -1473,7 +1437,7 @@ const XubString& StatusBar::GetHelpText( sal_uInt16 nItemId ) const
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+ ImplStatusItem* pItem = (*mpItemList)[ nPos ];
if ( !pItem->maHelpText.Len() && ( pItem->maHelpId.getLength() || pItem->maCommand.Len() ))
{
Help* pHelp = Application::GetHelp();
@@ -1499,7 +1463,7 @@ void StatusBar::SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText )
sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- mpItemList->GetObject( nPos )->maQuickHelpText = rText;
+ (*mpItemList)[ nPos ]->maQuickHelpText = rText;
}
// -----------------------------------------------------------------------
@@ -1510,11 +1474,11 @@ const XubString& StatusBar::GetQuickHelpText( sal_uInt16 nItemId ) const
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+ ImplStatusItem* pItem = (*mpItemList)[ nPos ];
return pItem->maQuickHelpText;
}
- else
- return ImplGetSVEmptyStr();
+
+ return ImplGetSVEmptyStr();
}
// -----------------------------------------------------------------------
@@ -1524,7 +1488,7 @@ void StatusBar::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId )
sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- mpItemList->GetObject( nPos )->maHelpId = rHelpId;
+ (*mpItemList)[ nPos ]->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
@@ -1536,7 +1500,7 @@ rtl::OString StatusBar::GetHelpId( sal_uInt16 nItemId ) const
rtl::OString aRet;
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+ ImplStatusItem* pItem = (*mpItemList)[ nPos ];
if ( pItem->maHelpId.getLength() )
aRet = pItem->maHelpId;
else
@@ -1709,15 +1673,15 @@ void StatusBar::SetText( const XubString& rText )
Size StatusBar::CalcWindowSizePixel() const
{
- sal_uLong i = 0;
- sal_uLong nCount = mpItemList->Count();
+ size_t i = 0;
+ size_t nCount = mpItemList->size();
long nOffset = 0;
long nCalcWidth = (STATUSBAR_OFFSET_X*2);
long nCalcHeight;
while ( i < nCount )
{
- ImplStatusItem* pItem = mpItemList->GetObject( i );
+ ImplStatusItem* pItem = (*mpItemList)[ i ];
nCalcWidth += pItem->mnWidth + nOffset;
nOffset = pItem->mnOffset;
i++;
@@ -1777,7 +1741,7 @@ void StatusBar::SetAccessibleName( sal_uInt16 nItemId, const XubString& rName )
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
- ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+ ImplStatusItem* pItem = (*mpItemList)[ nPos ];
if ( pItem->maAccessibleName != rName )
{
@@ -1794,9 +1758,11 @@ const XubString& StatusBar::GetAccessibleName( sal_uInt16 nItemId ) const
sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return mpItemList->GetObject( nPos )->maAccessibleName;
- else
- return ImplGetSVEmptyStr();
+ return (*mpItemList)[ nPos ]->maAccessibleName;
+
+ return ImplGetSVEmptyStr();
}
// -----------------------------------------------------------------------
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx
index 9e7a30e983cb..002bf4acca6a 100644
--- a/vcl/source/window/syschild.cxx
+++ b/vcl/source/window/syschild.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -336,3 +337,5 @@ sal_IntPtr SystemChildWindow::GetParentWindowHandle( sal_Bool bUseJava )
return nRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index 48c7629c2026..3343779f632b 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include "precompiled_vcl.hxx"
#include <tools/debug.hxx>
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/salframe.hxx>
#include <vcl/svdata.hxx>
#include <vcl/svapp.hxx>
@@ -1080,7 +1079,14 @@ unsigned int SystemWindow::GetScreenNumber() const
// -----------------------------------------------------------------------
-void SystemWindow::SetScreenNumber( unsigned int nScreen)
+void SystemWindow::SetScreenNumber(unsigned int nScreen)
{
mpWindowImpl->mpFrame->SetScreenNumber( nScreen );
}
+
+void SystemWindow::SetApplicationID(const rtl::OUString &rApplicationID)
+{
+ mpWindowImpl->mpFrame->SetApplicationID(rApplicationID);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx
index 92c013218286..32e8a0dcec92 100644
--- a/vcl/source/window/tabdlg.cxx
+++ b/vcl/source/window/tabdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <vcl/fixed.hxx>
#include <vcl/tabctrl.hxx>
#include <vcl/tabdlg.hxx>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
@@ -274,3 +273,4 @@ void TabDialog::AdjustLayout()
ImplPosControls();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx
index dcb95b9b52a2..f109f2079a4c 100644
--- a/vcl/source/window/tabpage.cxx
+++ b/vcl/source/window/tabpage.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <tools/ref.hxx>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/svdata.hxx>
#include <vcl/svapp.hxx>
#include <vcl/event.hxx>
@@ -206,11 +205,4 @@ void TabPage::DeactivatePage()
{
}
-// -----------------------------------------------------------------------
-
-::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > TabPage::CreateAccessible()
-{
- // TODO: remove this method (incompatible)
-
- return Window::CreateAccessible();
-}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx
index 71a8f2ec2a30..56bd9d799cce 100644
--- a/vcl/source/window/taskpanelist.cxx
+++ b/vcl/source/window/taskpanelist.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -107,26 +108,8 @@ TaskPaneList::~TaskPaneList()
void TaskPaneList::AddWindow( Window *pWindow )
{
-#if OSL_DEBUG_LEVEL > 0
- bool bDockingWindow=false;
- bool bToolbox=false;
- bool bDialog=false;
- bool bUnknown=false;
-#endif
-
if( pWindow )
{
-#if OSL_DEBUG_LEVEL > 0
- if( pWindow->GetType() == RSC_DOCKINGWINDOW )
- bDockingWindow = true;
- else if( pWindow->GetType() == RSC_TOOLBOX )
- bToolbox = true;
- else if( pWindow->IsDialog() )
- bDialog = true;
- else
- bUnknown = true;
-#endif
-
::std::vector< Window* >::iterator insertionPos = mTaskPanes.end();
for ( ::std::vector< Window* >::iterator p = mTaskPanes.begin();
p != mTaskPanes.end();
@@ -144,8 +127,6 @@ void TaskPaneList::AddWindow( Window *pWindow )
// beginning, until the first window is found which has the ChildPathFocus. Now
// if this would be the ancestor window of another pane window, this would fudge
// the result
- // 2004-09-27 - fs@openoffice.org, while fixing #i33573#, which included replacing
- // the original fix for #98916# with this one here.
if ( pWindow->IsWindowOrChild( *p ) )
{
insertionPos = p + 1;
@@ -396,3 +377,4 @@ Window* TaskPaneList::FindNextFloat( Window *pWindow, sal_Bool bForward )
// --------------------------------------------------
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 105cf18bb43a..0eae498111ab 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,16 +29,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <rtl/logfile.hxx>
-#include <tools/list.hxx>
#include <tools/debug.hxx>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/svdata.hxx>
#include <vcl/event.hxx>
#include <vcl/decoview.hxx>
@@ -144,7 +140,7 @@ struct ImplToolSizeArray
// -----------------------------------------------------------------------
-DECLARE_LIST( ImplTBList, ToolBox* )
+typedef ::std::vector< ToolBox* > ImplTBList;
class ImplTBDragMgr
{
@@ -168,12 +164,19 @@ public:
ImplTBDragMgr();
~ImplTBDragMgr();
- void Insert( ToolBox* pBox )
- { mpBoxList->Insert( pBox ); }
- void Remove( ToolBox* pBox )
- { mpBoxList->Remove( pBox ); }
- sal_uLong Count() const
- { return mpBoxList->Count(); }
+ void push_back( ToolBox* pBox )
+ { mpBoxList->push_back( pBox ); }
+ void erase( ToolBox* pBox )
+ {
+ for ( ImplTBList::iterator it = mpBoxList->begin(); it < mpBoxList->end(); ++it ) {
+ if ( *it == pBox ) {
+ mpBoxList->erase( it );
+ break;
+ }
+ }
+ }
+ size_t size() const
+ { return mpBoxList->size(); }
ToolBox* FindToolBox( const Rectangle& rRect );
@@ -1122,7 +1125,7 @@ void ToolBox::ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRec
mbHorz = sal_True;
}
else {
- DBG_ERROR( "ImplLineSizing: Trailing else" );
+ OSL_FAIL( "ImplLineSizing: Trailing else" );
nCurSize = 0;
mbHorz = sal_False;
}
@@ -1253,7 +1256,7 @@ sal_uInt16 ToolBox::ImplFindItemPos( ToolBox* pBox, const Point& rPos )
ImplTBDragMgr::ImplTBDragMgr()
{
- mpBoxList = new ImplTBList( 4, 4 );
+ mpBoxList = new ImplTBList();
mnLineMode = 0;
mnStartLines = 0;
mbCustomizeMode = sal_False;
@@ -1277,9 +1280,9 @@ ImplTBDragMgr::~ImplTBDragMgr()
ToolBox* ImplTBDragMgr::FindToolBox( const Rectangle& rRect )
{
- ToolBox* pBox = mpBoxList->First();
- while ( pBox )
+ for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i )
{
+ ToolBox* pBox = (*mpBoxList)[ i ];
/*
* FIXME: since we can have multiple frames now we cannot
* find the drag target by its position alone.
@@ -1287,8 +1290,9 @@ ToolBox* ImplTBDragMgr::FindToolBox( const Rectangle& rRect )
* this works in one frame only anyway. If the dialogue
* changes to a system window, we need a new implementation here
*/
- if ( pBox->IsReallyVisible() && pBox->ImplGetWindowImpl()->mpFrame == mpDragBox->ImplGetWindowImpl()->mpFrame )
- {
+ if ( pBox->IsReallyVisible()
+ && pBox->ImplGetWindowImpl()->mpFrame == mpDragBox->ImplGetWindowImpl()->mpFrame
+ ) {
if ( !pBox->ImplIsFloatingMode() )
{
Point aPos = pBox->GetPosPixel();
@@ -1298,11 +1302,9 @@ ToolBox* ImplTBDragMgr::FindToolBox( const Rectangle& rRect )
return pBox;
}
}
-
- pBox = mpBoxList->Next();
}
- return pBox;
+ return NULL;
}
// -----------------------------------------------------------------------
@@ -1501,11 +1503,8 @@ void ImplTBDragMgr::StartCustomizeMode()
{
mbCustomizeMode = sal_True;
- ToolBox* pBox = mpBoxList->First();
- while ( pBox )
- {
- pBox->ImplStartCustomizeMode();
- pBox = mpBoxList->Next();
+ for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i ) {
+ (*mpBoxList)[ i ]->ImplStartCustomizeMode();
}
}
@@ -1515,11 +1514,8 @@ void ImplTBDragMgr::EndCustomizeMode()
{
mbCustomizeMode = sal_False;
- ToolBox* pBox = mpBoxList->First();
- while ( pBox )
- {
- pBox->ImplEndCustomizeMode();
- pBox = mpBoxList->Next();
+ for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i ) {
+ (*mpBoxList)[ i ]->ImplEndCustomizeMode();
}
}
@@ -1621,7 +1617,6 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle )
mbCustomize = sal_False;
mbCustomizeMode = sal_False;
mbDragging = sal_False;
- mbHideStatusText = sal_False;
mbMenuStrings = sal_False;
mbIsShift = sal_False;
mbIsKeyEvent = sal_False;
@@ -1840,9 +1835,9 @@ ToolBox::~ToolBox()
{
// Wenn im TBDrag-Manager, dann wieder rausnehmen
if ( mbCustomize )
- pSVData->maCtrlData.mpTBDragMgr->Remove( this );
+ pSVData->maCtrlData.mpTBDragMgr->erase( this );
- if ( !pSVData->maCtrlData.mpTBDragMgr->Count() )
+ if ( !pSVData->maCtrlData.mpTBDragMgr->size() )
{
delete pSVData->maCtrlData.mpTBDragMgr;
pSVData->maCtrlData.mpTBDragMgr = NULL;
@@ -3407,6 +3402,54 @@ void ToolBox::ImplDrawNext( sal_Bool bIn )
// -----------------------------------------------------------------------
+void ToolBox::ImplDrawSeparator( sal_uInt16 nPos, Rectangle rRect )
+{
+ bool bNativeOk = false;
+ ImplToolItem* pItem = &mpData->m_aItems[nPos];
+
+ if( IsNativeControlSupported( CTRL_TOOLBAR, PART_SEPARATOR ) )
+ {
+ ImplControlValue aControlValue;
+ ControlState nState = 0;
+ bNativeOk = DrawNativeControl( CTRL_TOOLBAR, PART_SEPARATOR,
+ rRect, nState, aControlValue, rtl::OUString() );
+ }
+
+ /* Draw the widget only if it can't be drawn natively. */
+ if( !bNativeOk )
+ {
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ ImplToolItem* pTempItem = &mpData->m_aItems[nPos-1];
+
+ // no separator before or after windows or at breaks
+ if ( pTempItem && !pTempItem->mbShowWindow && nPos < mpData->m_aItems.size()-1 )
+ {
+ pTempItem = &mpData->m_aItems[nPos+1];
+ if ( !pTempItem->mbShowWindow && !pTempItem->mbBreak )
+ {
+ long nCenterPos, nSlim;
+ SetLineColor( rStyleSettings.GetSeparatorColor() );
+ if ( IsHorizontal() )
+ {
+ nSlim = (pItem->maRect.Bottom() - pItem->maRect.Top ()) / 4;
+ nCenterPos = pItem->maRect.Center().X();
+ DrawLine( Point( nCenterPos, pItem->maRect.Top() + nSlim ),
+ Point( nCenterPos, pItem->maRect.Bottom() - nSlim ) );
+ }
+ else
+ {
+ nSlim = (pItem->maRect.Right() - pItem->maRect.Left ()) / 4;
+ nCenterPos = pItem->maRect.Center().Y();
+ DrawLine( Point( pItem->maRect.Left() + nSlim, nCenterPos ),
+ Point( pItem->maRect.Right() - nSlim, nCenterPos ) );
+ }
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bEnabled, sal_Bool bIsWindow )
{
// draws toolbar button background either native or using a coloured selection
@@ -3468,6 +3511,33 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
if( rStyleSettings.GetFaceColor() == Color( COL_WHITE ) )
bHighContrastWhite = sal_True;
+ // Compute buttons area.
+ Size aBtnSize = pItem->maRect.GetSize();
+ if( ImplGetSVData()->maNWFData.mbToolboxDropDownSeparate )
+ {
+ // separate button not for dropdown only where the whole button is painted
+ if ( pItem->mnBits & TIB_DROPDOWN &&
+ ((pItem->mnBits & TIB_DROPDOWNONLY) != TIB_DROPDOWNONLY) )
+ {
+ Rectangle aArrowRect = pItem->GetDropDownRect( mbHorz );
+ if( aArrowRect.Top() == pItem->maRect.Top() ) // dropdown arrow on right side
+ aBtnSize.Width() -= aArrowRect.GetWidth();
+ else // dropdown arrow on bottom side
+ aBtnSize.Height() -= aArrowRect.GetHeight();
+ }
+ }
+
+ /* Compute the button/separator rectangle here, we'll need it for
+ * both the buttons and the separators. */
+ Rectangle aButtonRect( pItem->maRect.TopLeft(), aBtnSize );
+ long nOffX = SMALLBUTTON_OFF_NORMAL_X;
+ long nOffY = SMALLBUTTON_OFF_NORMAL_Y;
+ long nImageOffX = 0;
+ long nImageOffY = 0;
+ long nTextOffX = 0;
+ long nTextOffY = 0;
+ sal_uInt16 nStyle = 0;
+
// draw separators in flat style only
if ( !bLayout &&
(mnOutStyle & TOOLBOX_STYLE_FLAT) &&
@@ -3475,31 +3545,7 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
nPos > 0
)
{
- // no separator before or after windows or at breaks
- ImplToolItem* pTempItem = &mpData->m_aItems[nPos-1];
- if ( pTempItem && !pTempItem->mbShowWindow && nPos < mpData->m_aItems.size()-1 )
- {
- pTempItem = &mpData->m_aItems[nPos+1];
- if ( !pTempItem->mbShowWindow && !pTempItem->mbBreak )
- {
- long nCenterPos, nSlim;
- SetLineColor( rStyleSettings.GetSeparatorColor() );
- if ( IsHorizontal() )
- {
- nSlim = (pItem->maRect.Bottom() - pItem->maRect.Top ()) / 4;
- nCenterPos = pItem->maRect.Center().X();
- DrawLine( Point( nCenterPos, pItem->maRect.Top() + nSlim ),
- Point( nCenterPos, pItem->maRect.Bottom() - nSlim ) );
- }
- else
- {
- nSlim = (pItem->maRect.Right() - pItem->maRect.Left ()) / 4;
- nCenterPos = pItem->maRect.Center().Y();
- DrawLine( Point( pItem->maRect.Left() + nSlim, nCenterPos ),
- Point( pItem->maRect.Right() - nSlim, nCenterPos ) );
- }
- }
- }
+ ImplDrawSeparator( nPos, aButtonRect );
}
// do nothing if item is no button or will be displayed as window
@@ -3563,30 +3609,6 @@ void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPain
return;
}
- // draw button
- Size aBtnSize = pItem->maRect.GetSize();
- if( ImplGetSVData()->maNWFData.mbToolboxDropDownSeparate )
- {
- // separate button not for dropdown only where the whole button is painted
- if ( pItem->mnBits & TIB_DROPDOWN &&
- ((pItem->mnBits & TIB_DROPDOWNONLY) != TIB_DROPDOWNONLY) )
- {
- Rectangle aArrowRect = pItem->GetDropDownRect( mbHorz );
- if( aArrowRect.Top() == pItem->maRect.Top() ) // dropdown arrow on right side
- aBtnSize.Width() -= aArrowRect.GetWidth();
- else // dropdown arrow on bottom side
- aBtnSize.Height() -= aArrowRect.GetHeight();
- }
- }
- Rectangle aButtonRect( pItem->maRect.TopLeft(), aBtnSize );
- long nOffX = SMALLBUTTON_OFF_NORMAL_X;
- long nOffY = SMALLBUTTON_OFF_NORMAL_Y;
- long nImageOffX=0;
- long nImageOffY=0;
- long nTextOffX=0;
- long nTextOffY=0;
- sal_uInt16 nStyle = 0;
-
if ( pItem->meState == STATE_CHECK )
{
nStyle |= BUTTON_DRAW_CHECKED;
@@ -5398,8 +5420,8 @@ sal_uInt16 ToolBox::ImplCountLineBreaks( const ToolBox *pThis )
while ( it != ((ToolBox*)pThis)->mpData->m_aItems.end() )
{
if( it->meType == TOOLBOXITEM_BREAK )
- nLines++;
- it++;
+ ++nLines;
+ ++it;
}
return nLines;
}
@@ -5410,7 +5432,7 @@ Size ToolBox::CalcPopupWindowSizePixel() const
sal_uInt16 nLines = ImplCountLineBreaks( this );
if( nLines )
- nLines++; // add the first line
+ ++nLines; // add the first line
else
{
// no breaks found: use quadratic layout
@@ -5430,7 +5452,7 @@ Size ToolBox::CalcPopupWindowSizePixel() const
Size ToolBox::CalcFloatingWindowSizePixel() const
{
sal_uInt16 nLines = ImplCountLineBreaks( this );
- nLines++; // add the first line
+ ++nLines; // add the first line
return CalcFloatingWindowSizePixel( nLines );
}
@@ -5471,7 +5493,7 @@ Size ToolBox::CalcMinimumWindowSizePixel() const
pToolBox->CopyItem( *this, it->mnId );
if( (it->meType != TOOLBOXITEM_BUTTON) ||
!it->mbVisible || ImplIsFixedControl( &(*it) ) )
- it++;
+ ++it;
else
break;
}
@@ -5506,9 +5528,9 @@ void ToolBox::EnableCustomize( sal_Bool bEnable )
ImplTBDragMgr* pMgr = ImplGetTBDragMgr();
if ( bEnable )
- pMgr->Insert( this );
+ pMgr->push_back( this );
else
- pMgr->Remove( this );
+ pMgr->erase( this );
}
}
@@ -5914,7 +5936,7 @@ sal_uInt16 ToolBox::ImplGetItemLine( ImplToolItem* pCurrentItem )
while( it != mpData->m_aItems.end() )
{
if ( it->mbBreak )
- nLine++;
+ ++nLine;
if( &(*it) == pCurrentItem)
break;
++it;
@@ -5994,7 +6016,7 @@ sal_uInt16 ToolBox::ImplFindItemPos( const ImplToolItem* pItem, const std::vecto
if( pItem )
{
sal_uInt16 nPos;
- for( nPos = 0; nPos < rList.size(); nPos++ )
+ for( nPos = 0; nPos < rList.size(); ++nPos )
if( &rList[ nPos ] == pItem )
return nPos;
}
@@ -6333,3 +6355,5 @@ void ToolBox::ImplDisableFlatButtons()
mnOutStyle &= ~TOOLBOX_STYLE_FLAT;
#endif
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index c993c9143a2c..37650232fd7f 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <tools/list.hxx>
#include <tools/debug.hxx>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/svdata.hxx>
#include <vcl/svapp.hxx>
#include <vcl/help.hxx>
@@ -50,7 +48,8 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
using namespace vcl;
-using namespace rtl;
+
+using ::rtl::OUString;
// =======================================================================
@@ -504,12 +503,6 @@ void ToolBox::Deactivate()
mnActivateCount--;
ImplCallEventListeners( VCLEVENT_TOOLBOX_DEACTIVATE );
maDeactivateHdl.Call( this );
-
- if ( mbHideStatusText )
- {
- GetpApp()->HideHelpStatusText();
- mbHideStatusText = sal_False;
- }
}
// -----------------------------------------------------------------------
@@ -518,13 +511,6 @@ void ToolBox::Highlight()
{
ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHT );
maHighlightHdl.Call( this );
-
- XubString aStr = GetHelpText( mnCurItemId );
- if ( aStr.Len() || mbHideStatusText )
- {
- GetpApp()->ShowHelpStatusText( aStr );
- mbHideStatusText = sal_True;
- }
}
// -----------------------------------------------------------------------
@@ -2182,7 +2168,7 @@ sal_Bool ToolBox::ImplHasClippedItems()
{
if( it->IsClipped() )
return sal_True;
- it++;
+ ++it;
}
return sal_False;
}
@@ -2375,12 +2361,12 @@ sal_Bool ToolBox::AlwaysLocked()
utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
vcl::unohelper::GetMultiServiceFactory(),
- OUString::createFromAscii( "/org.openoffice.Office.UI.GlobalSettings/Toolbars" ) ); // note: case sensisitive !
+ OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.UI.GlobalSettings/Toolbars")) ); // note: case sensisitive !
if ( aNode.isValid() )
{
// feature enabled ?
sal_Bool bStatesEnabled = sal_Bool();
- ::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString::createFromAscii( "StatesEnabled" ) );
+ ::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString(RTL_CONSTASCII_USTRINGPARAM("StatesEnabled")) );
if( aValue >>= bStatesEnabled )
{
if( bStatesEnabled == sal_True )
@@ -2388,10 +2374,10 @@ sal_Bool ToolBox::AlwaysLocked()
// now read the locking state
utl::OConfigurationNode aNode2 = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
vcl::unohelper::GetMultiServiceFactory(),
- OUString::createFromAscii( "/org.openoffice.Office.UI.GlobalSettings/Toolbars/States" ) ); // note: case sensisitive !
+ OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.UI.GlobalSettings/Toolbars/States")) ); // note: case sensisitive !
sal_Bool bLocked = sal_Bool();
- ::com::sun::star::uno::Any aValue2 = aNode2.getNodeValue( OUString::createFromAscii( "Locked" ) );
+ ::com::sun::star::uno::Any aValue2 = aNode2.getNodeValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Locked")) );
if( aValue2 >>= bLocked )
nAlwaysLocked = (bLocked == sal_True) ? 1 : 0;
}
@@ -2416,11 +2402,9 @@ void ToolBox::ImplUpdateImageList()
{
if (mpData->mpImageListProvider != NULL)
{
- sal_Bool bHC = GetSettings().GetStyleSettings().GetHighContrastMode();
try
{
- ImageListType eType = bHC ? vcl::HIGHCONTRAST_YES : vcl::HIGHCONTRAST_NO;
-
+ ImageListType eType = vcl::HIGHCONTRAST_NO;
if (eType != mpData->meImageListType)
{
vcl::IImageListProvider* pImageListProvider = mpData->mpImageListProvider;
@@ -2438,3 +2422,5 @@ void ToolBox::SetImageListProvider(vcl::IImageListProvider* _pProvider)
ImplUpdateImageList();
}
// -----------------------------------------------------------------------
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 6ddb10c92cd7..f8a182206bad 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,9 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVSYS_HXX
#include "svsys.h"
-#endif
#include "vcl/salframe.hxx"
#include "vcl/salobj.hxx"
#include "vcl/salinst.hxx"
@@ -39,9 +38,7 @@
#include "vcl/unohelp.hxx"
#include "tools/time.hxx"
#include "tools/debug.hxx"
-#ifndef _SV_RC_H
#include "tools/rc.h"
-#endif
#include "vcl/svdata.hxx"
#include "vcl/dbggui.hxx"
#include "vcl/outfont.hxx"
@@ -91,14 +88,13 @@
#include "vcl/dndevdis.hxx"
#include "unotools/confignode.hxx"
#include "vcl/gdimtf.hxx"
-
+#include <sal/macros.h>
#include "vcl/pdfextoutdevdata.hxx"
#include "vcl/lazydelete.hxx"
#include <set>
#include <typeinfo>
-using namespace rtl;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::datatransfer::clipboard;
@@ -106,6 +102,8 @@ using namespace ::com::sun::star::datatransfer::dnd;
using namespace ::com::sun::star;
using namespace com::sun;
+using ::rtl::OUString;
+
using ::com::sun::star::awt::XTopWindow;
// =======================================================================
@@ -305,8 +303,6 @@ bool Window::ImplCheckUIFont( const Font& rFont )
void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl )
{
- // reset high contrast to false, so the system can either update it
- // or AutoDetectSystemHC can kick in (see below)
StyleSettings aTmpSt( rSettings.GetStyleSettings() );
aTmpSt.SetHighContrastMode( sal_False );
rSettings.SetStyleSettings( aTmpSt );
@@ -414,8 +410,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl
};
static std::set< LanguageType > aBrokenSystemFontSizeLanguagesSet(
eBrokenSystemFontSizeLanguages,
- eBrokenSystemFontSizeLanguages +
- (sizeof(eBrokenSystemFontSizeLanguages)/sizeof(eBrokenSystemFontSizeLanguages[0]))
+ eBrokenSystemFontSizeLanguages + SAL_N_ELEMENTS(eBrokenSystemFontSizeLanguages)
);
LanguageType aLang = Application::GetSettings().GetUILanguage();
if( aBrokenSystemFontSizeLanguagesSet.find( aLang ) != aBrokenSystemFontSizeLanguagesSet.end() )
@@ -493,7 +488,6 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl
rSettings.SetStyleSettings( aStyleSettings );
-
// auto detect HC mode; if the system already set it to "yes"
// (see above) then accept that
if( !rSettings.GetStyleSettings().GetHighContrastMode() )
@@ -501,10 +495,10 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl
sal_Bool bTmp = sal_False, bAutoHCMode = sal_True;
utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
vcl::unohelper::GetMultiServiceFactory(),
- OUString::createFromAscii( "org.openoffice.Office.Common/Accessibility" ) ); // note: case sensisitive !
+ OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/Accessibility")) ); // note: case sensisitive !
if ( aNode.isValid() )
{
- ::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString::createFromAscii( "AutoDetectSystemHC" ) );
+ ::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString(RTL_CONSTASCII_USTRINGPARAM("AutoDetectSystemHC")) );
if( aValue >>= bTmp )
bAutoHCMode = bTmp;
}
@@ -515,6 +509,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl
{
aStyleSettings = rSettings.GetStyleSettings();
aStyleSettings.SetHighContrastMode( sal_True );
+ aStyleSettings.SetSymbolsStyle( STYLE_SYMBOLS_HICONTRAST );
rSettings.SetStyleSettings( aStyleSettings );
}
}
@@ -524,6 +519,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl
if( pEnvHC && *pEnvHC )
{
aStyleSettings.SetHighContrastMode( sal_True );
+ aStyleSettings.SetSymbolsStyle( STYLE_SYMBOLS_HICONTRAST );
rSettings.SetStyleSettings( aStyleSettings );
}
@@ -654,10 +650,10 @@ void Window::ImplInitWindowData( WindowType nType )
mpWindowImpl->mbDockWin = sal_False; // sal_True: DockingWindow is the base class
mpWindowImpl->mbFloatWin = sal_False; // sal_True: FloatingWindow is the base class
mpWindowImpl->mbPushButton = sal_False; // sal_True: PushButton is the base class
- mpWindowImpl->mbToolBox = sal_False; // sal_True: ToolBox is the base class
+ mpWindowImpl->mbToolBox = sal_False; // sal_True: ToolBox is the base class
mpWindowImpl->mbMenuFloatingWindow= sal_False; // sal_True: MenuFloatingWindow is the base class
mpWindowImpl->mbToolbarFloatingWindow= sal_False; // sal_True: ImplPopupFloatWin is the base class, used for subtoolbars
- mpWindowImpl->mbSplitter = sal_False; // sal_True: Splitter is the base class
+ mpWindowImpl->mbSplitter = sal_False; // sal_True: Splitter is the base class
mpWindowImpl->mbVisible = sal_False; // sal_True: Show( sal_True ) called
mpWindowImpl->mbOverlapVisible = sal_False; // sal_True: Hide called for visible window from ImplHideAllOverlapWindow()
mpWindowImpl->mbDisabled = sal_False; // sal_True: Enable( sal_False ) called
@@ -1306,7 +1302,10 @@ void Window::ImplLoadRes( const ResId& rResId )
if ( nObjMask & WINDOW_QUICKTEXT )
SetQuickHelpText( ReadStringRes() );
if ( nObjMask & WINDOW_EXTRALONG )
- SetData( (void*)ReadLongRes() );
+ {
+ sal_uIntPtr nRes = ReadLongRes();
+ SetData( (void*)nRes );
+ }
if ( nObjMask & WINDOW_UNIQUEID )
SetUniqueId( ReadByteStringRes() );
@@ -1563,7 +1562,6 @@ void Window::ImplResetReallyVisible()
// the SHOW/HIDE events serve as indicators to send child creation/destroy events to the access bridge.
// For this, the data member of the event must not be NULL.
// Previously, we did this in Window::Show, but there some events got lost in certain situations.
- // #104887# - 2004-08-10 - fs@openoffice.org
if( bBecameReallyInvisible && ImplIsAccessibleCandidate() )
ImplCallEventListeners( VCLEVENT_WINDOW_HIDE, this );
// TODO. It's kind of a hack that we're re-using the VCLEVENT_WINDOW_HIDE. Normally, we should
@@ -1606,7 +1604,6 @@ void Window::ImplSetReallyVisible()
// For this, the data member of the event must not be NULL.
// Previously, we did this in Window::Show, but there some events got lost in certain situations. Now
// we're doing it when the visibility really changes
- // #104887# - 2004-08-10 - fs@openoffice.org
if( bBecameReallyVisible && ImplIsAccessibleCandidate() )
ImplCallEventListeners( VCLEVENT_WINDOW_SHOW, this );
// TODO. It's kind of a hack that we're re-using the VCLEVENT_WINDOW_SHOW. Normally, we should
@@ -1775,7 +1772,7 @@ sal_Bool Window::ImplSysObjClip( const Region* pOldRegion )
if ( mpWindowImpl->mpSysObj )
{
- sal_Bool bVisibleState = mpWindowImpl->mbReallyVisible;
+ bool bVisibleState = mpWindowImpl->mbReallyVisible;
if ( bVisibleState )
{
@@ -3121,7 +3118,7 @@ void Window::ImplUpdateWindowPtr()
void Window::ImplUpdateOverlapWindowPtr( sal_Bool bNewFrame )
{
sal_Bool bVisible = IsVisible();
- Show( sal_False );
+ Show( false );
ImplRemoveWindow( bNewFrame );
Window* pRealParent = mpWindowImpl->mpRealParent;
ImplInsertWindow( ImplGetParent() );
@@ -3142,7 +3139,7 @@ void Window::ImplUpdateOverlapWindowPtr( sal_Bool bNewFrame )
}
if ( bVisible )
- Show( sal_True );
+ Show( true );
}
// -----------------------------------------------------------------------
@@ -3199,7 +3196,6 @@ void Window::ImplPosSizeWindow( long nX, long nY,
{
sal_Bool bNewPos = sal_False;
sal_Bool bNewSize = sal_False;
- sal_Bool bNewWidth = sal_False;
sal_Bool bCopyBits = sal_False;
long nOldOutOffX = mnOutOffX;
long nOldOutOffY = mnOutOffY;
@@ -3242,7 +3238,6 @@ void Window::ImplPosSizeWindow( long nX, long nY,
mnOutWidth = nWidth;
bNewSize = sal_True;
bCopyBits = sal_False;
- bNewWidth = sal_True;
}
}
if ( nFlags & WINDOW_POSSIZE_HEIGHT )
@@ -3769,7 +3764,7 @@ void Window::ImplShowAllOverlaps()
{
if ( pOverlapWindow->mpWindowImpl->mbOverlapVisible )
{
- pOverlapWindow->Show( sal_True, SHOW_NOACTIVATE );
+ pOverlapWindow->Show( true, SHOW_NOACTIVATE );
pOverlapWindow->mpWindowImpl->mbOverlapVisible = sal_False;
}
@@ -3787,7 +3782,7 @@ void Window::ImplHideAllOverlaps()
if ( pOverlapWindow->IsVisible() )
{
pOverlapWindow->mpWindowImpl->mbOverlapVisible = sal_True;
- pOverlapWindow->Show( sal_False );
+ pOverlapWindow->Show( false );
}
pOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext;
@@ -4097,110 +4092,7 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags )
pNewRealWindow->Activate();
}
}
-/*
- // call Deactivate and Activate
- Window* pDeactivateParent;
- Window* pActivateParent;
- Window* pParent;
- Window* pLastParent;
- pDeactivateParent = pOldFocusWindow;
- while ( pDeactivateParent )
- {
- pParent = pDeactivateParent;
- if ( pParent->ImplIsChild( this ) )
- break;
- if ( pDeactivateParent->ImplIsOverlapWindow() )
- {
- if ( !pDeactivateParent->mpWindowImpl->mbParentActive )
- break;
- }
-
- pDeactivateParent = pDeactivateParent->ImplGetParent();
- }
- if ( pOldFocusWindow )
- {
- pActivateParent = this;
- while ( pActivateParent )
- {
- pParent = pActivateParent;
- if ( pParent->ImplIsChild( pOldFocusWindow ) )
- break;
-
- if ( pActivateParent->ImplIsOverlapWindow() )
- {
- if ( !pActivateParent->mpWindowImpl->mbParentActive )
- break;
- }
-
- pActivateParent = pActivateParent->ImplGetParent();
- }
- }
- else
- {
- if ( ImplIsOverlapWindow() )
- pActivateParent = this;
- else
- pActivateParent = mpWindowImpl->mpOverlapWindow;
- while ( pActivateParent )
- {
- if ( pActivateParent->ImplIsOverlapWindow() )
- {
- if ( !pActivateParent->mpWindowImpl->mbParentActive )
- break;
- }
-
- pActivateParent = pActivateParent->ImplGetParent();
- }
- }
- if ( pDeactivateParent )
- {
- do
- {
- pLastParent = pOldFocusWindow;
- if ( pLastParent != pDeactivateParent )
- {
- pParent = pLastParent->ImplGetParent();
- while ( pParent )
- {
- if ( pParent == pDeactivateParent )
- break;
- pLastParent = pParent;
- pParent = pParent->ImplGetParent();
- }
- }
- else
- pParent = pLastParent;
-
- pParent->mpWindowImpl->mbActive = sal_False;
- pParent->Deactivate();
- pDeactivateParent = pLastParent;
- }
- while ( pDeactivateParent != pOldFocusWindow );
- }
- do
- {
- pLastParent = this;
- if ( pLastParent != pActivateParent )
- {
- pParent = pLastParent->ImplGetParent();
- while ( pParent )
- {
- if ( pParent == pActivateParent )
- break;
- pLastParent = pParent;
- pParent = pParent->ImplGetParent();
- }
- }
- else
- pParent = pLastParent;
-
- pParent->mpWindowImpl->mbActive = sal_True;
- pParent->Activate();
- pActivateParent = pLastParent;
- }
- while ( pActivateParent != this );
-*/
// call Get- and LoseFocus
if ( pOldFocusWindow && ! aOldFocusDel.IsDelete() )
{
@@ -4795,12 +4687,22 @@ void Window::doLazyDelete()
DockingWindow* pDockWin = dynamic_cast<DockingWindow*>(this);
if( pSysWin || ( pDockWin && pDockWin->IsFloatingMode() ) )
{
- Show( sal_False );
+ Show( false );
SetParent( ImplGetDefaultWindow() );
}
vcl::LazyDeletor<Window>::Delete( this );
}
+sal_uInt16 Window::GetIndicatorState() const
+{
+ return mpWindowImpl->mpFrame->GetIndicatorState().mnState;
+}
+
+void Window::SimulateKeyPress( sal_uInt16 nKeyCode ) const
+{
+ mpWindowImpl->mpFrame->SimulateKeyPress(nKeyCode);
+}
+
// -----------------------------------------------------------------------
void Window::InterceptChildWindowKeyDown( sal_Bool bIntercept )
{
@@ -5209,48 +5111,6 @@ long Window::PreNotify( NotifyEvent& rNEvt )
// #82968# mouse and key events will be notified after processing ( in ImplNotifyKeyMouseCommandEventListeners() )!
// see also ImplHandleMouseEvent(), ImplHandleKey()
- /*
- else if( rNEvt.GetType() == EVENT_MOUSEMOVE )
- {
- if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
- {
- if ( rNEvt.GetWindow() == this )
- ImplCallEventListeners( VCLEVENT_WINDOW_MOUSEMOVE, (void*)rNEvt.GetMouseEvent() );
- else
- ImplCallEventListeners( VCLEVENT_WINDOW_MOUSEMOVE, &ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this ) );
- }
- }
- else if( rNEvt.GetType() == EVENT_MOUSEBUTTONUP )
- {
- if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
- {
- if ( rNEvt.GetWindow() == this )
- ImplCallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONUP, (void*)rNEvt.GetMouseEvent() );
- else
- ImplCallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONUP, &ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this ) );
- }
- }
- else if( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN )
- {
- if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
- {
- if ( rNEvt.GetWindow() == this )
- ImplCallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, (void*)rNEvt.GetMouseEvent() );
- else
- ImplCallEventListeners( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, &ImplTranslateMouseEvent( *rNEvt.GetMouseEvent(), rNEvt.GetWindow(), this ) );
- }
- }
- else if( rNEvt.GetType() == EVENT_KEYINPUT )
- {
- if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
- ImplCallEventListeners( VCLEVENT_WINDOW_KEYINPUT, (void*)rNEvt.GetKeyEvent() );
- }
- else if( rNEvt.GetType() == EVENT_KEYUP )
- {
- if ( mpWindowImpl->mbCompoundControl || ( rNEvt.GetWindow() == this ) )
- ImplCallEventListeners( VCLEVENT_WINDOW_KEYUP, (void*)rNEvt.GetKeyEvent() );
- }
- */
}
return bDone;
@@ -5396,8 +5256,7 @@ void Window::CallEventListeners( sal_uLong nEvent, void* pData )
if ( aDelData.IsDelete() )
return;
- if ( !mpWindowImpl->maEventListeners.empty() )
- mpWindowImpl->maEventListeners.Call( &aEvent );
+ mpWindowImpl->maEventListeners.Call( &aEvent );
if ( aDelData.IsDelete() )
return;
@@ -5409,8 +5268,7 @@ void Window::CallEventListeners( sal_uLong nEvent, void* pData )
{
pWindow->ImplAddDel( &aDelData );
- if ( !pWindow->mpWindowImpl->maChildEventListeners.empty() )
- pWindow->mpWindowImpl->maChildEventListeners.Call( &aEvent );
+ pWindow->mpWindowImpl->maChildEventListeners.Call( &aEvent );
if ( aDelData.IsDelete() )
return;
@@ -5430,28 +5288,28 @@ void Window::FireVclEvent( VclSimpleEvent* pEvent )
void Window::AddEventListener( const Link& rEventListener )
{
- mpWindowImpl->maEventListeners.push_back( rEventListener );
+ mpWindowImpl->maEventListeners.addListener( rEventListener );
}
// -----------------------------------------------------------------------
void Window::RemoveEventListener( const Link& rEventListener )
{
- mpWindowImpl->maEventListeners.remove( rEventListener );
+ mpWindowImpl->maEventListeners.removeListener( rEventListener );
}
// -----------------------------------------------------------------------
void Window::AddChildEventListener( const Link& rEventListener )
{
- mpWindowImpl->maChildEventListeners.push_back( rEventListener );
+ mpWindowImpl->maChildEventListeners.addListener( rEventListener );
}
// -----------------------------------------------------------------------
void Window::RemoveChildEventListener( const Link& rEventListener )
{
- mpWindowImpl->maChildEventListeners.remove( rEventListener );
+ mpWindowImpl->maChildEventListeners.removeListener( rEventListener );
}
// -----------------------------------------------------------------------
@@ -5984,17 +5842,6 @@ Font Window::GetPointFont() const
// -----------------------------------------------------------------------
-// TODO: remove in next incompatible build
-void Window::GetFontResolution( sal_Int32& nDPIX, sal_Int32& nDPIY ) const
-{
- DBG_CHKTHIS( Window, ImplDbgCheckWindow );
-
- nDPIX = mpWindowImpl->mpFrameData->mnDPIX;
- nDPIY = mpWindowImpl->mpFrameData->mnDPIY;
-}
-
-// -----------------------------------------------------------------------
-
void Window::SetParentClipMode( sal_uInt16 nMode )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -6104,8 +5951,6 @@ void Window::SetWindowRegionPixel( const Region& rRegion )
}
else
{
- sal_Bool bInvalidate = sal_False;
-
if ( rRegion.GetType() == REGION_NULL )
{
if ( mpWindowImpl->mbWinRegion )
@@ -6113,7 +5958,6 @@ void Window::SetWindowRegionPixel( const Region& rRegion )
mpWindowImpl->maWinRegion = Region( REGION_NULL );
mpWindowImpl->mbWinRegion = sal_False;
ImplSetClipFlag();
- bInvalidate = sal_True;
}
}
else
@@ -6121,7 +5965,6 @@ void Window::SetWindowRegionPixel( const Region& rRegion )
mpWindowImpl->maWinRegion = rRegion;
mpWindowImpl->mbWinRegion = sal_True;
ImplSetClipFlag();
- bInvalidate = sal_True;
}
if ( IsReallyVisible() )
@@ -6306,7 +6149,7 @@ void Window::SetParent( Window* pNewParent )
mpWindowImpl->mpFrame->SetParent( pNewParent->mpWindowImpl->mpFrame );
sal_Bool bVisible = IsVisible();
- Show( sal_False, SHOW_NOFOCUSCHANGE );
+ Show( false, SHOW_NOFOCUSCHANGE );
// Testen, ob sich das Overlap-Window aendert
Window* pOldOverlapWindow;
@@ -6422,7 +6265,7 @@ void Window::SetParent( Window* pNewParent )
ImplGetOwnerDrawList().push_back( this );
if ( bVisible )
- Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
}
// -----------------------------------------------------------------------
@@ -6447,10 +6290,10 @@ void Window::Show( sal_Bool bVisible, sal_uInt16 nFlags )
if ( mpWindowImpl->mpBorderWindow )
{
- sal_Bool bOldUpdate = mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate;
+ bool bOldUpdate = mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate;
if ( mpWindowImpl->mbNoParentUpdate )
mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = sal_True;
- mpWindowImpl->mpBorderWindow->Show( sal_False, nFlags );
+ mpWindowImpl->mpBorderWindow->Show( false, nFlags );
mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = bOldUpdate;
}
else if ( mpWindowImpl->mbFrame )
@@ -6588,13 +6431,22 @@ void Window::Show( sal_Bool bVisible, sal_uInt16 nFlags )
}
if ( mpWindowImpl->mpBorderWindow )
- mpWindowImpl->mpBorderWindow->Show( sal_True, nFlags );
+ mpWindowImpl->mpBorderWindow->Show( true, nFlags );
else if ( mpWindowImpl->mbFrame )
{
- ImplSVData* pSVData = ImplGetSVData();
// #106431#, hide SplashScreen
- if( pSVData->mpIntroWindow && !ImplIsWindowOrChild( pSVData->mpIntroWindow ) )
+ ImplSVData* pSVData = ImplGetSVData();
+ if ( !pSVData->mpIntroWindow )
+ {
+ // The right way would be just to call this (not even in the 'if')
+ GetpApp()->InitFinished();
+ }
+ else if ( !ImplIsWindowOrChild( pSVData->mpIntroWindow ) )
+ {
+ // ... but the VCL splash is broken, and it needs this
+ // (for ./soffice slot:5500)
pSVData->mpIntroWindow->Hide();
+ }
//DBG_ASSERT( !mpWindowImpl->mbSuppressAccessibilityEvents, "Window::Show() - Frame reactivated");
mpWindowImpl->mbSuppressAccessibilityEvents = sal_False;
@@ -8560,22 +8412,22 @@ uno::Reference< XDragSource > Window::GetDragSource()
Sequence< Any > aDragSourceAL( 2 ), aDropTargetAL( 2 );
OUString aDragSourceSN, aDropTargetSN;
#if defined WNT
- aDragSourceSN = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.OleDragSource" );
- aDropTargetSN = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.OleDropTarget" );
+ aDragSourceSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.OleDragSource"));
+ aDropTargetSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.OleDropTarget"));
aDragSourceAL[ 1 ] = makeAny( (sal_uInt32) pEnvData->hWnd );
aDropTargetAL[ 0 ] = makeAny( (sal_uInt32) pEnvData->hWnd );
#elif defined QUARTZ
/* FIXME: Mac OS X specific dnd interface does not exist! *
* Using Windows based dnd as a temporary solution */
- aDragSourceSN = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.OleDragSource" );
- aDropTargetSN = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.OleDropTarget" );
+ aDragSourceSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.OleDragSource"));
+ aDropTargetSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.OleDropTarget"));
aDragSourceAL[ 1 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) );
aDropTargetAL[ 0 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) );
#elif defined UNX
aDropTargetAL.realloc( 3 );
aDragSourceAL.realloc( 3 );
- aDragSourceSN = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.X11DragSource" );
- aDropTargetSN = OUString::createFromAscii( "com.sun.star.datatransfer.dnd.X11DropTarget" );
+ aDragSourceSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.X11DragSource"));
+ aDropTargetSN = OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.dnd.X11DropTarget"));
aDragSourceAL[ 0 ] = makeAny( Application::GetDisplayConnection() );
aDragSourceAL[ 2 ] = makeAny( vcl::createBmpConverter() );
@@ -8648,10 +8500,10 @@ uno::Reference< XClipboard > Window::GetClipboard()
if( xFactory.is() )
{
- mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboardExt" ) ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboardExt")) ), UNO_QUERY );
if( !mpWindowImpl->mpFrameData->mxClipboard.is() )
- mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboard" ) ), UNO_QUERY );
+ mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard")) ), UNO_QUERY );
#if defined(UNX) && !defined(QUARTZ) // unix clipboard needs to be initialized
if( mpWindowImpl->mpFrameData->mxClipboard.is() )
@@ -8662,7 +8514,7 @@ uno::Reference< XClipboard > Window::GetClipboard()
{
Sequence< Any > aArgumentList( 3 );
aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() );
- aArgumentList[ 1 ] = makeAny( OUString::createFromAscii( "CLIPBOARD" ) );
+ aArgumentList[ 1 ] = makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("CLIPBOARD")) );
aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() );
xInit->initialize( aArgumentList );
@@ -8705,22 +8557,22 @@ uno::Reference< XClipboard > Window::GetPrimarySelection()
#if defined(UNX) && !defined(QUARTZ)
Sequence< Any > aArgumentList( 3 );
aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() );
- aArgumentList[ 1 ] = makeAny( OUString::createFromAscii( "PRIMARY" ) );
+ aArgumentList[ 1 ] = makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("PRIMARY")) );
aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() );
mpWindowImpl->mpFrameData->mxSelection = uno::Reference< XClipboard >( xFactory->createInstanceWithArguments(
- OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.SystemClipboard" ), aArgumentList ), UNO_QUERY );
-# else
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard")), aArgumentList ), UNO_QUERY );
+# else
static uno::Reference< XClipboard > s_xSelection;
if ( !s_xSelection.is() )
- s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.GenericClipboardExt" ) ), UNO_QUERY );
+ s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboardExt")) ), UNO_QUERY );
if ( !s_xSelection.is() )
- s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.clipboard.GenericClipboard" ) ), UNO_QUERY );
+ s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboard")) ), UNO_QUERY );
mpWindowImpl->mpFrameData->mxSelection = s_xSelection;
-# endif
+# endif
}
}
@@ -9959,9 +9811,6 @@ void Window::PaintToDevice( OutputDevice* pDev, const Point& rPos, const Size& /
DBG_ASSERT( ! pDev->ImplHasMirroredGraphics(), "PaintToDevice to mirroring graphics" );
DBG_ASSERT( ! pDev->IsRTLEnabled(), "PaintToDevice to mirroring device" );
-
- Point aPos = pDev->LogicToPixel( rPos );
-
Window* pRealParent = NULL;
if( ! mpWindowImpl->mbVisible )
{
@@ -9999,3 +9848,4 @@ Selection Window::GetSurroundingTextSelection() const
return Selection( 0, 0 );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 669fce05a791..e98d51d252c9 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#include "precompiled_vcl.hxx"
#include <limits.h>
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/salbmp.hxx>
#include <vcl/salgdi.hxx>
#include <vcl/salframe.hxx>
@@ -49,9 +48,7 @@
#include <vcl/window.h>
#include <vcl/window.hxx>
#include <vcl/scrbar.hxx>
-#ifndef _SV_SCRWND_HXX
#include <scrwnd.hxx>
-#endif
#include <vcl/dockwin.hxx>
@@ -345,14 +342,6 @@ Bitmap Window::SnapShot( sal_Bool bBorder ) const
// -----------------------------------------------------------------------
-Bitmap Window::SnapShot() const
-{
- // Should be merged in the next top level build !!!
- return SnapShot( sal_True );
-}
-
-// -----------------------------------------------------------------------
-
void Window::ShowFocus( const Rectangle& rRect )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
@@ -1309,110 +1298,6 @@ void Window::ImplHandleScroll( ScrollBar* pHScrl, long nX,
}
}
-// support for docking
-// this is currently handled in ImplDockingWindowWrapper
-/*
-void Window::ImplSetFloatingMode( sal_Bool bFloatMode )
-{
- // if the window is docked, put it into a flaoting window
- // if it is floating put it back in the old frame
-
- ImplDockingWindowWrapper *pWrapper = pDockingMgr->GetDockingWindowWrapper( this );
- if( !pDockingData )
- return;
-
- if ( pWrapper->IsFloatingMode() != bFloatMode )
- {
- if ( pWrapper->PrepareToggleFloatingMode() )
- {
- sal_Bool bVisible = IsVisible();
-
- if ( bFloatMode )
- {
- Show( sal_False, SHOW_NOFOCUSCHANGE );
-
- pWrapper->maDockPos = GetPosPixel();
-
- Window* pRealParent = mpWindowImpl->mpRealParent;
- pWrapper->mpOldBorderWin = mpWindowImpl->mpBorderWindow;
-
- ImplDockFloatWin* pWin =
- new ImplDockFloatWin2(
- mpWindowImpl->mpParent,
- mnFloatBits & ( WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE ) ? mnFloatBits | WB_SYSTEMWINDOW : mnFloatBits,
- pWrapper );
- pWrapper->mpFloatWin = pWin;
- mpWindowImpl->mpBorderWindow = NULL;
- mpWindowImpl->mnLeftBorder = 0;
- mpWindowImpl->mnTopBorder = 0;
- mpWindowImpl->mnRightBorder = 0;
- mpWindowImpl->mnBottomBorder = 0;
- // Falls Parent zerstoert wird, muessen wir auch vom
- // BorderWindow den Parent umsetzen
- if ( pWrapper->mpOldBorderWin )
- pWrapper->mpOldBorderWin->SetParent( pWin );
- SetParent( pWin );
- pWin->SetPosPixel( Point() );
- mpWindowImpl->mpBorderWindow = pWin;
- pWin->mpWindowImpl->mpClientWindow = this;
- mpWindowImpl->mpRealParent = pRealParent;
- pWin->SetText( GetText() );
- pWin->SetOutputSizePixel( GetSizePixel() );
- pWin->SetPosPixel( pWrapper->maFloatPos );
- // DockingDaten ans FloatingWindow weiterreichen
- pWin->ShowTitleButton( TITLE_BUTTON_DOCKING, pWrapper->mbDockBtn );
- pWin->ShowTitleButton( TITLE_BUTTON_HIDE, pWrapper->mbHideBtn );
- pWin->SetPin( pWrapper->mbPined );
- if ( pWrapper->mbRollUp )
- pWin->RollUp();
- else
- pWin->RollDown();
- pWin->SetRollUpOutputSizePixel( pWrapper->maRollUpOutSize );
- pWin->SetMinOutputSizePixel( pWrapper->maMinOutSize );
-
- pWrapper->ToggleFloatingMode();
-
- if ( bVisible )
- Show();
- }
- else
- {
- Show( sal_False, SHOW_NOFOCUSCHANGE );
-
- // FloatingDaten wird im FloatingWindow speichern
- pWrapper->maFloatPos = mpFloatWin->GetPosPixel();
- pWrapper->mbDockBtn = mpFloatWin->IsTitleButtonVisible( TITLE_BUTTON_DOCKING );
- pWrapper->mbHideBtn = mpFloatWin->IsTitleButtonVisible( TITLE_BUTTON_HIDE );
- pWrapper->mbPined = mpFloatWin->IsPined();
- pWrapper->mbRollUp = mpFloatWin->IsRollUp();
- pWrapper->maRollUpOutSize = mpFloatWin->GetRollUpOutputSizePixel();
- pWrapper->maMinOutSize = mpFloatWin->GetMinOutputSizePixel();
-
- Window* pRealParent = mpWindowImpl->mpRealParent;
- mpWindowImpl->mpBorderWindow = NULL;
- if ( pWrapper->mpOldBorderWin )
- {
- SetParent( pWrapper->mpOldBorderWin );
- ((ImplBorderWindow*)pWrapper->mpOldBorderWin)->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder );
- pWrapper->mpOldBorderWin->Resize();
- }
- mpWindowImpl->mpBorderWindow = pWrapper->mpOldBorderWin;
- SetParent( pRealParent );
- mpWindowImpl->mpRealParent = pRealParent;
- delete static_cast<ImplDockFloatWin*>(mpFloatWin);
- pWrapper->mpFloatWin = NULL;
- SetPosPixel( maDockPos );
-
- pWrapper->ToggleFloatingMode();
-
- if ( bVisible )
- Show();
- }
- }
- }
-}
-*/
-
DockingManager* Window::GetDockingManager()
{
return ImplGetDockingManager();
@@ -1979,3 +1864,4 @@ void Window::SetOutputSizePixel( const Size& rNewSize )
rNewSize.Height()+mpWindowImpl->mnTopBorder+mpWindowImpl->mnBottomBorder ) );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/window3.cxx b/vcl/source/window/window3.cxx
index 65019ba2a4af..f35e85e89464 100644
--- a/vcl/source/window/window3.cxx
+++ b/vcl/source/window/window3.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,3 +81,5 @@ void Window::ImplAdjustNWFSizes()
break;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 9cb38756e770..3e4de2648c99 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,15 +29,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/salwtype.hxx>
#include <vcl/salframe.hxx>
#include <tools/debug.hxx>
-#ifndef _INTN_HXX
-//#include <tools/intn.hxx>
-#endif
#include <vcl/i18nhelp.hxx>
#include <vcl/unohelp.hxx>
#include <unotools/localedatawrapper.hxx>
@@ -2615,3 +2611,5 @@ long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
return nRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx
index 81c2b36345eb..38d78fbc9723 100644
--- a/vcl/source/window/wrkwin.cxx
+++ b/vcl/source/window/wrkwin.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,21 +29,19 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#ifndef _SV_SVSYS_HXX
#include <svsys.h>
-#endif
#include <vcl/salframe.hxx>
#include <tools/debug.hxx>
-#ifndef _SV_RC_H
#include <tools/rc.h>
-#endif
#include <vcl/svdata.hxx>
#include <vcl/svapp.hxx>
#include <vcl/brdwin.hxx>
#include <vcl/window.h>
#include <vcl/wrkwin.hxx>
#include <vcl/sysdata.hxx>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/rendering/XCanvas.hpp>
// =======================================================================
@@ -192,6 +191,18 @@ void WorkWindow::ShowFullScreenMode( sal_Bool bFullScreenMode, sal_Int32 nDispla
mbFullScreenMode = bFullScreenMode != 0;
if ( !mbSysChild )
{
+ // Dispose of the canvas implementation, which might rely on
+ // screen-specific system data.
+ com::sun::star::uno::Reference< com::sun::star::rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas );
+ if( xCanvas.is() )
+ {
+ com::sun::star::uno::Reference< com::sun::star::lang::XComponent >
+ xCanvasComponent( xCanvas,
+ com::sun::star::uno::UNO_QUERY );
+ if( xCanvasComponent.is() )
+ xCanvasComponent->dispose();
+ }
+
mpWindowImpl->mpFrameWindow->mpWindowImpl->mbWaitSystemResize = sal_True;
ImplGetFrame()->ShowFullScreen( bFullScreenMode, nDisplay );
}
@@ -321,3 +332,5 @@ sal_Bool WorkWindow::IsMaximized() const
}
return bRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */