Kaydet (Commit) d1cfdc0d authored tarafından Daniel Rentz's avatar Daniel Rentz

#101517# HC for number format list box

üst 6ec618d4
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: fontlb.hxx,v $ * $RCSfile: fontlb.hxx,v $
* *
* $Revision: 1.1.1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: hr $ $Date: 2000-09-18 17:00:56 $ * last change: $Author: dr $ $Date: 2002-07-23 10:47:34 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -62,61 +62,91 @@ ...@@ -62,61 +62,91 @@
#ifndef SVX_FONTLB_HXX #ifndef SVX_FONTLB_HXX
#define SVX_FONTLB_HXX #define SVX_FONTLB_HXX
#ifndef _SVTABBX_HXX //autogen #ifndef _SVTABBOX_HXX
#include <svtools/svtabbx.hxx> #include <svtools/svtabbx.hxx>
#endif #endif
#ifndef _SV_VIRDEV_HXX
#ifndef _SV_VIRDEV_HXX //autogen
#include <vcl/virdev.hxx> #include <vcl/virdev.hxx>
#endif #endif
// Klasse fuer die Darstellung von schriftabhaengigen Strings // ============================================================================
/** A list box string item which stores its text and font. */
class SvLBoxFontString : public SvLBoxString class SvLBoxFontString : public SvLBoxString
{ {
private: private:
Font maFont; /// The font used by this item.
Font aPrivatFont; bool mbUseColor; /// true = use font color, false = default listbox color.
public: public:
SvLBoxFontString( SvLBoxEntry*,USHORT nFlags,const XubString& rStr, SvLBoxFontString();
const Font& aFont); SvLBoxFontString(
SvLBoxFontString(); SvLBoxEntry* pEntry,
~SvLBoxFontString(); sal_uInt16 nFlags,
const XubString& rString,
void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* ); const Font& rFont,
void Paint( const Point&, SvLBox& rDev, USHORT nFlags,SvLBoxEntry* ); const Color* pColor = NULL );
SvLBoxItem* Create() const;
};
// Listbox mit schriftabhaengiger Darstellung virtual ~SvLBoxFontString();
class SvxFontListBox : public SvTabListBox
{
private:
VirtualDevice *pPrivatVDev; /** Creates a new empty list box item. */
Font aStandardFont; virtual SvLBoxItem* Create() const;
Font aEntryFont;
BOOL bSettingFont;
protected: void InitViewData( SvLBox*,SvLBoxEntry*,SvViewDataItem* );
virtual void InitEntry(SvLBoxEntry*, const XubString&,const Image&,const Image&); /** Paints this entry to the specified position, using the own font settings. */
void Paint(
const Point& rPos,
SvLBox& rDev,
sal_uInt16 nFlags,
SvLBoxEntry* pEntry );
};
public:
SvxFontListBox(Window* pParent,const ResId& aResID); // ============================================================================
~SvxFontListBox();
void InsertFontEntry( const String& rString, Font aActorFont); /** A list box supporting formatted string entries. */
class SvxFontListBox : public SvTabListBox
{
private:
Font maStdFont; /// Used for entries without specific font.
void SelectEntryPos( USHORT nPos, BOOL bSelect=TRUE); // The following members are used to store additional parameters for InitEntry().
ULONG GetSelectEntryPos(); Font maEntryFont; /// Current entry font used in InitEntry().
XubString GetSelectEntry(); const Color* mpEntryColor; /// Current entry color used in InitEntry().
void SetNoSelection(); bool mbUseFont; /// true = Use maEntryFont/mpEntryColor in InitEntry().
public:
SvxFontListBox( Window* pParent, const ResId& rResId );
/** Inserts a list entry and sets the font used for this entry.
@param pColor The font color. NULL = use default listbox text color. */
void InsertFontEntry(
const String& rString, const Font& rFont, const Color* pColor = NULL );
/** Selects/deselects an entry specified by its position in the list box. */
void SelectEntryPos( sal_uInt16 nPos, bool bSelect = true );
/** Removes a selection. */
void SetNoSelection();
/** Returns the position of the entry currently selected or LIST_ENTRY_NOTFOUND. */
sal_uInt32 GetSelectEntryPos() const;
/** Returns the text of the selected entry or an empty string. */
XubString GetSelectEntry() const;
protected:
/** Initializes a new SvLBoxFontString entry.
@descr Uses current value of maEntryFont to set the entry font (if mbUseFont is true). */
virtual void InitEntry(
SvLBoxEntry* pEntry,
const XubString& rEntryText,
const Image& rCollImg,
const Image& rExpImg );
}; };
// ============================================================================
#endif #endif
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: ctredlin.cxx,v $ * $RCSfile: ctredlin.cxx,v $
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* *
* last change: $Author: nn $ $Date: 2001-07-17 17:33:27 $ * last change: $Author: dr $ $Date: 2002-07-23 10:50:19 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -85,7 +85,6 @@ ...@@ -85,7 +85,6 @@
#include <dialmgr.hxx> #include <dialmgr.hxx>
#include "ctredlin.hrc" #include "ctredlin.hrc"
#include "ctredlin.hxx" #include "ctredlin.hxx"
#include "fontlb.hxx"
#include "helpid.hrc" #include "helpid.hrc"
//============================================================================ //============================================================================
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: fontlb.cxx,v $ * $RCSfile: fontlb.cxx,v $
* *
* $Revision: 1.1.1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: hr $ $Date: 2000-09-18 17:01:08 $ * last change: $Author: dr $ $Date: 2002-07-23 10:50:17 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -59,395 +59,140 @@ ...@@ -59,395 +59,140 @@
* *
************************************************************************/ ************************************************************************/
#ifndef _SV_IMAGE_HXX //autogen #ifndef SVX_FONTLB_HXX
#include <vcl/image.hxx>
#endif
#pragma hdrstop
#include "fontlb.hxx" #include "fontlb.hxx"
#endif
DBG_NAME(SvLBoxFontString); #ifndef _SV_SVAPP_HXX
#include <vcl/svapp.hxx>
/************************************************************************* #endif
#* Funktionen der in die SvxFontListBox eingefuegten Items
#************************************************************************/
#pragma hdrstop
/************************************************************************* // ============================================================================
#* Member: SvLBoxFontString Datum:23.10.97
#*------------------------------------------------------------------------
#*
#* Klasse: SvLBoxFontString
#*
#* Funktion: Konstruktor der Klasse SvLBoxFontString
#*
#* Input: Box- Entry,Flags, Text fuer Anzeige, Schrift
#*
#* Output: ---
#*
#************************************************************************/
SvLBoxFontString::SvLBoxFontString( SvLBoxEntry*pEntry,USHORT nFlags,const XubString& rStr, DBG_NAME( SvLBoxFontString );
const Font& aFont)
: SvLBoxString( pEntry, nFlags, rStr ) SvLBoxFontString::SvLBoxFontString() :
SvLBoxString()
{ {
DBG_CTOR(SvLBoxFontString,0); DBG_CTOR( SvLBoxFontString, 0 );
aPrivatFont=aFont;
SetText( pEntry, rStr );
} }
/************************************************************************* SvLBoxFontString::SvLBoxFontString(
#* Member: SvLBoxFontString Datum:23.10.97 SvLBoxEntry* pEntry, sal_uInt16 nFlags, const XubString& rString,
#*------------------------------------------------------------------------ const Font& rFont, const Color* pColor ) :
#* SvLBoxString( pEntry, nFlags, rString ),
#* Klasse: SvLBoxFontString maFont( rFont ),
#* mbUseColor( pColor != NULL )
#* Funktion: Default Konstruktor der Klasse SvLBoxFontString
#*
#* Input: ---
#*
#* Output: ---
#*
#************************************************************************/
SvLBoxFontString::SvLBoxFontString()
: SvLBoxString()
{ {
DBG_CTOR(SvLBoxFontString,0); DBG_CTOR( SvLBoxFontString, 0 );
SetText( pEntry, rString );
if( pColor )
maFont.SetColor( *pColor );
} }
/*************************************************************************
#* Member: ~SvLBoxFontString Datum:23.10.97
#*------------------------------------------------------------------------
#*
#* Klasse: SvLBoxFontString
#*
#* Funktion: Destruktor der Klasse SvLBoxFontString
#*
#* Input: ---
#*
#* Output: ---
#*
#************************************************************************/
SvLBoxFontString::~SvLBoxFontString() SvLBoxFontString::~SvLBoxFontString()
{ {
DBG_DTOR(SvLBoxFontString,0); DBG_DTOR( SvLBoxFontString, 0 );
} }
/*************************************************************************
#* Member: SvLBoxFontString Datum:23.10.97
#*------------------------------------------------------------------------
#*
#* Klasse: SvLBoxFontString
#*
#* Funktion: Erzeugt einen neuen SvLBoxFontString
#*
#* Input: ---
#*
#* Output: SvLBoxFontString
#*
#************************************************************************/
SvLBoxItem* SvLBoxFontString::Create() const SvLBoxItem* SvLBoxFontString::Create() const
{ {
DBG_CHKTHIS(SvLBoxFontString,0); DBG_CHKTHIS( SvLBoxFontString, 0 );
return new SvLBoxFontString; return new SvLBoxFontString;
} }
void SvLBoxFontString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry )
/*************************************************************************
#* Member: SvLBoxFontString Datum:23.10.97
#*------------------------------------------------------------------------
#*
#* Klasse: SvLBoxFontString
#*
#* Funktion: Zeichenroutine des SvLBoxFontString. Gezeichnet wird
#* der entsprechende Text mit der eingestellten Schriftart
#* im Ausgabe- Device.
#*
#* Input: Position, Ausgabe- Device, Flag fuer Selection,
#* Zeiger auf den Eintrag
#*
#* Output: ---
#*
#************************************************************************/
void SvLBoxFontString::Paint( const Point& rPos, SvLBox& rDev,
USHORT nFlags, SvLBoxEntry* pEntry )
{ {
Font aFont=rDev.GetFont(); DBG_CHKTHIS( SvLBoxFontString, 0 );
Font a2Font=aPrivatFont; Font aOldFont( rDev.GetFont() );
Color aColor; Font aNewFont( maFont );
if(nFlags & SVLISTENTRYFLAG_SELECTED) bool bSel = (nFlags & SVLISTENTRYFLAG_SELECTED) != 0;
{ // if( !mbUseColor ) // selection gets font color, if available
aColor=a2Font.GetColor(); if( !mbUseColor || bSel ) // selection always gets highlight color
aColor.SetRed(~aColor.GetRed());
aColor.SetGreen(~aColor.GetGreen());
aColor.SetBlue(~aColor.GetBlue());
a2Font.SetColor(aColor);
rDev.SetFont(a2Font);
}
else
{ {
rDev.SetFont(aPrivatFont); const StyleSettings& rSett = Application::GetSettings().GetStyleSettings();
aNewFont.SetColor( bSel ? rSett.GetHighlightTextColor() : rSett.GetFieldTextColor() );
} }
SvLBoxString::Paint(rPos,rDev,nFlags,pEntry );
rDev.SetFont(aFont);
}
/************************************************************************* rDev.SetFont( aNewFont );
#* Member: SvLBoxFontString Datum:23.10.97 SvLBoxString::Paint( rPos, rDev, nFlags, pEntry );
#*------------------------------------------------------------------------ rDev.SetFont( aOldFont );
#*
#* Klasse: SvLBoxFontString
#*
#* Funktion: Ermittelt und stellt die Ausgabegroesse in der View ein.
#*
#* Input: Zeiger auf die View, Eintrag, Anzeigedaten
#*
#*
#* Output: ---
#*
#************************************************************************/
void SvLBoxFontString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
SvViewDataItem* pViewData)
{
DBG_CHKTHIS(SvLBoxFontString,0);
Font aFont= pView->GetFont();
pView->SetFont(aPrivatFont);
SvLBoxString::InitViewData(pView,pEntry,pViewData);
pView->SetFont(aFont);
} }
/************************************************************************* void SvLBoxFontString::InitViewData( SvLBox* pView, SvLBoxEntry* pEntry, SvViewDataItem* pViewData )
#* Listbox mit Schrifteinstellung
#************************************************************************/
/*************************************************************************
#* Member: SvxFontListBox Datum:20.10.97
#*------------------------------------------------------------------------
#*
#* Klasse: SvxFontListBox
#*
#* Funktion: Konstruktor der Klasse SvxFontListBox. Die Klasse dient
#* der Darstellung von Strings in der entsprechenden
#* Schriftart.
#*
#* Input: Parent-Window, WinBits, min. Winkel, max. Winkel
#*
#* Output: ---
#*
#************************************************************************/
SvxFontListBox::SvxFontListBox(Window* pParent,const ResId& aResID)
:SvTabListBox(pParent,aResID)
{ {
pPrivatVDev=new VirtualDevice; DBG_CHKTHIS( SvLBoxFontString, 0 );
aStandardFont=GetFont(); Font aOldFont( pView->GetFont() );
Size aWinSize=GetOutputSizePixel(); pView->SetFont( maFont );
bSettingFont=FALSE; SvLBoxString::InitViewData( pView, pEntry, pViewData);
aStandardFont.SetTransparent(TRUE); pView->SetFont( aOldFont );
aStandardFont.SetColor(Color(COL_BLUE));
if(pPrivatVDev!=NULL)
{
pPrivatVDev->SetOutputSizePixel(aWinSize);
pPrivatVDev->SetFont(aStandardFont);
}
Color aCol=GetBackground().GetColor();
aStandardFont.SetColor(aCol);
SetFont(aStandardFont);
aEntryFont=aStandardFont;
} }
/*************************************************************************
#* Member: SvxFontListBox Datum:20.10.97
#*------------------------------------------------------------------------
#*
#* Klasse: SvxFontListBox
#*
#* Funktion: Destruktor der Klasse SvxFontListBox. Gibt den
#* Speicher, der fuer das VDevice angelegt wurde,
#* wieder frei.
#*
#* Input: ---
#*
#* Output: ---
#*
#************************************************************************/
SvxFontListBox::~SvxFontListBox() // ============================================================================
SvxFontListBox::SvxFontListBox( Window* pParent, const ResId& rResId ) :
SvTabListBox( pParent, rResId ),
maStdFont( GetFont() ),
mbUseFont( false )
{ {
delete pPrivatVDev; maStdFont.SetTransparent( TRUE );
maEntryFont = maStdFont;
} }
void SvxFontListBox::InsertFontEntry( const String& rString, const Font& rFont, const Color* pColor )
/*************************************************************************
#* Member: InsertFontEntry Datum:20.10.97
#*------------------------------------------------------------------------
#*
#* Klasse: SvxColorTabListBox
#*
#* Funktion: Erzeugt aus dem uebergebenen String eine Bitmap
#* und fuegt diese Bitmap in die ListBox ein.
#*
#* Input: String, Font, Position
#*
#* Output: ---
#*
#************************************************************************/
void SvxFontListBox::InsertFontEntry( const String& rString,Font aActorFont)
{ {
Point aPos(0,0); mbUseFont = true; // InitEntry() will use maEntryFont
bSettingFont=TRUE; maEntryFont = rFont; // font to use in InitEntry() over InsertEntry()
aEntryFont=aActorFont; mpEntryColor = pColor; // color to use in InitEntry() over InsertEntry()
InsertEntry( rString); InsertEntry( rString );
mbUseFont = false;
} }
/************************************************************************* void SvxFontListBox::SelectEntryPos( sal_uInt16 nPos, bool bSelect )
#* Member: SelectEntryPos Datum:20.10.97
#*------------------------------------------------------------------------
#*
#* Klasse: SvxFontListBox
#*
#* Funktion: Schaltet an der Position nPos, die Selektion
#* an oder aus.
#*
#* Input: Position, Selektion: An/Aus
#*
#* Output: ---
#*
#************************************************************************/
void SvxFontListBox::SelectEntryPos( USHORT nPos, BOOL bSelect)
{ {
SvLBoxEntry* pEntry=GetEntry(nPos); SvLBoxEntry* pEntry = GetEntry( nPos );
if(pEntry!=NULL) if( pEntry )
{ {
Select( pEntry,bSelect); Select( pEntry, bSelect );
ShowEntry(pEntry ); ShowEntry( pEntry );
} }
} }
/************************************************************************* void SvxFontListBox::SetNoSelection()
#* Member: GetSelectEntryPos Datum:20.10.97
#*------------------------------------------------------------------------
#*
#* Klasse: SvxFontListBox
#*
#* Funktion: Liefert die Position der ersten Selektion
#* zurck.
#*
#* Input: ---
#*
#* Output: Position
#*
#************************************************************************/
ULONG SvxFontListBox::GetSelectEntryPos()
{ {
SvLBoxEntry* pSvLBoxEntry=FirstSelected(); SelectAll( FALSE, TRUE );
ULONG nSel=LIST_APPEND;
if(pSvLBoxEntry!=NULL)
{
nSel=GetModel()->GetAbsPos( pSvLBoxEntry );
}
return nSel;
} }
/************************************************************************* sal_uInt32 SvxFontListBox::GetSelectEntryPos() const
#* Member: GetSelectEntry Datum:20.10.97
#*------------------------------------------------------------------------
#*
#* Klasse: SvxFontListBox
#*
#* Funktion: Liefert den ersten Eintrag der Selektion
#* zurck.
#*
#* Input: ---
#*
#* Output: Position
#*
#************************************************************************/
XubString SvxFontListBox::GetSelectEntry()
{ {
return GetEntryText(GetSelectEntryPos()); SvLBoxEntry* pSvLBoxEntry = FirstSelected();
return pSvLBoxEntry ? GetModel()->GetAbsPos( pSvLBoxEntry ) : LIST_ENTRY_NOTFOUND;
} }
XubString SvxFontListBox::GetSelectEntry() const
/*************************************************************************
#* Member: SetNoSelection Datum:20.10.97
#*------------------------------------------------------------------------
#*
#* Klasse: SvxFontListBox
#*
#* Funktion: Hebt eine bestehende Selektierung auf.
#*
#* Input: ---
#*
#* Output: ---
#*
#************************************************************************/
void SvxFontListBox::SetNoSelection()
{ {
SelectAll( FALSE,TRUE ); return GetEntryText( GetSelectEntryPos() );
} }
void SvxFontListBox::InitEntry(
/************************************************************************* SvLBoxEntry* pEntry, const XubString& rEntryText,
#* Member: SvxFontListBox Datum:20.10.97 const Image& rCollImg, const Image& rExpImg )
#*------------------------------------------------------------------------
#*
#* Klasse: SvxFontListBox
#*
#* Funktion: Ueberladene Funktion der TreeListBox. Fuegt einen
#* neuen SvLBoxFontString ein.
#*
#* Input: ---
#*
#* Output: ---
#*
#************************************************************************/
void SvxFontListBox::InitEntry( SvLBoxEntry* pEntry, const XubString& aStr,
const Image& aCollEntryBmp, const Image& aExpEntryBmp)
{ {
if(bSettingFont==TRUE) if( mbUseFont )
{ {
bSettingFont=FALSE;
SvLBoxButton* pButton;
SvLBoxFontString* pString;
SvLBoxContextBmp* pContextBmp;
if( nTreeFlags & TREEFLAG_CHKBTN ) if( nTreeFlags & TREEFLAG_CHKBTN )
{ pEntry->AddItem( new SvLBoxButton( pEntry, 0, pCheckButtonData ) );
pButton= new SvLBoxButton( pEntry,0,pCheckButtonData ); pEntry->AddItem( new SvLBoxContextBmp( pEntry, 0, rCollImg, rExpImg, SVLISTENTRYFLAG_EXPANDED ) );
pEntry->AddItem( pButton ); pEntry->AddItem( new SvLBoxFontString( pEntry, 0, rEntryText, maEntryFont, mpEntryColor ) );
}
pContextBmp= new SvLBoxContextBmp( pEntry,0, aCollEntryBmp,aExpEntryBmp,
SVLISTENTRYFLAG_EXPANDED);
pEntry->AddItem( pContextBmp );
pString = new SvLBoxFontString( pEntry, 0, aStr,aEntryFont);
pEntry->AddItem( pString );
} }
else else
{ SvTreeListBox::InitEntry( pEntry, rEntryText, rCollImg, rExpImg );
SvTreeListBox::InitEntry( pEntry, aStr, aCollEntryBmp, aExpEntryBmp);
}
} }
// ============================================================================
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: numfmt.cxx,v $ * $RCSfile: numfmt.cxx,v $
* *
* $Revision: 1.14 $ * $Revision: 1.15 $
* *
* last change: $Author: gt $ $Date: 2002-06-11 08:03:53 $ * last change: $Author: dr $ $Date: 2002-07-23 10:50:18 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -174,10 +174,10 @@ SvxNumberPreviewImpl::~SvxNumberPreviewImpl() ...@@ -174,10 +174,10 @@ SvxNumberPreviewImpl::~SvxNumberPreviewImpl()
#************************************************************************/ #************************************************************************/
void SvxNumberPreviewImpl::NotifyChange( const String& rPrevStr, void SvxNumberPreviewImpl::NotifyChange( const String& rPrevStr,
const Color& rColor ) const Color* pColor )
{ {
aPrevStr = rPrevStr; aPrevStr = rPrevStr;
aPrevCol = rColor; aPrevCol = pColor ? *pColor : GetSettings().GetStyleSettings().GetWindowTextColor();
Invalidate(); Invalidate();
Update(); Update();
} }
...@@ -504,8 +504,6 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet& rSet ) ...@@ -504,8 +504,6 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet& rSet )
USHORT nFmtLbSelPos = 0; USHORT nFmtLbSelPos = 0;
LanguageType eLangType = LANGUAGE_DONTKNOW; LanguageType eLangType = LANGUAGE_DONTKNOW;
SvxDelStrgs aFmtEntryList; SvxDelStrgs aFmtEntryList;
String aPrevString;
Color aPrevColor;
SvxNumberValueType eValType = SVX_VALUE_TYPE_UNDEFINED; SvxNumberValueType eValType = SVX_VALUE_TYPE_UNDEFINED;
double nValDouble = 0; double nValDouble = 0;
String aValString; String aValString;
...@@ -638,8 +636,10 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet& rSet ) ...@@ -638,8 +636,10 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet& rSet )
FillCurrencyBox(); FillCurrencyBox();
String aPrevString;
Color* pDummy = NULL;
pNumFmtShell->GetInitSettings( nCatLbSelPos, eLangType, nFmtLbSelPos, pNumFmtShell->GetInitSettings( nCatLbSelPos, eLangType, nFmtLbSelPos,
aFmtEntryList, aPrevString, aPrevColor ); aFmtEntryList, aPrevString, pDummy );
aLbCurrency.SelectEntryPos((USHORT)pNumFmtShell->GetCurrencySymbol()); aLbCurrency.SelectEntryPos((USHORT)pNumFmtShell->GetCurrencySymbol());
...@@ -720,7 +720,7 @@ void SvxNumberFormatTabPage::Obstructing() ...@@ -720,7 +720,7 @@ void SvxNumberFormatTabPage::Obstructing()
aEdLeadZeroes .SetText( String() ); aEdLeadZeroes .SetText( String() );
aBtnNegRed .Check( FALSE ); aBtnNegRed .Check( FALSE );
aBtnThousand .Check( FALSE ); aBtnThousand .Check( FALSE );
aWndPreview .NotifyChange( String(), Color() ); aWndPreview .NotifyChange( String() );
aLbCategory .SelectEntryPos( 0 ); aLbCategory .SelectEntryPos( 0 );
aEdFormat .SetText( String() ); aEdFormat .SetText( String() );
...@@ -944,11 +944,7 @@ void SvxNumberFormatTabPage::FillFormatListBox_Impl( SvxDelStrgs& rEntries ) ...@@ -944,11 +944,7 @@ void SvxNumberFormatTabPage::FillFormatListBox_Impl( SvxDelStrgs& rEntries )
String* pEntry; String* pEntry;
String aTmpString; String aTmpString;
String aTmpCatString; String aTmpCatString;
String aPreviewString;
Color aPreviewColor;
Font aFont=aLbCategory.GetFont(); Font aFont=aLbCategory.GetFont();
Font a2Font;
Font a3Font;
double nVal=0; double nVal=0;
BOOL bFLAG=FALSE; BOOL bFLAG=FALSE;
USHORT i = 0; USHORT i = 0;
...@@ -983,7 +979,7 @@ void SvxNumberFormatTabPage::FillFormatListBox_Impl( SvxDelStrgs& rEntries ) ...@@ -983,7 +979,7 @@ void SvxNumberFormatTabPage::FillFormatListBox_Impl( SvxDelStrgs& rEntries )
{ {
aTmpString=*pEntry; aTmpString=*pEntry;
aPrivCat=pNumFmtShell->GetCategory4Entry(0); aPrivCat=pNumFmtShell->GetCategory4Entry(0);
aLbFormat.InsertFontEntry(aTmpString,aFont); aLbFormat.InsertFontEntry( aTmpString, aFont );
} }
break; break;
...@@ -998,10 +994,10 @@ void SvxNumberFormatTabPage::FillFormatListBox_Impl( SvxDelStrgs& rEntries ) ...@@ -998,10 +994,10 @@ void SvxNumberFormatTabPage::FillFormatListBox_Impl( SvxDelStrgs& rEntries )
aPrivCat=pNumFmtShell->GetCategory4Entry(i); aPrivCat=pNumFmtShell->GetCategory4Entry(i);
if(aPrivCat!=CAT_TEXT) if(aPrivCat!=CAT_TEXT)
{ {
aPreviewString=GetExpColorString(&aPreviewColor, *pEntry,aPrivCat); Color* pPreviewColor = NULL;
a2Font=aLbFormat.GetFont(); String aPreviewString( GetExpColorString( pPreviewColor, *pEntry, aPrivCat ) );
a2Font.SetColor(aPreviewColor); Font aEntryFont( aLbFormat.GetFont() );
aLbFormat.InsertFontEntry(aPreviewString,a2Font); //@21.10.97 aLbFormat.InsertFontEntry( aPreviewString, aEntryFont, pPreviewColor );
} }
else else
{ {
...@@ -1187,8 +1183,6 @@ void SvxNumberFormatTabPage::UpdateFormatListBox_Impl ...@@ -1187,8 +1183,6 @@ void SvxNumberFormatTabPage::UpdateFormatListBox_Impl
{ {
SvxDelStrgs aEntryList; SvxDelStrgs aEntryList;
short nFmtLbSelPos = 0; short nFmtLbSelPos = 0;
String aPreviewString;
Color aPreviewColor;
short nTmpCatPos; short nTmpCatPos;
if(bOneAreaFlag) if(bOneAreaFlag)
...@@ -1254,11 +1248,7 @@ void SvxNumberFormatTabPage::UpdateFormatListBox_Impl ...@@ -1254,11 +1248,7 @@ void SvxNumberFormatTabPage::UpdateFormatListBox_Impl
aFtComment.SetText(aLbCategory.GetEntry(1)); aFtComment.SetText(aLbCategory.GetEntry(1));
} }
} }
ChangePreviewText( (USHORT)nFmtLbSelPos );
pNumFmtShell->FormatChanged( (USHORT)nFmtLbSelPos,
aPreviewString,
aPreviewColor );
aWndPreview.NotifyChange( aPreviewString, aPreviewColor );
} }
} }
...@@ -1286,7 +1276,7 @@ void SvxNumberFormatTabPage::UpdateFormatListBox_Impl ...@@ -1286,7 +1276,7 @@ void SvxNumberFormatTabPage::UpdateFormatListBox_Impl
if ( bUpdateEdit ) if ( bUpdateEdit )
{ {
aEdFormat.SetText( String() ); aEdFormat.SetText( String() );
aWndPreview.NotifyChange( String(), aPreviewColor ); aWndPreview.NotifyChange( String() );
} }
} }
} }
...@@ -1382,8 +1372,6 @@ IMPL_LINK( SvxNumberFormatTabPage, SelFormatHdl_Impl, void *, pLb ) ...@@ -1382,8 +1372,6 @@ IMPL_LINK( SvxNumberFormatTabPage, SelFormatHdl_Impl, void *, pLb )
USHORT nSelPos = (USHORT) aLbFormat.GetSelectEntryPos(); USHORT nSelPos = (USHORT) aLbFormat.GetSelectEntryPos();
String aFormat = aLbFormat.GetSelectEntry(); String aFormat = aLbFormat.GetSelectEntry();
String aComment; String aComment;
String aPreviewString;
Color aPreviewColor;
SvxDelStrgs aEntryList; SvxDelStrgs aEntryList;
short nFmtLbSelPos = nSelPos; short nFmtLbSelPos = nSelPos;
...@@ -1402,11 +1390,7 @@ IMPL_LINK( SvxNumberFormatTabPage, SelFormatHdl_Impl, void *, pLb ) ...@@ -1402,11 +1390,7 @@ IMPL_LINK( SvxNumberFormatTabPage, SelFormatHdl_Impl, void *, pLb )
{ {
if(!aEdFormat.HasFocus()) aEdFormat.SetText( aFormat ); if(!aEdFormat.HasFocus()) aEdFormat.SetText( aFormat );
aFtComment.SetText(aComment); aFtComment.SetText(aComment);
pNumFmtShell->FormatChanged( nSelPos, ChangePreviewText( nSelPos );
aPreviewString,
aPreviewColor );
aWndPreview.NotifyChange( aPreviewString, aPreviewColor );
} }
REMOVE_DONTKNOW() // ggF. UI-Enable REMOVE_DONTKNOW() // ggF. UI-Enable
...@@ -1536,9 +1520,6 @@ IMPL_LINK( SvxNumberFormatTabPage, ClickHdl_Impl, ImageButton*, pIB) ...@@ -1536,9 +1520,6 @@ IMPL_LINK( SvxNumberFormatTabPage, ClickHdl_Impl, ImageButton*, pIB)
if ( bAdded && (nFmtLbSelPos != SELPOS_NONE) ) if ( bAdded && (nFmtLbSelPos != SELPOS_NONE) )
{ {
// Alles klar // Alles klar
String aPreviewString;
Color aPreviewColor;
if(bOneAreaFlag) //@@ ??? if(bOneAreaFlag) //@@ ???
SetCategory(0); SetCategory(0);
else else
...@@ -1561,11 +1542,7 @@ IMPL_LINK( SvxNumberFormatTabPage, ClickHdl_Impl, ImageButton*, pIB) ...@@ -1561,11 +1542,7 @@ IMPL_LINK( SvxNumberFormatTabPage, ClickHdl_Impl, ImageButton*, pIB)
//aEdComment.SetText(String()); //@@ ??? //aEdComment.SetText(String()); //@@ ???
aEdComment.SetText(aLbCategory.GetEntry(1)); //String fuer Benutzerdefiniert aEdComment.SetText(aLbCategory.GetEntry(1)); //String fuer Benutzerdefiniert
//holen //holen
ChangePreviewText( (USHORT)nFmtLbSelPos );
pNumFmtShell->FormatChanged( (USHORT)nFmtLbSelPos,
aPreviewString,
aPreviewColor );
aWndPreview.NotifyChange( aPreviewString, aPreviewColor );
} }
} }
} }
...@@ -1579,8 +1556,6 @@ IMPL_LINK( SvxNumberFormatTabPage, ClickHdl_Impl, ImageButton*, pIB) ...@@ -1579,8 +1556,6 @@ IMPL_LINK( SvxNumberFormatTabPage, ClickHdl_Impl, ImageButton*, pIB)
} }
else if(pIB==&aIbRemove) else if(pIB==&aIbRemove)
{ {
String aPreviewString;
Color aPreviewColor;
String aFormat = aEdFormat.GetText(); String aFormat = aEdFormat.GetText();
SvxDelStrgs aEntryList; SvxDelStrgs aEntryList;
USHORT nCatLbSelPos = 0; USHORT nCatLbSelPos = 0;
...@@ -1610,10 +1585,7 @@ IMPL_LINK( SvxNumberFormatTabPage, ClickHdl_Impl, ImageButton*, pIB) ...@@ -1610,10 +1585,7 @@ IMPL_LINK( SvxNumberFormatTabPage, ClickHdl_Impl, ImageButton*, pIB)
aLbFormat.SelectEntryPos( (USHORT)nFmtLbSelPos ); aLbFormat.SelectEntryPos( (USHORT)nFmtLbSelPos );
aEdFormat.SetText( aFormat ); aEdFormat.SetText( aFormat );
pNumFmtShell->FormatChanged( (USHORT)nFmtLbSelPos, ChangePreviewText( (USHORT)nFmtLbSelPos );
aPreviewString,
aPreviewColor );
aWndPreview.NotifyChange( aPreviewString, aPreviewColor );
} }
else else
{ {
...@@ -1663,8 +1635,6 @@ IMPL_LINK( SvxNumberFormatTabPage, ClickHdl_Impl, ImageButton*, pIB) ...@@ -1663,8 +1635,6 @@ IMPL_LINK( SvxNumberFormatTabPage, ClickHdl_Impl, ImageButton*, pIB)
IMPL_LINK( SvxNumberFormatTabPage, EditHdl_Impl, Edit*, pEdFormat ) IMPL_LINK( SvxNumberFormatTabPage, EditHdl_Impl, Edit*, pEdFormat )
{ {
ULONG nCurKey = NUMKEY_UNDEFINED; ULONG nCurKey = NUMKEY_UNDEFINED;
String aPreviewString; //@ 22.09.97
Color aPreviewColor;
if ( aEdFormat.GetText().Len() == 0 ) if ( aEdFormat.GetText().Len() == 0 )
{ {
...@@ -1677,11 +1647,7 @@ IMPL_LINK( SvxNumberFormatTabPage, EditHdl_Impl, Edit*, pEdFormat ) ...@@ -1677,11 +1647,7 @@ IMPL_LINK( SvxNumberFormatTabPage, EditHdl_Impl, Edit*, pEdFormat )
{ {
String aFormat = aEdFormat.GetText(); String aFormat = aEdFormat.GetText();
//aFtComment.SetText(String()); //aFtComment.SetText(String());
MakePreviewText( aFormat );
pNumFmtShell->MakePreviewString(aFormat,aPreviewString, //@ 22.09.97
aPreviewColor);
aWndPreview.NotifyChange( aPreviewString, aPreviewColor );
if ( pNumFmtShell->FindEntry( aFormat, &nCurKey ) ) if ( pNumFmtShell->FindEntry( aFormat, &nCurKey ) )
{ {
...@@ -1746,8 +1712,6 @@ IMPL_LINK( SvxNumberFormatTabPage, OptHdl_Impl, void *, pOptCtrl ) ...@@ -1746,8 +1712,6 @@ IMPL_LINK( SvxNumberFormatTabPage, OptHdl_Impl, void *, pOptCtrl )
|| ((CheckBox*) pOptCtrl == &aBtnNegRed) || ((CheckBox*) pOptCtrl == &aBtnNegRed)
|| ((CheckBox*) pOptCtrl == &aBtnThousand) ) || ((CheckBox*) pOptCtrl == &aBtnThousand) )
{ {
String aPreviewString;
Color aPreviewColor;
String aFormat; String aFormat;
BOOL bThousand = aBtnThousand.IsEnabled() BOOL bThousand = aBtnThousand.IsEnabled()
&& aBtnThousand.IsChecked(); && aBtnThousand.IsChecked();
...@@ -1767,12 +1731,7 @@ IMPL_LINK( SvxNumberFormatTabPage, OptHdl_Impl, void *, pOptCtrl ) ...@@ -1767,12 +1731,7 @@ IMPL_LINK( SvxNumberFormatTabPage, OptHdl_Impl, void *, pOptCtrl )
aEdFormat.SetText( aFormat ); aEdFormat.SetText( aFormat );
//aFtComment.SetText(String()); //aFtComment.SetText(String());
MakePreviewText( aFormat );
pNumFmtShell->MakePreviewString( aFormat,
aPreviewString,
aPreviewColor );
aWndPreview.NotifyChange( aPreviewString, aPreviewColor );
if ( pNumFmtShell->FindEntry( aFormat ) ) if ( pNumFmtShell->FindEntry( aFormat ) )
{ {
...@@ -1847,17 +1806,10 @@ IMPL_LINK( SvxNumberFormatTabPage, LostFocusHdl_Impl, Edit *, pEd) ...@@ -1847,17 +1806,10 @@ IMPL_LINK( SvxNumberFormatTabPage, LostFocusHdl_Impl, Edit *, pEd)
#* #*
#************************************************************************/ #************************************************************************/
String SvxNumberFormatTabPage::GetExpColorString(Color *aPreviewColor, String SvxNumberFormatTabPage::GetExpColorString(
String aFormatStr, Color*& rpPreviewColor, const String& rFormatStr, short nTmpCatPos)
short nTmpCatPos)
{ {
Color aTmpCol; double nVal = 0;
String aPreviewString;
String aTmpString;
double nVal=0;
aTmpString=aFormatStr;
switch (nTmpCatPos) switch (nTmpCatPos)
{ {
case CAT_CURRENCY: nVal=SVX_NUMVAL_CURRENCY; break; case CAT_CURRENCY: nVal=SVX_NUMVAL_CURRENCY; break;
...@@ -1880,14 +1832,27 @@ String SvxNumberFormatTabPage::GetExpColorString(Color *aPreviewColor, ...@@ -1880,14 +1832,27 @@ String SvxNumberFormatTabPage::GetExpColorString(Color *aPreviewColor,
default: nVal=0;break; default: nVal=0;break;
} }
pNumFmtShell->MakePrevStringFromVal( aTmpString, //@ 19.09.97 String aPreviewString;
aPreviewString, pNumFmtShell->MakePrevStringFromVal( rFormatStr, aPreviewString, rpPreviewColor, nVal );
aTmpCol,nVal );
*aPreviewColor=aTmpCol;
return aPreviewString; return aPreviewString;
} }
void SvxNumberFormatTabPage::MakePreviewText( const String& rFormat )
{
String aPreviewString;
Color* pPreviewColor = NULL;
pNumFmtShell->MakePreviewString( rFormat, aPreviewString, pPreviewColor );
aWndPreview.NotifyChange( aPreviewString, pPreviewColor );
}
void SvxNumberFormatTabPage::ChangePreviewText( USHORT nPos )
{
String aPreviewString;
Color* pPreviewColor = NULL;
pNumFmtShell->FormatChanged( nPos, aPreviewString, pPreviewColor );
aWndPreview.NotifyChange( aPreviewString, pPreviewColor );
}
long SvxNumberFormatTabPage::PreNotify( NotifyEvent& rNEvt ) long SvxNumberFormatTabPage::PreNotify( NotifyEvent& rNEvt )
{ {
if(rNEvt.GetType()==EVENT_LOSEFOCUS) if(rNEvt.GetType()==EVENT_LOSEFOCUS)
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: numfmtsh.cxx,v $ * $RCSfile: numfmtsh.cxx,v $
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* *
* last change: $Author: er $ $Date: 2002-03-14 12:46:02 $ * last change: $Author: dr $ $Date: 2002-07-23 10:52:55 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -86,6 +86,10 @@ ...@@ -86,6 +86,10 @@
#include <langtab.hxx> #include <langtab.hxx>
#endif #endif
#ifndef _SV_SVAPP_HXX
#include <vcl/svapp.hxx>
#endif
#include "numfmtsh.hxx" #include "numfmtsh.hxx"
// class SvxNumberFormatShell -------------------------------------------- // class SvxNumberFormatShell --------------------------------------------
...@@ -265,7 +269,7 @@ void SvxNumberFormatShell::LanguageChanged( LanguageType eLangType, ...@@ -265,7 +269,7 @@ void SvxNumberFormatShell::LanguageChanged( LanguageType eLangType,
void SvxNumberFormatShell::FormatChanged( sal_uInt16 nFmtLbPos, void SvxNumberFormatShell::FormatChanged( sal_uInt16 nFmtLbPos,
String& rPreviewStr, String& rPreviewStr,
Color& rFontColor ) Color*& rpFontColor )
{ {
//nCurFormatKey = pCurFmtTable->GetKey( pCurFmtTable->GetObject( nFmtLbPos ) ); //nCurFormatKey = pCurFmtTable->GetKey( pCurFmtTable->GetObject( nFmtLbPos ) );
...@@ -275,7 +279,7 @@ void SvxNumberFormatShell::FormatChanged( sal_uInt16 nFmtLbPos, ...@@ -275,7 +279,7 @@ void SvxNumberFormatShell::FormatChanged( sal_uInt16 nFmtLbPos,
if(nCurFormatKey!=NUMBERFORMAT_ENTRY_NOT_FOUND) if(nCurFormatKey!=NUMBERFORMAT_ENTRY_NOT_FOUND)
{ {
GetPreviewString_Impl( rPreviewStr, rFontColor ); GetPreviewString_Impl( rPreviewStr, rpFontColor );
} }
else if(nCurCategory==NUMBERFORMAT_CURRENCY) else if(nCurCategory==NUMBERFORMAT_CURRENCY)
{ {
...@@ -283,7 +287,7 @@ void SvxNumberFormatShell::FormatChanged( sal_uInt16 nFmtLbPos, ...@@ -283,7 +287,7 @@ void SvxNumberFormatShell::FormatChanged( sal_uInt16 nFmtLbPos,
{ {
//nCurFormatKey=nFmtLbPos; //nCurFormatKey=nFmtLbPos;
MakePrevStringFromVal(*aCurrencyFormatList[nFmtLbPos], MakePrevStringFromVal(*aCurrencyFormatList[nFmtLbPos],
rPreviewStr,rFontColor,nValNum); rPreviewStr,rpFontColor,nValNum);
} }
} }
} }
...@@ -486,9 +490,9 @@ void SvxNumberFormatShell::GetOptions( const String& rFormat, ...@@ -486,9 +490,9 @@ void SvxNumberFormatShell::GetOptions( const String& rFormat,
void SvxNumberFormatShell::MakePreviewString( const String& rFormatStr, void SvxNumberFormatShell::MakePreviewString( const String& rFormatStr,
String& rPreviewStr, String& rPreviewStr,
Color& rFontColor ) Color*& rpFontColor )
{ {
Color* pColor = NULL; rpFontColor = NULL;
ULONG nExistingFormat = pFormatter->GetEntryKey( rFormatStr, eCurLanguage ); ULONG nExistingFormat = pFormatter->GetEntryKey( rFormatStr, eCurLanguage );
if ( nExistingFormat == NUMBERFORMAT_ENTRY_NOT_FOUND ) if ( nExistingFormat == NUMBERFORMAT_ENTRY_NOT_FOUND )
...@@ -496,7 +500,7 @@ void SvxNumberFormatShell::MakePreviewString( const String& rFormatStr, ...@@ -496,7 +500,7 @@ void SvxNumberFormatShell::MakePreviewString( const String& rFormatStr,
// real preview - not implemented in NumberFormatter for text formats // real preview - not implemented in NumberFormatter for text formats
pFormatter->GetPreviewString( rFormatStr, nValNum, rPreviewStr, pFormatter->GetPreviewString( rFormatStr, nValNum, rPreviewStr,
&pColor, eCurLanguage ); &rpFontColor, eCurLanguage );
} }
else else
{ {
...@@ -507,16 +511,11 @@ void SvxNumberFormatShell::MakePreviewString( const String& rFormatStr, ...@@ -507,16 +511,11 @@ void SvxNumberFormatShell::MakePreviewString( const String& rFormatStr,
( aValStr.Len() && ( pFormatter->GetType(nExistingFormat) & NUMBERFORMAT_TEXT ) ) ); ( aValStr.Len() && ( pFormatter->GetType(nExistingFormat) & NUMBERFORMAT_TEXT ) ) );
if ( bUseText ) if ( bUseText )
pFormatter->GetOutputString( aValStr, nExistingFormat, pFormatter->GetOutputString( aValStr, nExistingFormat,
rPreviewStr, &pColor ); rPreviewStr, &rpFontColor );
else else
pFormatter->GetOutputString( nValNum, nExistingFormat, pFormatter->GetOutputString( nValNum, nExistingFormat,
rPreviewStr, &pColor ); rPreviewStr, &rpFontColor );
} }
if ( pColor )
rFontColor = *pColor;
else
rFontColor = Color( COL_BLACK );
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -577,12 +576,13 @@ sal_Bool SvxNumberFormatShell::FindEntry( const String& rFmtString, sal_uInt32* ...@@ -577,12 +576,13 @@ sal_Bool SvxNumberFormatShell::FindEntry( const String& rFmtString, sal_uInt32*
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void SvxNumberFormatShell::GetInitSettings( sal_uInt16& nCatLbPos, void SvxNumberFormatShell::GetInitSettings(
LanguageType& rLangType, sal_uInt16& nCatLbPos,
sal_uInt16& nFmtLbSelPos, LanguageType& rLangType,
SvStrings& rFmtEntries, sal_uInt16& nFmtLbSelPos,
String& rPrevString, SvStrings& rFmtEntries,
Color& rPrevColor ) String& rPrevString,
Color*& rpPrevColor )
{ {
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Vorbedingung: Zahlenformatierer gefunden // Vorbedingung: Zahlenformatierer gefunden
...@@ -612,7 +612,7 @@ void SvxNumberFormatShell::GetInitSettings( sal_uInt16& nCatLbPos, ...@@ -612,7 +612,7 @@ void SvxNumberFormatShell::GetInitSettings( sal_uInt16& nCatLbPos,
DBG_ASSERT( nSelPos != SELPOS_NONE, "Leere Formatliste!" ); DBG_ASSERT( nSelPos != SELPOS_NONE, "Leere Formatliste!" );
nFmtLbSelPos = (nSelPos != SELPOS_NONE) ? (sal_uInt16)nSelPos : 0; nFmtLbSelPos = (nSelPos != SELPOS_NONE) ? (sal_uInt16)nSelPos : 0;
GetPreviewString_Impl( rPrevString, rPrevColor ); GetPreviewString_Impl( rPrevString, rpPrevColor );
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -737,7 +737,6 @@ short SvxNumberFormatShell::FillEListWithFormats_Impl( SvStrings& rList,short nS ...@@ -737,7 +737,6 @@ short SvxNumberFormatShell::FillEListWithFormats_Impl( SvStrings& rList,short nS
String aNewFormNInfo; String aNewFormNInfo;
String aPrevString; String aPrevString;
String a2PrevString; String a2PrevString;
Color aColor;
short nMyCat = SELPOS_NONE; short nMyCat = SELPOS_NONE;
short nIq=0; short nIq=0;
...@@ -784,7 +783,6 @@ short SvxNumberFormatShell::FillEListWithDateTime_Impl( SvStrings& rList,short n ...@@ -784,7 +783,6 @@ short SvxNumberFormatShell::FillEListWithDateTime_Impl( SvStrings& rList,short n
String aNewFormNInfo; String aNewFormNInfo;
String aPrevString; String aPrevString;
String a2PrevString; String a2PrevString;
Color aColor;
short nMyCat = SELPOS_NONE; short nMyCat = SELPOS_NONE;
short nIq=0; short nIq=0;
...@@ -869,7 +867,6 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( SvStrings& rList,short nS ...@@ -869,7 +867,6 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( SvStrings& rList,short nS
String aNewFormNInfo; String aNewFormNInfo;
String aPrevString; String aPrevString;
String a2PrevString; String a2PrevString;
Color aColor;
nCurCurrencyEntryPos=0; nCurCurrencyEntryPos=0;
...@@ -965,7 +962,6 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( SvStrings& rList,short n ...@@ -965,7 +962,6 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( SvStrings& rList,short n
String aNewFormNInfo; String aNewFormNInfo;
String aPrevString; String aPrevString;
String a2PrevString; String a2PrevString;
Color aColor;
short nMyCat = SELPOS_NONE; short nMyCat = SELPOS_NONE;
short nIq=0; short nIq=0;
...@@ -1155,8 +1151,6 @@ short SvxNumberFormatShell::FillEListWithUsD_Impl( SvStrings& rList, sal_uInt16 ...@@ -1155,8 +1151,6 @@ short SvxNumberFormatShell::FillEListWithUsD_Impl( SvStrings& rList, sal_uInt16
String aNewFormNInfo; String aNewFormNInfo;
String aPrevString; String aPrevString;
String a2PrevString; String a2PrevString;
Color aColor;
short nMyCat = SELPOS_NONE; short nMyCat = SELPOS_NONE;
short nIq=0; short nIq=0;
...@@ -1204,26 +1198,18 @@ short SvxNumberFormatShell::FillEListWithUsD_Impl( SvStrings& rList, sal_uInt16 ...@@ -1204,26 +1198,18 @@ short SvxNumberFormatShell::FillEListWithUsD_Impl( SvStrings& rList, sal_uInt16
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void SvxNumberFormatShell::GetPreviewString_Impl( String& rString, void SvxNumberFormatShell::GetPreviewString_Impl( String& rString, Color*& rpColor )
Color& rColor )
{ {
Color* pColor = NULL; rpColor = NULL;
// #50441# if a string was set in addition to the value, use it for text formats // #50441# if a string was set in addition to the value, use it for text formats
BOOL bUseText = ( eValType == SVX_VALUE_TYPE_STRING || BOOL bUseText = ( eValType == SVX_VALUE_TYPE_STRING ||
( aValStr.Len() && ( pFormatter->GetType(nCurFormatKey) & NUMBERFORMAT_TEXT ) ) ); ( aValStr.Len() && ( pFormatter->GetType(nCurFormatKey) & NUMBERFORMAT_TEXT ) ) );
if ( bUseText ) if ( bUseText )
pFormatter->GetOutputString( aValStr, nCurFormatKey, pFormatter->GetOutputString( aValStr, nCurFormatKey, rString, &rpColor );
rString, &pColor );
else else
pFormatter->GetOutputString( nValNum, nCurFormatKey, pFormatter->GetOutputString( nValNum, nCurFormatKey, rString, &rpColor );
rString, &pColor );
if ( pColor )
rColor = *pColor;
else
rColor = Color( COL_BLACK );
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -1311,20 +1297,16 @@ void SvxNumberFormatShell::CategoryToPos_Impl( short nCategory, sal_uInt16& rPos ...@@ -1311,20 +1297,16 @@ void SvxNumberFormatShell::CategoryToPos_Impl( short nCategory, sal_uInt16& rPos
#* #*
#************************************************************************/ #************************************************************************/
void SvxNumberFormatShell::MakePrevStringFromVal( const String& rFormatStr, void SvxNumberFormatShell::MakePrevStringFromVal(
String& rPreviewStr, const String& rFormatStr,
Color& rFontColor, String& rPreviewStr,
double nValue) Color*& rpFontColor,
double nValue)
{ {
Color* pColor = NULL; rpFontColor = NULL;
pFormatter->GetPreviewString( rFormatStr, nValue, rPreviewStr, &rpFontColor, eCurLanguage );
pFormatter->GetPreviewString( rFormatStr, nValue, rPreviewStr,
&pColor, eCurLanguage );
if ( pColor )
rFontColor = *pColor;
else
rFontColor = Color( COL_BLACK );
} }
/************************************************************************* /*************************************************************************
#* Member: GetComment4Entry Datum:30.10.97 #* Member: GetComment4Entry Datum:30.10.97
#*------------------------------------------------------------------------ #*------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment