summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/vcl/btndlg.hxx4
-rw-r--r--vcl/inc/vcl/help.hxx11
-rw-r--r--vcl/inc/vcl/menu.hxx4
-rwxr-xr-xvcl/inc/vcl/smartid.hxx87
-rw-r--r--vcl/inc/vcl/status.hxx10
-rw-r--r--vcl/inc/vcl/tabctrl.hxx11
-rw-r--r--vcl/inc/vcl/toolbox.h2
-rw-r--r--vcl/inc/vcl/toolbox.hxx10
-rw-r--r--vcl/inc/vcl/window.h8
-rw-r--r--vcl/inc/vcl/window.hxx15
-rw-r--r--vcl/prj/d.lst1
-rw-r--r--vcl/source/app/help.cxx13
-rw-r--r--[-rwxr-xr-x]vcl/source/app/settings.cxx0
-rw-r--r--vcl/source/control/tabctrl.cxx47
-rw-r--r--vcl/source/helper/makefile.mk1
-rwxr-xr-xvcl/source/helper/smartid.cxx264
-rw-r--r--vcl/source/src/print.src28
-rw-r--r--vcl/source/window/btndlg.cxx11
-rw-r--r--vcl/source/window/menu.cxx46
-rw-r--r--vcl/source/window/msgbox.cxx7
-rw-r--r--vcl/source/window/printdlg.cxx24
-rw-r--r--vcl/source/window/status.cxx36
-rw-r--r--vcl/source/window/toolbox.cxx14
-rw-r--r--vcl/source/window/toolbox2.cxx29
-rw-r--r--vcl/source/window/window.cxx87
-rw-r--r--vcl/source/window/window2.cxx104
-rw-r--r--vcl/unx/source/fontmanager/fontconfig.cxx43
27 files changed, 236 insertions, 681 deletions
diff --git a/vcl/inc/vcl/btndlg.hxx b/vcl/inc/vcl/btndlg.hxx
index dbeb8350a0d4..3186ba5f6399 100644
--- a/vcl/inc/vcl/btndlg.hxx
+++ b/vcl/inc/vcl/btndlg.hxx
@@ -104,8 +104,8 @@ public:
XubString GetButtonText( USHORT nId ) const;
void SetButtonHelpText( USHORT nId, const XubString& rText );
XubString GetButtonHelpText( USHORT nId ) const;
- void SetButtonHelpId( USHORT nId, ULONG nHelpId );
- ULONG GetButtonHelpId( USHORT nId ) const;
+ void SetButtonHelpId( USHORT nId, const rtl::OString& rHelpId );
+ rtl::OString GetButtonHelpId( USHORT nId ) const;
void SetFocusButton( USHORT nId = BUTTONDIALOG_BUTTON_NOTFOUND ) { mnFocusButtonId = nId; }
USHORT GetFocusButton() const { return mnFocusButtonId; }
diff --git a/vcl/inc/vcl/help.hxx b/vcl/inc/vcl/help.hxx
index 30308aa8a723..1f4ba36d8f43 100644
--- a/vcl/inc/vcl/help.hxx
+++ b/vcl/inc/vcl/help.hxx
@@ -52,8 +52,8 @@ class Window;
#define QUICKHELP_BIDI_RTL ((USHORT)0x8000)
// By changes you must also change: rsc/vclrsc.hxx
-#define OOO_HELP_INDEX ((ULONG)0xFFFFFFFF)
-#define OOO_HELP_HELPONHELP ((ULONG)0xFFFFFFFE)
+#define OOO_HELP_INDEX ".help:index"
+#define OOO_HELP_HELPONHELP ".help:helponhelp"
// --------
// - Help -
@@ -71,10 +71,9 @@ public:
void SetHelpFile( const String& rFileName ) { maHelpFile = rFileName; }
const String& GetHelpFile() const { return maHelpFile; }
- virtual BOOL Start( ULONG nHelpId, const Window* pWindow );
- virtual BOOL Start( const XubString& rKeyWord, const Window* pWindow );
- virtual void OpenHelpAgent( ULONG nHelpId );
- virtual XubString GetHelpText( ULONG nHelpId, const Window* pWindow );
+ virtual BOOL Start( const XubString& rHelpId, const Window* pWindow );
+ virtual BOOL SearchKeyword( const XubString& rKeyWord );
+ virtual void OpenHelpAgent( const rtl::OString& rHelpId );
virtual XubString GetHelpText( const String& aHelpURL, const Window* pWindow );
static void EnableContextHelp();
diff --git a/vcl/inc/vcl/menu.hxx b/vcl/inc/vcl/menu.hxx
index 908f3e30319c..d57fdeb7cfd3 100644
--- a/vcl/inc/vcl/menu.hxx
+++ b/vcl/inc/vcl/menu.hxx
@@ -304,8 +304,8 @@ public:
void SetHelpCommand( USHORT nItemId, const XubString& rString );
const XubString& GetHelpCommand( USHORT nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ void SetHelpId( USHORT nItemId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( USHORT nItemId ) const;
void SetActivateHdl( const Link& rLink ) { aActivateHdl = rLink; }
const Link& GetActivateHdl() const { return aActivateHdl; }
diff --git a/vcl/inc/vcl/smartid.hxx b/vcl/inc/vcl/smartid.hxx
deleted file mode 100755
index 2cc5f347b2cb..000000000000
--- a/vcl/inc/vcl/smartid.hxx
+++ /dev/null
@@ -1,87 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SMARTID_HXX_
-#define _SMARTID_HXX_
-
-#include <tools/string.hxx>
-#include <vcl/dllapi.h>
-
-/// SMART_SET_SMART only sets the Ids that are defined in the SmartId
-/// the other types set whatever is given. This can also be used to reset an Id
-enum SmartIdUpdateMode { SMART_SET_SMART, SMART_SET_NUM, SMART_SET_STR, SMART_SET_ALL };
-
-struct ImplSmartIdData;
-
-/*
-
-SmartId is a substitute for Numeric HelpIds. They can handle Numeric and String HelpIds and offer commonly needed operators.
-
-Matching Ids:
-if part of an Id is not set (HasNumeric HasString is False) then this part will never match to anything. Not even unset values
-
-*/
-class VCL_DLLPUBLIC SmartId
-{
-private:
- ImplSmartIdData* mpData;
- SAL_DLLPRIVATE ImplSmartIdData* GetSmartIdData();
-
-public:
- explicit SmartId( const String& rId );
- explicit SmartId( ULONG nId );
- SmartId( const String& rId, ULONG nId );
-
- SmartId();
-
- SmartId( const SmartId& rId );
- SmartId& operator = ( const SmartId& rId );
-
- ~SmartId();
-
- void UpdateId( const SmartId& rId, SmartIdUpdateMode aMode = SMART_SET_SMART );
-
- BOOL HasNumeric() const;
- BOOL HasString() const;
- BOOL HasAny() const;
- ULONG GetNum() const;
- String GetStr() const;
-
- String GetText() const; /// return String for UI usage
-
- BOOL Matches( const String &rId )const;
- BOOL Matches( const ULONG nId ) const;
-/// In case both Ids have both values set only the StringId is used for Matching
- BOOL Matches( const SmartId &rId ) const;
-
- BOOL Equals( const SmartId &rId ) const;
-
- BOOL operator == ( const SmartId& rRight ) const;
- BOOL operator < ( const SmartId& rRight ) const;
-};
-
-#endif
diff --git a/vcl/inc/vcl/status.hxx b/vcl/inc/vcl/status.hxx
index 810ecf230960..907d08272cbb 100644
--- a/vcl/inc/vcl/status.hxx
+++ b/vcl/inc/vcl/status.hxx
@@ -183,8 +183,8 @@ public:
using Window::GetQuickHelpText;
const XubString& GetQuickHelpText( USHORT nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ void SetHelpId( USHORT nItemId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( USHORT nItemId ) const;
void SetBottomBorder( BOOL bBottomBorder = TRUE );
BOOL IsBottomBorder() const { return mbBottomBorder; }
@@ -205,9 +205,9 @@ public:
const XubString& GetHelpText() const
{ return Window::GetHelpText(); }
- void SetHelpId( ULONG nId )
- { Window::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { Window::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return Window::GetHelpId(); }
Size CalcWindowSizePixel() const;
diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx
index 4c63b12f15fe..ad702ac4dc54 100644
--- a/vcl/inc/vcl/tabctrl.hxx
+++ b/vcl/inc/vcl/tabctrl.hxx
@@ -70,7 +70,6 @@ private:
BOOL mbRestoreUnqId;
BOOL mbSingleLine;
BOOL mbScroll;
- BOOL mbRestoreSmartId;
BOOL mbSmallInvalidate;
BOOL mbExtraSpace;
Link maActivateHdl;
@@ -177,8 +176,8 @@ public:
void SetHelpText( USHORT nPageId, const XubString& rText );
const XubString& GetHelpText( USHORT nPageId ) const;
- void SetHelpId( USHORT nPageId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nPageId ) const;
+ void SetHelpId( USHORT nPageId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( USHORT nPageId ) const;
void SetPageImage( USHORT nPageId, const Image& rImage );
const Image* GetPageImage( USHORT nPageId ) const;
@@ -188,9 +187,9 @@ public:
const XubString& GetHelpText() const
{ return Control::GetHelpText(); }
- void SetHelpId( ULONG nId )
- { Control::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { Control::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return Control::GetHelpId(); }
void SetActivatePageHdl( const Link& rLink ) { maActivateHdl = rLink; }
diff --git a/vcl/inc/vcl/toolbox.h b/vcl/inc/vcl/toolbox.h
index 33e4e8d2e013..7cdeb0b17a5a 100644
--- a/vcl/inc/vcl/toolbox.h
+++ b/vcl/inc/vcl/toolbox.h
@@ -68,7 +68,7 @@ struct ImplToolItem
XubString maQuickHelpText;
XubString maHelpText;
String maCommandStr;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
Rectangle maRect;
Rectangle maCalcRect;
// the overall horizontal item size, including one or more of [image size + textlength + dropdown arrow]
diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx
index 5cc102842dc3..aa7ddd886bbb 100644
--- a/vcl/inc/vcl/toolbox.hxx
+++ b/vcl/inc/vcl/toolbox.hxx
@@ -511,8 +511,8 @@ public:
void SetHelpText( USHORT nItemId, const XubString& rText );
const XubString& GetHelpText( USHORT nItemId ) const;
- void SetHelpId( USHORT nItemId, ULONG nHelpId );
- ULONG GetHelpId( USHORT nItemId ) const;
+ void SetHelpId( USHORT nItemId, const rtl::OString& rHelpId );
+ rtl::OString GetHelpId( USHORT nItemId ) const;
// window size according to current alignment, floating state and number of lines
Size CalcWindowSizePixel() const;
@@ -569,9 +569,9 @@ public:
const XubString& GetHelpText() const
{ return DockingWindow::GetHelpText(); }
- void SetHelpId( ULONG nId )
- { DockingWindow::SetHelpId( nId ); }
- ULONG GetHelpId() const
+ void SetHelpId( const rtl::OString& rId )
+ { DockingWindow::SetHelpId( rId ); }
+ const rtl::OString& GetHelpId() const
{ return DockingWindow::GetHelpId(); }
void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
diff --git a/vcl/inc/vcl/window.h b/vcl/inc/vcl/window.h
index 691c3ed18421..ff76874de11a 100644
--- a/vcl/inc/vcl/window.h
+++ b/vcl/inc/vcl/window.h
@@ -56,7 +56,7 @@ class VirtualDevice;
class Cursor;
class ImplDevFontList;
class ImplFontCache;
-class SmartId;
+class SalControlHandle;
class VCLXWindow;
class SalFrame;
class SalObject;
@@ -120,8 +120,6 @@ struct ImplWinData
USHORT mnIsTopWindow;
BOOL mbMouseOver; // tracks mouse over for native widget paint effect
BOOL mbEnableNativeWidget; // toggle native widget rendering
- SmartId* mpSmartHelpId;
- SmartId* mpSmartUniqueId;
::std::list< Window* >
maTopWindowChildren;
};
@@ -254,8 +252,8 @@ public:
long mnY;
long mnAbsScreenX;
Point maPos;
- ULONG mnHelpId;
- ULONG mnUniqId;
+ rtl::OString maHelpId;
+ rtl::OString maUniqId;
XubString maHelpText;
XubString maQuickHelpText;
InputContext maInputContext;
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index 8264767e59ad..7c72f40d2767 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -50,7 +50,6 @@
#include <rtl/ustring.hxx>
#include <cppuhelper/weakref.hxx>
#include <com/sun/star/uno/Reference.hxx>
-#include <vcl/smartid.hxx>
class VirtualDevice;
struct ImplDelData;
@@ -953,16 +952,12 @@ public:
void SetQuickHelpText( const XubString& rHelpText );
const XubString& GetQuickHelpText() const;
- void SetHelpId( ULONG nHelpId ); /// deprecated
- ULONG GetHelpId() const; /// deprecated
- void SetSmartHelpId( const SmartId& aId, SmartIdUpdateMode aMode = SMART_SET_SMART );
- SmartId GetSmartHelpId() const;
+ void SetHelpId( const rtl::OString& );
+ const rtl::OString& GetHelpId() const;
- void SetUniqueId( ULONG nUniqueId ); /// deprecated
- ULONG GetUniqueId() const; /// deprecated
- void SetSmartUniqueId( const SmartId& aId, SmartIdUpdateMode aMode = SMART_SET_SMART );
- SmartId GetSmartUniqueId() const;
- SmartId GetSmartUniqueOrHelpId() const;
+ void SetUniqueId( const rtl::OString& );
+ const rtl::OString& GetUniqueId() const;
+ const rtl::OString& GetUniqueOrHelpId() const;
Window* FindWindow( const Point& rPos ) const;
diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst
index 441bf2e265d5..e28dc755e8a8 100644
--- a/vcl/prj/d.lst
+++ b/vcl/prj/d.lst
@@ -144,7 +144,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\pdfextoutdevdata.hxx %_DEST%\inc%_EXT%\vcl\pdfextoutdevdata.hxx
..\inc\vcl\pngread.hxx %_DEST%\inc%_EXT%\vcl\pngread.hxx
..\inc\vcl\pngwrite.hxx %_DEST%\inc%_EXT%\vcl\pngwrite.hxx
-..\inc\vcl\smartid.hxx %_DEST%\inc%_EXT%\vcl\smartid.hxx
..\inc\vcl\configsettings.hxx %_DEST%\inc%_EXT%\vcl\configsettings.hxx
..\inc\vcl\ImageListProvider.hxx %_DEST%\inc%_EXT%\vcl\ImageListProvider.hxx
..\inc\vcl\fontmanager.hxx %_DEST%\inc%_EXT%\vcl\fontmanager.hxx
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 1f9efa7b6e65..2c7ad2fa9c3e 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -62,12 +62,7 @@ Help::~Help()
// -----------------------------------------------------------------------
-BOOL Help::Start( ULONG, const Window* )
-{
- return FALSE;
-}
-
-void Help::OpenHelpAgent( ULONG )
+void Help::OpenHelpAgent( const rtl::OString& )
{
}
@@ -78,11 +73,9 @@ BOOL Help::Start( const XubString&, const Window* )
return FALSE;
}
-// -----------------------------------------------------------------------
-
-XubString Help::GetHelpText( ULONG, const Window* )
+BOOL Help::SearchKeyword( const XubString& )
{
- return ImplGetSVEmptyStr();
+ return FALSE;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index b91afbbae9fe..b91afbbae9fe 100755..100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index c892b32534ec..e9696aa8c492 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -42,7 +42,6 @@
#include "vcl/controldata.hxx"
#include "vcl/sound.hxx"
#include "vcl/lstbox.hxx"
-#include "vcl/smartid.hxx"
#include "vcl/window.h"
@@ -59,7 +58,7 @@ struct ImplTabItem
String maText;
String maFormatText;
String maHelpText;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
Rectangle maRect;
USHORT mnLine;
bool mbFullVisible;
@@ -67,7 +66,7 @@ struct ImplTabItem
Image maTabImage;
ImplTabItem()
- : mnId( 0 ), mnTabPageResId( 0 ), mpTabPage( NULL ), mnHelpId( 0 ),
+ : mnId( 0 ), mnTabPageResId( 0 ), mpTabPage( NULL ),
mnLine( 0 ), mbFullVisible( FALSE ), mbEnabled( true )
{}
};
@@ -151,7 +150,6 @@ void TabControl::ImplInit( Window* pParent, WinBits nStyle )
mbRestoreUnqId = FALSE;
mbSingleLine = FALSE;
mbScroll = FALSE;
- mbRestoreSmartId = FALSE;
mbSmallInvalidate = FALSE;
mbExtraSpace = FALSE;
mpTabCtrlData = new ImplTabCtrlData;
@@ -705,11 +703,9 @@ void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
if ( pOldPage )
{
if ( mbRestoreHelpId )
- pCtrlParent->SetHelpId( 0 );
+ pCtrlParent->SetHelpId( rtl::OString() );
if ( mbRestoreUnqId )
- pCtrlParent->SetUniqueId( 0 );
- if( mbRestoreSmartId )
- pCtrlParent->SetSmartHelpId( SmartId() );
+ pCtrlParent->SetUniqueId( rtl::OString() );
pOldPage->DeactivatePage();
}
@@ -719,21 +715,16 @@ void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
// activate page here so the conbtrols can be switched
// also set the help id of the parent window to that of the tab page
- if ( !GetHelpId() )
+ if ( !GetHelpId().getLength() )
{
mbRestoreHelpId = TRUE;
pCtrlParent->SetHelpId( pPage->GetHelpId() );
}
- if ( !pCtrlParent->GetUniqueId() )
+ if ( !pCtrlParent->GetUniqueId().getLength() )
{
mbRestoreUnqId = TRUE;
pCtrlParent->SetUniqueId( pPage->GetUniqueId() );
}
- if( ! GetSmartHelpId().HasAny() )
- {
- mbRestoreSmartId = TRUE;
- pCtrlParent->SetSmartHelpId( pPage->GetSmartHelpId() );
- }
pPage->ActivatePage();
@@ -1486,13 +1477,13 @@ void TabControl::RequestHelp( const HelpEvent& rHEvt )
}
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
- ULONG nHelpId = GetHelpId( nItemId );
- if ( nHelpId )
+ rtl::OUString aHelpId( rtl::OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) );
+ if ( aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pHelp->Start( nHelpId, this );
+ pHelp->Start( aHelpId, this );
return;
}
}
@@ -1574,7 +1565,7 @@ void TabControl::Command( const CommandEvent& rCEvt )
aMenu.InsertItem( it->mnId, it->maText, MIB_CHECKABLE | MIB_RADIOCHECK );
if ( it->mnId == mnCurPageId )
aMenu.CheckItem( it->mnId );
- aMenu.SetHelpId( it->mnId, it->mnHelpId );
+ aMenu.SetHelpId( it->mnId, it->maHelpId );
}
USHORT nId = aMenu.Execute( this, aMenuPos );
@@ -1826,7 +1817,6 @@ void TabControl::InsertPage( USHORT nPageId, const XubString& rText,
pItem->mnId = nPageId;
pItem->mpTabPage = NULL;
pItem->mnTabPageResId = 0;
- pItem->mnHelpId = 0;
pItem->maText = rText;
pItem->mbFullVisible = FALSE;
@@ -2154,11 +2144,11 @@ const XubString& TabControl::GetHelpText( USHORT nPageId ) const
if ( pItem )
{
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return pItem->maHelpText;
@@ -2169,24 +2159,25 @@ const XubString& TabControl::GetHelpText( USHORT nPageId ) const
// -----------------------------------------------------------------------
-void TabControl::SetHelpId( USHORT nPageId, ULONG nHelpId )
+void TabControl::SetHelpId( USHORT nPageId, const rtl::OString& rHelpId )
{
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem )
- pItem->mnHelpId = nHelpId;
+ pItem->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG TabControl::GetHelpId( USHORT nPageId ) const
+rtl::OString TabControl::GetHelpId( USHORT nPageId ) const
{
+ rtl::OString aRet;
ImplTabItem* pItem = ImplGetItem( nPageId );
if ( pItem )
- return pItem->mnHelpId;
- else
- return 0;
+ aRet = pItem->maHelpId;
+
+ return aRet;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/helper/makefile.mk b/vcl/source/helper/makefile.mk
index e708bdec9eaa..1a417417dbe4 100644
--- a/vcl/source/helper/makefile.mk
+++ b/vcl/source/helper/makefile.mk
@@ -46,7 +46,6 @@ SLOFILES=\
$(SLO)$/canvastools.obj \
$(SLO)$/xconnection.obj \
$(SLO)$/threadex.obj \
- $(SLO)$/smartid.obj \
$(SLO)$/lazydelete.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/source/helper/smartid.cxx b/vcl/source/helper/smartid.cxx
deleted file mode 100755
index c367aeb2bce5..000000000000
--- a/vcl/source/helper/smartid.cxx
+++ /dev/null
@@ -1,264 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_vcl.hxx"
-#include <vcl/smartid.hxx>
-
-struct ImplSmartIdData
-{
- String aUId;
- ULONG nUId;
- BOOL bHasStringId;
- BOOL bHasNumericId;
-};
-
-
-ImplSmartIdData* SmartId::GetSmartIdData()
-{
- if ( !mpData )
- {
- mpData = new ImplSmartIdData;
-// mpData->aUId = "";
- mpData->nUId = 0;
- mpData->bHasStringId = FALSE;
- mpData->bHasNumericId = FALSE;
- }
- return mpData;
-}
-
-
-SmartId::SmartId( const String& rId )
-: mpData( NULL )
-{
- GetSmartIdData()->aUId = rId;
- GetSmartIdData()->bHasStringId = TRUE;
-}
-
-SmartId::SmartId( ULONG nId )
-: mpData( NULL )
-{
- GetSmartIdData()->nUId = nId;
- GetSmartIdData()->bHasNumericId = TRUE;
-}
-
-SmartId::SmartId( const String& rId, ULONG nId )
-: mpData( NULL )
-{
- GetSmartIdData()->aUId = rId;
- GetSmartIdData()->bHasStringId = TRUE;
- GetSmartIdData()->nUId = nId;
- GetSmartIdData()->bHasNumericId = TRUE;
-}
-
-SmartId::SmartId()
-: mpData( NULL )
-{}
-
-SmartId::SmartId( const SmartId& rId )
-: mpData( NULL )
-{
- if ( rId.mpData )
- {
- GetSmartIdData();
- mpData->aUId = rId.mpData->aUId;
- mpData->bHasStringId = rId.mpData->bHasStringId;
- mpData->nUId = rId.mpData->nUId;
- mpData->bHasNumericId = rId.mpData->bHasNumericId;
- }
-}
-
-SmartId& SmartId::operator = ( const SmartId& rId )
-{
- if ( rId.mpData )
- GetSmartIdData();
- else
- {
- delete mpData;
- mpData = NULL;
- }
- if ( mpData && rId.mpData )
- {
- mpData->aUId = rId.mpData->aUId;
- mpData->bHasStringId = rId.mpData->bHasStringId;
- mpData->nUId = rId.mpData->nUId;
- mpData->bHasNumericId = rId.mpData->bHasNumericId;
- }
- return *this;
-}
-
-SmartId::~SmartId()
-{
- if ( mpData )
- delete mpData;
-#ifdef DBG_UTIL
- if ( mpData )
- mpData = (ImplSmartIdData*)0xDeadBeef;
-#endif
-}
-
-void SmartId::UpdateId( const SmartId& rId, SmartIdUpdateMode aMode )
-{
- // Check if ImplData is needed
- if ( aMode != SMART_SET_SMART || ( rId.HasString() || rId.HasNumeric() ) )
- GetSmartIdData();
-
- if ( aMode == SMART_SET_STR || aMode == SMART_SET_ALL || ( aMode == SMART_SET_SMART && rId.HasString() ) )
- {
- GetSmartIdData()->aUId = rId.GetStr();
- GetSmartIdData()->bHasStringId = rId.HasString();
- }
- if ( aMode == SMART_SET_NUM || aMode == SMART_SET_ALL || ( aMode == SMART_SET_SMART && rId.HasNumeric() ) )
- {
- GetSmartIdData()->nUId = rId.GetNum();
- GetSmartIdData()->bHasNumericId = rId.HasNumeric();
- }
-
- // remove ImplData when no IDs are set. This is Important because Implementation of Equals() Matches and HasAny relies on it
- if ( mpData && !mpData->bHasStringId && !mpData->bHasNumericId )
- {
- delete mpData;
- mpData = NULL;
- }
-}
-
-BOOL SmartId::HasNumeric() const
-{
- if ( !mpData )
- return FALSE;
- else
- return mpData->bHasNumericId;
-}
-
-BOOL SmartId::HasString() const
-{
- if ( !mpData )
- return FALSE;
- else
- return mpData->bHasStringId;
-}
-
-BOOL SmartId::HasAny() const
-{
- return mpData != NULL;
-}
-
-ULONG SmartId::GetNum() const
-{
- if ( !mpData )
- return 0;
- else
- return mpData->nUId;
-}
-
-String SmartId::GetStr() const
-{
- if ( !mpData )
- return String();
- else
- return mpData->aUId;
-}
-
-
-String SmartId::GetText() const // return String for UI usage
-{
- String aRes;
- if ( HasNumeric() )
- aRes = String::CreateFromInt64( GetNum() );
- if ( HasString() )
- {
- if ( HasNumeric() )
- aRes.AppendAscii( "/" );
- aRes.Append( GetStr() );
- }
- return aRes;
-}
-
-BOOL SmartId::Matches( const String &rId )const
-{
- if ( HasString() )
- return GetStr().EqualsIgnoreCaseAscii( rId );
- else
- return FALSE;
-}
-
-BOOL SmartId::Matches( const ULONG nId ) const
-{
- if ( HasNumeric() )
- return GetNum() == nId;
- else
- return FALSE;
-}
-
-/******************************************************************************
-If Both Ids have nither Strings nor Numbers they don't match
-If both Ids have Strings the result of Matching these is returned.
-Numbers are then Ignored.
-Else Matching Numbers is attempted.
-******************************************************************************/
-BOOL SmartId::Matches( const SmartId &rId ) const
-{
- if ( !mpData || !rId.mpData )
- return FALSE;
- else if ( HasString() && rId.HasString() )
- return Matches( rId.GetStr() );
- else
- return rId.HasNumeric() && Matches( rId.GetNum() );
-}
-
-BOOL SmartId::Equals( const SmartId &rId ) const
-{
- if ( mpData && rId.mpData )
- return mpData->aUId.EqualsIgnoreCaseAscii( rId.mpData->aUId )
- && mpData->bHasStringId == rId.mpData->bHasStringId
- && mpData->nUId == rId.mpData->nUId
- && mpData->bHasNumericId == rId.mpData->bHasNumericId;
- else if ( !mpData && !rId.mpData )
- return TRUE;
- else
- return FALSE;
-}
-
-BOOL SmartId::operator == ( const SmartId& rRight ) const
-{
- return Equals( rRight );
-}
-
-BOOL SmartId::operator < ( const SmartId& rRight ) const
-{
- if ( HasString() && rRight.HasString() && GetStr() != rRight.GetStr() )
- return GetStr() < rRight.GetStr();
- else if ( HasNumeric() && rRight.HasNumeric() && GetNum() != rRight.GetNum() )
- return GetNum() < rRight.GetNum();
- else
- { // Sort Strings to Front
- if ( HasString() )
- return rRight.HasString() && rRight.HasNumeric();
- else
- return rRight.HasString() || (!HasNumeric() && rRight.HasNumeric());
- }
-}
diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src
index 010cae338e0e..13ae6b0ead76 100644
--- a/vcl/source/src/print.src
+++ b/vcl/source/src/print.src
@@ -29,6 +29,7 @@
ModalDialog SV_DLG_PRINT
{
+ HelpID = "vcl:ModalDialog:SV_DLG_PRINT";
Text [en-US] = "Print";
Closeable = TRUE;
Sizeable = TRUE;
@@ -64,6 +65,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_PAGE_EDIT
{
+ HelpID = "vcl:NumericField:SV_DLG_PRINT:SV_PRINT_PAGE_EDIT";
Pos = MAP_APPFONT( 5, 140 );
Size = MAP_APPFONT( 30, 12 );
SVLook = TRUE;
@@ -80,18 +82,21 @@ ModalDialog SV_DLG_PRINT
};
PushButton SV_PRINT_PAGE_FORWARD
{
+ HelpID = "vcl:PushButton:SV_DLG_PRINT:SV_PRINT_PAGE_FORWARD";
Pos = MAP_APPFONT( 95, 140 );
Size = MAP_APPFONT( 15, 12 );
HelpText [en-US] = "Scroll one page forward.";
};
PushButton SV_PRINT_PAGE_BACKWARD
{
+ HelpID = "vcl:PushButton:SV_DLG_PRINT:SV_PRINT_PAGE_BACKWARD";
Pos = MAP_APPFONT( 80, 140 );
Size = MAP_APPFONT( 15, 12 );
HelpText [en-US] = "Scroll one page backward.";
};
TabControl SV_PRINT_TABCTRL
{
+ HelpID = "vcl:TabControl:SV_DLG_PRINT:SV_PRINT_TABCTRL";
Pos = MAP_APPFONT( 140, 5 );
Size = MAP_APPFONT( 205, 175 );
};
@@ -123,6 +128,7 @@ ModalDialog SV_DLG_PRINT
TabPage SV_PRINT_TAB_NUP
{
+ HelpID = "vcl:TabPage:SV_PRINT_TAB_NUP";
Text [en-US] = "Page Layout";
Hide = TRUE;
@@ -134,6 +140,7 @@ ModalDialog SV_DLG_PRINT
};
RadioButton SV_PRINT_PRT_NUP_DEFAULT_BTN
{
+ HelpID = "vcl:RadioButton:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_DEFAULT_BTN";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 10 );
Text [en-US] = "~Default";
@@ -141,12 +148,14 @@ ModalDialog SV_DLG_PRINT
};
RadioButton SV_PRINT_PRT_NUP_BROCHURE_BTN
{
+ HelpID = "vcl:RadioButton:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_BROCHURE_BTN";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 10 );
Text = "";
};
RadioButton SV_PRINT_PRT_NUP_PAGES_BTN
{
+ HelpID = "vcl:RadioButton:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_PAGES_BTN";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 10 );
Text [en-US] = "Pa~ges per sheet";
@@ -154,6 +163,7 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRT_NUP_PAGES_BOX
{
+ HelpID = "vcl:ListBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_PAGES_BOX";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 80 );
Border = TRUE;
@@ -180,6 +190,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_PRT_NUP_COLS_EDT
{
+ HelpID = "vcl:NumericField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_COLS_EDT";
Pos = MAP_APPFONT( 55, 20 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -198,6 +209,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_PRT_NUP_ROWS_EDT
{
+ HelpID = "vcl:NumericField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_ROWS_EDT";
Pos = MAP_APPFONT( 55, 35 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -215,6 +227,7 @@ ModalDialog SV_DLG_PRINT
};
MetricField SV_PRINT_PRT_NUP_MARGINS_PAGES_EDT
{
+ HelpID = "vcl:MetricField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_MARGINS_PAGES_EDT";
Pos = MAP_APPFONT( 55, 95 );
Size = MAP_APPFONT( 40, 12 );
Spin = TRUE;
@@ -237,6 +250,7 @@ ModalDialog SV_DLG_PRINT
};
MetricField SV_PRINT_PRT_NUP_MARGINS_SHEET_EDT
{
+ HelpID = "vcl:MetricField:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_MARGINS_SHEET_EDT";
Pos = MAP_APPFONT( 155, 95 );
Size = MAP_APPFONT( 40, 12 );
Spin = TRUE;
@@ -259,6 +273,7 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRT_NUP_ORIENTATION_BOX
{
+ HelpID = "vcl:ListBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_ORIENTATION_BOX";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 40 );
Border = TRUE;
@@ -280,6 +295,7 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRT_NUP_ORDER_BOX
{
+ HelpID = "vcl:ListBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_ORDER_BOX";
Pos = MAP_APPFONT( 0, 0 );
Size = MAP_APPFONT( 10, 20 );
DropDown = TRUE;
@@ -294,6 +310,7 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_PRT_NUP_BORDER_CB
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_NUP:SV_PRINT_PRT_NUP_BORDER_CB";
Pos = MAP_APPFONT( 10, 65 );
Size = MAP_APPFONT( 150, 12 );
Text [en-US] = "Draw a border around each page";
@@ -303,6 +320,7 @@ ModalDialog SV_DLG_PRINT
TabPage SV_PRINT_TAB_JOB
{
+ HelpID = "vcl:TabPage:SV_PRINT_TAB_JOB";
Text [en-US] = "General";
Hide = TRUE;
@@ -314,6 +332,7 @@ ModalDialog SV_DLG_PRINT
};
ListBox SV_PRINT_PRINTERS
{
+ HelpID = "vcl:ListBox:SV_PRINT_TAB_JOB:SV_PRINT_PRINTERS";
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 100, 80 );
Border = TRUE;
@@ -322,6 +341,7 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_DETAILS_BTN
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_JOB:SV_PRINT_DETAILS_BTN";
Pos = MAP_APPFONT( 5, 5 );
Size = MAP_APPFONT( 5, 5 );
Text [en-US] = "Details";
@@ -347,6 +367,7 @@ ModalDialog SV_DLG_PRINT
};
PushButton SV_PRINT_PRT_SETUP
{
+ HelpID = "vcl:PushButton:SV_PRINT_TAB_JOB:SV_PRINT_PRT_SETUP";
Pos = MAP_APPFONT( 115, 5 );
Size = MAP_APPFONT( 50, 15 );
Text [en-US] = "Properties...";
@@ -366,6 +387,7 @@ ModalDialog SV_DLG_PRINT
};
NumericField SV_PRINT_COPYCOUNT_FIELD
{
+ HelpID = "vcl:NumericField:SV_PRINT_TAB_JOB:SV_PRINT_COPYCOUNT_FIELD";
Pos = MAP_APPFONT( 10, 56 );
Size = MAP_APPFONT( 40, 12 );
Border = TRUE;
@@ -382,6 +404,7 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_COLLATE
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_JOB:SV_PRINT_COLLATE";
Pos = MAP_APPFONT( 95, 45 );
Size = MAP_APPFONT( 70, 10 );
Text [en-US] = "Collate";
@@ -411,6 +434,7 @@ ModalDialog SV_DLG_PRINT
TabPage SV_PRINT_TAB_OPT
{
+ HelpID = "vcl:TabPage:SV_PRINT_TAB_OPT";
Text [en-US] = "Options";
Hide = TRUE;
@@ -422,6 +446,7 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_OPT_TOFILE
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_OPT:SV_PRINT_OPT_TOFILE";
Pos = MAP_APPFONT( 10, 20 );
Size = MAP_APPFONT( 200, 12 );
Text [en-US] = "Print to ~file";
@@ -429,6 +454,7 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_OPT_SINGLEJOBS
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_OPT:SV_PRINT_OPT_SINGLEJOBS";
Pos = MAP_APPFONT( 10, 35 );
Size = MAP_APPFONT( 200, 12 );
Text [en-US] = "~Create single print jobs for collated output";
@@ -436,6 +462,7 @@ ModalDialog SV_DLG_PRINT
};
CheckBox SV_PRINT_OPT_REVERSE
{
+ HelpID = "vcl:CheckBox:SV_PRINT_TAB_OPT:SV_PRINT_OPT_REVERSE";
Pos = MAP_APPFONT( 10, 50 );
Size = MAP_APPFONT( 200, 12 );
Text [en-US] = "Print in ~reverse page order";
@@ -446,6 +473,7 @@ ModalDialog SV_DLG_PRINT
ModelessDialog SV_DLG_PRINT_PROGRESS
{
+ HelpID = "vcl:ModelessDialog:SV_DLG_PRINT_PROGRESS";
Text [en-US] = "Printing";
Closeable = FALSE;
Sizeable = FALSE;
diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index e835fe749ed1..9a0452027737 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -530,22 +530,19 @@ XubString ButtonDialog::GetButtonHelpText( USHORT nId ) const
// -----------------------------------------------------------------------
-void ButtonDialog::SetButtonHelpId( USHORT nId, ULONG nHelpId )
+void ButtonDialog::SetButtonHelpId( USHORT nId, const rtl::OString& rHelpId )
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
if ( pItem )
- pItem->mpPushButton->SetHelpId( nHelpId );
+ pItem->mpPushButton->SetHelpId( rHelpId );
}
// -----------------------------------------------------------------------
-ULONG ButtonDialog::GetButtonHelpId( USHORT nId ) const
+rtl::OString ButtonDialog::GetButtonHelpId( USHORT nId ) const
{
ImplBtnDlgItem* pItem = ImplGetItem( nId );
- if ( pItem )
- return pItem->mpPushButton->GetHelpId();
- else
- return 0;
+ return pItem ? rtl::OString( pItem->mpPushButton->GetHelpId() ) : rtl::OString();
}
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index e77eacb2fddf..b6f80588d776 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -157,7 +157,7 @@ struct MenuItemData
XubString aTipHelpText; // TipHelp-String (eg, expanded filenames)
XubString aCommandStr; // CommandString
XubString aHelpCommandStr; // Help command string (to reference external help)
- ULONG nHelpId; // Help-Id
+ rtl::OString aHelpId; // Help-Id
ULONG nUserValue; // User value
Image aImage; // Image
KeyCode aAccelKey; // Accelerator-Key
@@ -252,7 +252,6 @@ MenuItemData* MenuItemList::Insert( USHORT nId, MenuItemType eType,
pData->nBits = nBits;
pData->pSubMenu = NULL;
pData->pAutoSubMenu = NULL;
- pData->nHelpId = 0;
pData->nUserValue = 0;
pData->bChecked = FALSE;
pData->bEnabled = TRUE;
@@ -284,7 +283,6 @@ void MenuItemList::InsertSeparator( USHORT nPos )
pData->nBits = 0;
pData->pSubMenu = NULL;
pData->pAutoSubMenu = NULL;
- pData->nHelpId = 0;
pData->nUserValue = 0;
pData->bChecked = FALSE;
pData->bEnabled = TRUE;
@@ -844,14 +842,14 @@ static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighl
// Ist eine ID vorhanden, dann Hilfe mit der ID aufrufen, sonst
// den Hilfe-Index
String aCommand = pMenu->GetItemCommand( nId );
- ULONG nHelpId = pMenu->GetHelpId( nId );
+ rtl::OString aHelpId( pMenu->GetHelpId( nId ) );
+ if( ! aHelpId.getLength() )
+ aHelpId = OOO_HELP_INDEX;
if ( aCommand.Len() )
pHelp->Start( aCommand, NULL );
- else if ( nHelpId )
- pHelp->Start( nHelpId, NULL );
else
- pHelp->Start( OOO_HELP_INDEX, NULL );
+ pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), NULL );
}
bDone = TRUE;
}
@@ -1330,15 +1328,14 @@ void Menu::InsertItem( const ResId& rResId, USHORT nPos )
SetHelpText( nItemId, aHelpText );
}
- ULONG nHelpId = 0;
if ( nObjMask & RSC_MENUITEM_HELPID )
{
- nHelpId = ReadLongRes();
+ rtl::OString aHelpId( ReadByteStringRes() );
if ( !bSep )
- SetHelpId( nItemId, nHelpId );
+ SetHelpId( nItemId, aHelpId );
}
- if( !bSep /* && SvHelpSettings::HelpText( aHelpText, nHelpId ) */ )
+ if( !bSep )
SetHelpText( nItemId, aHelpText );
if ( nObjMask & RSC_MENUITEM_KEYCODE )
@@ -1463,7 +1460,7 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos,
pThis->CheckItem( nId, TRUE );
if ( !rMenu.IsItemEnabled( nId ) )
pThis->EnableItem( nId, FALSE );
- pThis->SetHelpId( nId, pData->nHelpId );
+ pThis->SetHelpId( nId, pData->aHelpId );
pThis->SetHelpText( nId, pData->aHelpText );
pThis->SetAccelKey( nId, pData->aAccelKey );
pThis->SetItemCommand( nId, pData->aCommandStr );
@@ -2039,7 +2036,7 @@ const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const
if ( pData )
{
if ( !pData->aHelpText.Len() &&
- (( pData->nHelpId ) || ( pData->aCommandStr.Len() )))
+ (( pData->aHelpId.getLength() ) || ( pData->aCommandStr.Len() )))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
@@ -2047,8 +2044,8 @@ const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const
if ( pData->aCommandStr.Len() )
pData->aHelpText = pHelp->GetHelpText( pData->aCommandStr, NULL );
- if( !pData->aHelpText.Len() && pData->nHelpId )
- pData->aHelpText = pHelp->GetHelpText( pData->nHelpId, NULL );
+ if( !pData->aHelpText.Len() && pData->aHelpId.getLength() )
+ pData->aHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pData->aHelpId, RTL_TEXTENCODING_UTF8 ), NULL );
}
}
@@ -2081,22 +2078,29 @@ const XubString& Menu::GetTipHelpText( USHORT nItemId ) const
return ImplGetSVEmptyStr();
}
-void Menu::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void Menu::SetHelpId( USHORT nItemId, const rtl::OString& rHelpId )
{
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
- pData->nHelpId = nHelpId;
+ pData->aHelpId = rHelpId;
}
-ULONG Menu::GetHelpId( USHORT nItemId ) const
+rtl::OString Menu::GetHelpId( USHORT nItemId ) const
{
+ rtl::OString aRet;
+
MenuItemData* pData = pItemList->GetData( nItemId );
if ( pData )
- return pData->nHelpId;
- else
- return 0;
+ {
+ if ( pData->aHelpId.getLength() )
+ aRet = pData->aHelpId;
+ else
+ aRet = ::rtl::OUStringToOString( pData->aCommandStr, RTL_TEXTENCODING_UTF8 );
+ }
+
+ return aRet;
}
Menu& Menu::operator=( const Menu& rMenu )
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 7f7a65cd7fb9..d00d569883d5 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -196,10 +196,9 @@ MessBox::MessBox( Window* pParent, const ResId& rResId ) :
USHORT nLoButtons = ReadShortRes();
USHORT nHiDefButton = ReadShortRes();
USHORT nLoDefButton = ReadShortRes();
- USHORT nHiHelpId = ReadShortRes();
- USHORT nLoHelpId = ReadShortRes();
+ rtl::OString aHelpId( ReadByteStringRes() );
/* USHORT bSysModal = */ ReadShortRes();
- SetHelpId( ((ULONG)nHiHelpId << 16) + nLoHelpId );
+ SetHelpId( aHelpId );
WinBits nBits = (((ULONG)nHiButtons << 16) + nLoButtons) |
(((ULONG)nHiDefButton << 16) + nLoDefButton);
ImplInit( pParent, nBits | WB_MOVEABLE | WB_HORZ | WB_CENTER );
@@ -233,7 +232,7 @@ MessBox::~MessBox()
void MessBox::ImplPosControls()
{
- if ( GetHelpId() )
+ if ( GetHelpId().getLength() )
{
if ( !mbHelpBtn )
{
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 9a22aa913ded..f24ed500b7df 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -46,7 +46,7 @@
#include "unotools/localedatawrapper.hxx"
-#include "rtl/ustrbuf.hxx"
+#include "rtl/strbuf.hxx"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/container/XNameAccess.hpp"
@@ -61,8 +61,8 @@ using namespace com::sun::star::container;
using namespace com::sun::star::beans;
#define HELPID_PREFIX ".HelpId:vcl:PrintDialog"
-#define SMHID2( a, b ) SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( HELPID_PREFIX ":" a ":" b ) ), HID_PRINTDLG ) )
-#define SMHID1( a ) SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( HELPID_PREFIX ":" a ) ), HID_PRINTDLG ) )
+#define SMHID2( a, b ) SetHelpId( rtl::OString( HELPID_PREFIX ":" a ":" b ) )
+#define SMHID1( a ) SetHelpId( rtl::OString( HELPID_PREFIX ":" a ) )
PrintDialog::PrintPreviewWindow::PrintPreviewWindow( Window* i_pParent, const ResId& i_rId )
: Window( i_pParent, i_rId )
@@ -1127,24 +1127,24 @@ bool PrintDialog::isSingleJobs()
static void setSmartId( Window* i_pWindow, const char* i_pType, sal_Int32 i_nId = -1, const rtl::OUString& i_rPropName = rtl::OUString() )
{
- rtl::OUStringBuffer aBuf( 256 );
- aBuf.appendAscii( HELPID_PREFIX );
+ rtl::OStringBuffer aBuf( 256 );
+ aBuf.append( HELPID_PREFIX );
if( i_rPropName.getLength() )
{
- aBuf.append( sal_Unicode( ':' ) );
- aBuf.append( i_rPropName );
+ aBuf.append( ':' );
+ aBuf.append( rtl::OUStringToOString( i_rPropName, RTL_TEXTENCODING_UTF8 ) );
}
if( i_pType )
{
- aBuf.append( sal_Unicode( ':' ) );
- aBuf.appendAscii( i_pType );
+ aBuf.append( ':' );
+ aBuf.append( i_pType );
}
if( i_nId >= 0 )
{
- aBuf.append( sal_Unicode( ':' ) );
+ aBuf.append( ':' );
aBuf.append( i_nId );
}
- i_pWindow->SetSmartHelpId( SmartId( aBuf.makeStringAndClear(), HID_PRINTDLG ) );
+ i_pWindow->SetHelpId( aBuf.makeStringAndClear() );
}
static void setHelpText( Window* /*i_pWindow*/, const Sequence< rtl::OUString >& /*i_rHelpTexts*/, sal_Int32 /*i_nIndex*/ )
@@ -2147,7 +2147,7 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton )
if( pHelp )
{
// FIXME: find out proper help URL and use here
- pHelp->Start( HID_PRINTDLG, GetParent() );
+ pHelp->Start( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ), GetParent() );
}
}
else if( pButton == &maForwardBtn )
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index ba4ab7984c52..36f27b1ceee7 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -89,7 +89,7 @@ struct ImplStatusItem
XubString maText;
XubString maHelpText;
XubString maQuickHelpText;
- ULONG mnHelpId;
+ rtl::OString maHelpId;
void* mpUserData;
BOOL mbVisible;
XubString maAccessibleName;
@@ -906,9 +906,9 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
String aCommand = GetItemCommand( nItemId );
- ULONG nHelpId = GetHelpId( nItemId );
+ rtl::OString aHelpId( GetHelpId( nItemId ) );
- if ( aCommand.Len() || nHelpId )
+ if ( aCommand.Len() || aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
@@ -916,8 +916,8 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
{
if ( aCommand.Len() )
pHelp->Start( aCommand, this );
- else if ( nHelpId )
- pHelp->Start( nHelpId, this );
+ else if ( aHelpId.getLength() )
+ pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return;
}
@@ -1033,7 +1033,6 @@ void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth,
pItem->mnBits = nBits;
pItem->mnWidth = (long)nWidth+nFudge+STATUSBAR_OFFSET;
pItem->mnOffset = nOffset;
- pItem->mnHelpId = 0;
pItem->mpUserData = 0;
pItem->mbVisible = TRUE;
@@ -1475,15 +1474,15 @@ const XubString& StatusBar::GetHelpText( USHORT nItemId ) const
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
ImplStatusItem* pItem = mpItemList->GetObject( nPos );
- if ( !pItem->maHelpText.Len() && ( pItem->mnHelpId || pItem->maCommand.Len() ))
+ if ( !pItem->maHelpText.Len() && ( pItem->maHelpId.getLength() || pItem->maCommand.Len() ))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
if ( pItem->maCommand.Len() )
pItem->maHelpText = pHelp->GetHelpText( pItem->maCommand, this );
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
}
@@ -1520,24 +1519,31 @@ const XubString& StatusBar::GetQuickHelpText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void StatusBar::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void StatusBar::SetHelpId( USHORT nItemId, const rtl::OString& rHelpId )
{
USHORT nPos = GetItemPos( nItemId );
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- mpItemList->GetObject( nPos )->mnHelpId = nHelpId;
+ mpItemList->GetObject( nPos )->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG StatusBar::GetHelpId( USHORT nItemId ) const
+rtl::OString StatusBar::GetHelpId( USHORT nItemId ) const
{
USHORT nPos = GetItemPos( nItemId );
+ rtl::OString aRet;
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
- return mpItemList->GetObject( nPos )->mnHelpId;
- else
- return 0;
+ {
+ ImplStatusItem* pItem = mpItemList->GetObject( nPos );
+ if ( pItem->maHelpId.getLength() )
+ aRet = pItem->maHelpId;
+ else
+ aRet = ::rtl::OUStringToOString( pItem->maCommand, RTL_TEXTENCODING_UTF8 );
+ }
+
+ return aRet;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 4de6c88490f6..b71cf1c13c8d 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4820,15 +4820,15 @@ const XubString& ToolBox::ImplGetHelpText( USHORT nItemId ) const
if ( pItem )
{
- if ( !pItem->maHelpText.Len() && ( pItem->mnHelpId || pItem->maCommandStr.Len() ))
+ if ( !pItem->maHelpText.Len() && ( pItem->maHelpId.getLength() || pItem->maCommandStr.Len() ))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
if ( pItem->maCommandStr.Len() )
pItem->maHelpText = pHelp->GetHelpText( pItem->maCommandStr, this );
- if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
- pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this );
+ if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
+ pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
}
@@ -4894,9 +4894,9 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt )
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
String aCommand = GetItemCommand( nItemId );
- ULONG nHelpId = GetHelpId( nItemId );
+ rtl::OString aHelpId( GetHelpId( nItemId ) );
- if ( aCommand.Len() || nHelpId )
+ if ( aCommand.Len() || aHelpId.getLength() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
@@ -4904,8 +4904,8 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt )
{
if ( aCommand.Len() )
pHelp->Start( aCommand, this );
- else if ( nHelpId )
- pHelp->Start( nHelpId, this );
+ else if ( aHelpId.getLength() )
+ pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return;
}
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 334cdd2d0a64..35a39676353a 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -99,7 +99,6 @@ ImplToolItem::ImplToolItem()
mnId = 0;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = 0;
meState = STATE_NOCHECK;
@@ -124,7 +123,6 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage,
mnId = nItemId;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = nItemBits;
meState = STATE_NOCHECK;
@@ -149,7 +147,6 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const XubString& rText,
mnId = nItemId;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = nItemBits;
meState = STATE_NOCHECK;
@@ -175,7 +172,6 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage,
mnId = nItemId;
mpWindow = NULL;
mpUserData = NULL;
- mnHelpId = 0;
meType = TOOLBOXITEM_BUTTON;
mnBits = nItemBits;
meState = STATE_NOCHECK;
@@ -204,7 +200,7 @@ ImplToolItem::ImplToolItem( const ImplToolItem& rItem ) :
maQuickHelpText ( rItem.maQuickHelpText ),
maHelpText ( rItem.maHelpText ),
maCommandStr ( rItem.maCommandStr ),
- mnHelpId ( rItem.mnHelpId ),
+ maHelpId ( rItem.maHelpId ),
maRect ( rItem.maRect ),
maCalcRect ( rItem.maCalcRect ),
maItemSize ( rItem.maItemSize ),
@@ -243,7 +239,7 @@ ImplToolItem& ImplToolItem::operator=( const ImplToolItem& rItem )
maQuickHelpText = rItem.maQuickHelpText;
maHelpText = rItem.maHelpText;
maCommandStr = rItem.maCommandStr;
- mnHelpId = rItem.mnHelpId;
+ maHelpId = rItem.maHelpId;
maRect = rItem.maRect;
maCalcRect = rItem.maCalcRect;
mnSepSize = rItem.mnSepSize;
@@ -595,7 +591,7 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos )
aItem.mnBits = (ToolBoxItemBits)ReadLongRes();
if( nObjMask & RSC_TOOLBOXITEM_HELPID )
- aItem.mnHelpId = ReadLongRes();
+ aItem.maHelpId = ReadByteStringRes();
if ( nObjMask & RSC_TOOLBOXITEM_TEXT )
{
@@ -1923,24 +1919,31 @@ const XubString& ToolBox::GetHelpText( USHORT nItemId ) const
// -----------------------------------------------------------------------
-void ToolBox::SetHelpId( USHORT nItemId, ULONG nHelpId )
+void ToolBox::SetHelpId( USHORT nItemId, const rtl::OString& rHelpId )
{
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
- pItem->mnHelpId = nHelpId;
+ pItem->maHelpId = rHelpId;
}
// -----------------------------------------------------------------------
-ULONG ToolBox::GetHelpId( USHORT nItemId ) const
+rtl::OString ToolBox::GetHelpId( USHORT nItemId ) const
{
+ rtl::OString aRet;
+
ImplToolItem* pItem = ImplGetItem( nItemId );
if ( pItem )
- return pItem->mnHelpId;
- else
- return 0;
+ {
+ if ( pItem->maHelpId.getLength() )
+ aRet = pItem->maHelpId;
+ else
+ aRet = ::rtl::OUStringToOString( pItem->maCommandStr, RTL_TEXTENCODING_UTF8 );
+ }
+
+ return aRet;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index adedbde4c0f2..e5705c994f4f 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -612,8 +612,6 @@ void Window::ImplInitWindowData( WindowType nType )
mpWindowImpl->mnX = 0; // X-Position to Parent
mpWindowImpl->mnY = 0; // Y-Position to Parent
mpWindowImpl->mnAbsScreenX = 0; // absolute X-position on screen, used for RTL window positioning
- mpWindowImpl->mnHelpId = 0; // help id
- mpWindowImpl->mnUniqId = 0; // unique id
mpWindowImpl->mpChildClipRegion = NULL; // Child-Clip-Region when ClipChildren
mpWindowImpl->mpPaintRegion = NULL; // Paint-ClipRegion
mpWindowImpl->mnStyle = 0; // style (init in ImplInitWindow)
@@ -1179,20 +1177,14 @@ void Window::ImplCallMove()
// -----------------------------------------------------------------------
-static ULONG ImplAutoHelpID( ResMgr* pResMgr )
+static rtl::OString ImplAutoHelpID( ResMgr* pResMgr )
{
- if ( !Application::IsAutoHelpIdEnabled() )
- return 0;
-
- ULONG nHID = 0;
+ rtl::OString aRet;
- DBG_ASSERT( pResMgr, "No res mgr for auto help id" );
- if( ! pResMgr )
- return 0;
+ if( pResMgr && Application::IsAutoHelpIdEnabled() )
+ aRet = pResMgr->GetAutoHelpId();
- nHID = pResMgr->GetAutoHelpId();
-
- return nHID;
+ return aRet;
}
// -----------------------------------------------------------------------
@@ -1212,22 +1204,23 @@ WinBits Window::ImplInitRes( const ResId& rResId )
void Window::ImplLoadRes( const ResId& rResId )
{
- // newer move this line after IncrementRes
- char* pRes = (char*)GetClassRes();
- pRes += 12;
- sal_uInt32 nHelpId = (sal_uInt32)GetLongRes( (void*)pRes );
- if ( !nHelpId )
- nHelpId = ImplAutoHelpID( rResId.GetResMgr() );
- SetHelpId( nHelpId );
-
ULONG nObjMask = ReadLongRes();
+ // we need to calculate auto helpids before the resource gets closed
+ // if the resource only contains flags, it will be closed before we try to read a help id
+ // so we always create an auto help id that might be overwritten later
+ // HelpId
+ rtl::OString aHelpId = ImplAutoHelpID( rResId.GetResMgr() );
+
// ResourceStyle
ULONG nRSStyle = ReadLongRes();
// WinBits
ReadLongRes();
- // HelpId
- ReadLongRes();
+
+ if( nObjMask & WINDOW_HELPID )
+ aHelpId = ReadByteStringRes();
+
+ SetHelpId( aHelpId );
BOOL bPos = FALSE;
BOOL bSize = FALSE;
@@ -1294,7 +1287,7 @@ void Window::ImplLoadRes( const ResId& rResId )
if ( nObjMask & WINDOW_EXTRALONG )
SetData( (void*)ReadLongRes() );
if ( nObjMask & WINDOW_UNIQUEID )
- SetUniqueId( (ULONG)ReadLongRes() );
+ SetUniqueId( ReadByteStringRes() );
if ( nObjMask & WINDOW_BORDER_STYLE )
{
@@ -1322,8 +1315,6 @@ ImplWinData* Window::ImplGetWinData() const
mpWindowImpl->mpWinData->mnIsTopWindow = (USHORT) ~0; // not initialized yet, 0/1 will indicate TopWindow (see IsTopWindow())
mpWindowImpl->mpWinData->mbMouseOver = FALSE;
mpWindowImpl->mpWinData->mbEnableNativeWidget = (pNoNWF && *pNoNWF) ? FALSE : TRUE; // TRUE: try to draw this control with native theme API
- mpWindowImpl->mpWinData->mpSmartHelpId = NULL;
- mpWindowImpl->mpWinData->mpSmartUniqueId = NULL;
}
return mpWindowImpl->mpWinData;
@@ -4734,10 +4725,6 @@ Window::~Window()
delete mpWindowImpl->mpWinData->mpFocusRect;
if ( mpWindowImpl->mpWinData->mpTrackRect )
delete mpWindowImpl->mpWinData->mpTrackRect;
- if ( mpWindowImpl->mpWinData->mpSmartHelpId )
- delete mpWindowImpl->mpWinData->mpSmartHelpId;
- if ( mpWindowImpl->mpWinData->mpSmartUniqueId )
- delete mpWindowImpl->mpWinData->mpSmartUniqueId;
delete mpWindowImpl->mpWinData;
}
@@ -4979,29 +4966,18 @@ void Window::RequestHelp( const HelpEvent& rHEvt )
}
else
{
- SmartId aSmartId = GetSmartHelpId();
-
- ULONG nNumHelpId = 0;
- String aStrHelpId;
- if( aSmartId.HasString() )
- aStrHelpId = aSmartId.GetStr();
- if( aSmartId.HasNumeric() )
- nNumHelpId = aSmartId.GetNum();
-
- if ( !nNumHelpId && aStrHelpId.Len() == 0 && ImplGetParent() )
+ String aStrHelpId( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
+ if ( aStrHelpId.Len() == 0 && ImplGetParent() )
ImplGetParent()->RequestHelp( rHEvt );
else
{
- if ( !nNumHelpId && aStrHelpId.Len() == 0 )
- nNumHelpId = OOO_HELP_INDEX;
-
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
if( aStrHelpId.Len() > 0 )
pHelp->Start( aStrHelpId, this );
else
- pHelp->Start( nNumHelpId, this );
+ pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OOO_HELP_INDEX ) ), this );
}
}
}
@@ -8130,32 +8106,22 @@ const XubString& Window::GetHelpText() const
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
- SmartId aSmartId = GetSmartHelpId();
-
- ULONG nNumHelpId = 0;
- String aStrHelpId;
- if( aSmartId.HasString() )
- aStrHelpId = aSmartId.GetStr();
- if( aSmartId.HasNumeric() )
- nNumHelpId = aSmartId.GetNum();
+ String aStrHelpId( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
bool bStrHelpId = (aStrHelpId.Len() > 0);
- if ( !mpWindowImpl->maHelpText.Len() && (nNumHelpId || bStrHelpId) )
+ if ( !mpWindowImpl->maHelpText.Len() && bStrHelpId )
{
if ( !IsDialog() && (mpWindowImpl->mnType != WINDOW_TABPAGE) && (mpWindowImpl->mnType != WINDOW_FLOATINGWINDOW) )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
- if( bStrHelpId )
- ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( aStrHelpId, this );
- else
- ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( nNumHelpId, this );
+ ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( aStrHelpId, this );
mpWindowImpl->mbHelpTextDynamic = FALSE;
}
}
}
- else if( mpWindowImpl->mbHelpTextDynamic && (nNumHelpId || bStrHelpId) )
+ else if( mpWindowImpl->mbHelpTextDynamic && bStrHelpId )
{
static const char* pEnv = getenv( "HELP_DEBUG" );
if( pEnv && *pEnv )
@@ -8163,10 +8129,7 @@ const XubString& Window::GetHelpText() const
rtl::OUStringBuffer aTxt( 64+mpWindowImpl->maHelpText.Len() );
aTxt.append( mpWindowImpl->maHelpText );
aTxt.appendAscii( "\n------------------\n" );
- if( bStrHelpId )
- aTxt.append( rtl::OUString( aStrHelpId ) );
- else
- aTxt.append( sal_Int32( nNumHelpId ) );
+ aTxt.append( rtl::OUString( aStrHelpId ) );
mpWindowImpl->maHelpText = aTxt.makeStringAndClear();
}
mpWindowImpl->mbHelpTextDynamic = FALSE;
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 02b2713b01cc..e5b58a8b6f3c 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1442,115 +1442,31 @@ Window* Window::ImplGetTopmostFrameWindow()
return pTopmostParent->mpWindowImpl->mpFrameWindow;
}
-// making these Methods out of line to be able to change them lateron without complete rebuild
-// TODO: Set the SmartId in here and remove mpWindowImpl->mnHelpId
-void Window::SetHelpId( ULONG nHelpId )
+void Window::SetHelpId( const rtl::OString& rHelpId )
{
- SetSmartHelpId(SmartId(nHelpId));
+ mpWindowImpl->maHelpId = rHelpId;
}
-ULONG Window::GetHelpId() const
+const rtl::OString& Window::GetHelpId() const
{
- return mpWindowImpl->mnHelpId;
+ return mpWindowImpl->maHelpId;
}
-void Window::SetSmartHelpId( const SmartId& aId, SmartIdUpdateMode aMode )
+void Window::SetUniqueId( const rtl::OString& rUniqueId )
{
- // create SmartId if required
- if ( (aMode == SMART_SET_STR) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasString() ) )
- {
- if ( !ImplGetWinData()->mpSmartHelpId )
- ImplGetWinData()->mpSmartHelpId = new SmartId();
- }
-
- // if we have a SmartId (eather from earlier call or just created) fill with new values
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId )
- ImplGetWinData()->mpSmartHelpId->UpdateId( aId, aMode );
-
- if ( (aMode == SMART_SET_NUM) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasNumeric() ) )
- {
- mpWindowImpl->mnHelpId = aId.GetNum();
- }
-}
-
-SmartId Window::GetSmartHelpId() const
-{
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId )
- {
- if ( mpWindowImpl->mnHelpId || mpWindowImpl->mpWinData->mpSmartHelpId->HasNumeric() )
- mpWindowImpl->mpWinData->mpSmartHelpId->UpdateId( SmartId( mpWindowImpl->mnHelpId ), SMART_SET_NUM );
- return *mpWindowImpl->mpWinData->mpSmartHelpId;
- }
- else
- {
- if ( mpWindowImpl->mnHelpId )
- return SmartId( mpWindowImpl->mnHelpId );
- else
- return SmartId();
- }
-}
-
-
-// making these Methods out of line to be able to change them lateron without complete rebuild
-// TODO: Set the SmartId in here and remove mpWindowImpl->mnUniqId
-void Window::SetUniqueId( ULONG nUniqueId ) { mpWindowImpl->mnUniqId = nUniqueId; }
-ULONG Window::GetUniqueId() const { return mpWindowImpl->mnUniqId; }
-
-
-void Window::SetSmartUniqueId( const SmartId& aId, SmartIdUpdateMode aMode )
-{
- // create SmartId if required
- if ( (aMode == SMART_SET_STR) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasString() ) )
- {
- if ( !ImplGetWinData()->mpSmartUniqueId )
- ImplGetWinData()->mpSmartUniqueId = new SmartId();
- }
-
- // if we have a SmartId (eather from earlier call or just created) fill with new values
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId )
- ImplGetWinData()->mpSmartUniqueId->UpdateId( aId, aMode );
-
- if ( (aMode == SMART_SET_NUM) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasNumeric() ) )
- mpWindowImpl->mnUniqId = aId.GetNum();
+ mpWindowImpl->maUniqId = rUniqueId;
}
-SmartId Window::GetSmartUniqueId() const
+const rtl::OString& Window::GetUniqueId() const
{
- if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId )
- {
- if ( mpWindowImpl->mnUniqId || mpWindowImpl->mpWinData->mpSmartUniqueId->HasNumeric() )
- mpWindowImpl->mpWinData->mpSmartUniqueId->UpdateId( SmartId( mpWindowImpl->mnUniqId ), SMART_SET_NUM );
- return *mpWindowImpl->mpWinData->mpSmartUniqueId;
- }
- else
- {
- if ( mpWindowImpl->mnUniqId )
- return SmartId( mpWindowImpl->mnUniqId );
- else
- return SmartId();
- }
+ return mpWindowImpl->maUniqId;
}
-SmartId Window::GetSmartUniqueOrHelpId() const
+const rtl::OString& Window::GetUniqueOrHelpId() const
{
- if ( ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId ) || mpWindowImpl->mnHelpId )
- {
- if ( ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId ) || mpWindowImpl->mnUniqId )
- {
- SmartId aTemp = GetSmartHelpId();
- aTemp.UpdateId( GetSmartUniqueId() );
- return aTemp;
- }
- else
- return GetSmartHelpId();
- }
- else
- return GetSmartUniqueId();
+ return mpWindowImpl->maUniqId.getLength() ? mpWindowImpl->maUniqId : mpWindowImpl->maHelpId;
}
-
-
-
// --------- old inline methods ---------------
Window* Window::ImplGetWindow()
diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx
index ecb4aa54549b..434263db352e 100644
--- a/vcl/unx/source/fontmanager/fontconfig.cxx
+++ b/vcl/unx/source/fontmanager/fontconfig.cxx
@@ -454,20 +454,33 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName )
for( int i = 0; i < pOrig->nfont; ++i )
{
FcPattern* pOrigPattern = pOrig->fonts[i];
- // create a pattern to find eventually better alternatives
- FcPattern* pTestPattern = FcPatternDuplicate( pOrigPattern );
- FcPatternAddBool( pTestPattern, FC_OUTLINE, FcTrue );
- // TODO: use pattern->ImplFontAttr->pattern to filter out
- // all attribute that are not interesting for finding dupes
- FcPatternDel( pTestPattern, FC_FONTVERSION );
- FcPatternDel( pTestPattern, FC_CHARSET );
- FcPatternDel( pTestPattern, FC_FILE );
- // find the font face for the dupe-search pattern
- FcResult eFcResult = FcResultMatch;
- FcPattern* pBetterPattern = FcFontMatch( FcConfigGetCurrent(), pTestPattern, &eFcResult );
- FcPatternDestroy( pTestPattern );
- if( eFcResult != FcResultMatch )
+ // #i115131# ignore non-outline fonts
+ FcBool bOutline = FcFalse;
+ FcResult eOutRes = FcPatternGetBool( pOrigPattern, FC_OUTLINE, 0, &bOutline );
+ if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) )
continue;
+ // create a pattern to find eventually better alternatives
+ FcPattern* pBetterPattern = pOrigPattern;
+ if( m_nFcVersion > 20400 ) // #i115204# avoid trouble with old FC versions
+ {
+ FcPattern* pTestPattern = FcPatternDuplicate( pOrigPattern );
+ FcPatternAddBool( pTestPattern, FC_OUTLINE, FcTrue );
+ // TODO: ignore all attributes that are not interesting for finding dupes
+ // e.g. by using pattern->ImplFontAttr->pattern conversion
+ FcPatternDel( pTestPattern, FC_FONTVERSION );
+ FcPatternDel( pTestPattern, FC_CHARSET );
+ FcPatternDel( pTestPattern, FC_FILE );
+ // find the font face for the dupe-search pattern
+ FcResult eFcResult = FcResultMatch;
+ pBetterPattern = FcFontMatch( FcConfigGetCurrent(), pTestPattern, &eFcResult );
+ FcPatternDestroy( pTestPattern );
+ if( eFcResult != FcResultMatch )
+ continue;
+ // #i115131# double check results and eventually ignore them
+ eOutRes = FcPatternGetBool( pBetterPattern, FC_OUTLINE, 0, &bOutline );
+ if( (eOutRes != FcResultMatch) || (bOutline == FcFalse) )
+ continue;
+ }
// insert best found pattern for the dupe-search pattern
// TODO: skip inserting patterns that are already known in the target fontset
FcPatternReference( pBetterPattern );
@@ -773,7 +786,10 @@ int PrintFontManager::countFontconfigFonts( std::hash_map<rtl::OString, int, rtl
#endif
}
if( aFonts.empty() )
+ {
+ // TODO: remove fonts unusable to psprint from fontset
continue;
+ }
int nFamilyName = m_pAtoms->getAtom( ATOM_FAMILYNAME, OStringToOUString( OString( (sal_Char*)family ), RTL_TEXTENCODING_UTF8 ), sal_True );
PrintFont* pUpdate = aFonts.front();
@@ -1103,6 +1119,7 @@ bool PrintFontManager::getFontOptions(
ImplFontOptions& rOptions) const
{
#ifndef ENABLE_FONTCONFIG
+ (void)rInfo;(void)nSize;(void)subcallback;(void)rOptions;
return false;
#else // ENABLE_FONTCONFIG
FontCfgWrapper& rWrapper = FontCfgWrapper::get();