Hi all,
I need your help to make my first patch. (conditional formattings with
unlimited number of rules).
Last week end I've restarted my work on a new clean bootstrap.
With these instructions :
http://wiki.documentfoundation.org/Development/How_to_build
Build was ok
Before making changes I've detected a strange bug :
cd install/program
./soffice --calc
File > New > Spreadsheet
Format > Cell > Numbers ==> crash !!!
Is-it only on my build ?
Michael say to me than many things have changed in source. I've seen ;-)
With Kompare, I've applyed manualy my change to the new sources files.
After, I've tried to make a patch from bootstrap. With "git diff " It's
not possible !
I think it's only possible on distinct modules ?
I add to this message, 2 patch files I've make with :
cd sc
git diff
s
file name
q
cd svx
idem
When I open these files with Kompare this message is display :
"The diff is malformed. Some lines could not be parsed and will not be
displayed in the diff view."
Strange !!!
I've try to open with "diffuse merge tool" and "KDiff3". error message
are also displayed !!!
Is the procedure correct to create patch ?
Thank for your help
Bob
Screen shot : http://archives.bobiciel.com/libo/condfrmt/condfrmt.jpg
Test file :
http://archives.bobiciel.com/libo/condfrmt/test_condfrmt_100.ods
ps: sorry for my googled translation english ...
diff --git a/svx/inc/svx/fntctrl.hxx b/svx/inc/svx/fntctrl.hxx
old mode 100755
new mode 100644
index c9a4c34..1251077
--- a/svx/inc/svx/fntctrl.hxx
+++ b/svx/inc/svx/fntctrl.hxx
@@ -33,6 +33,8 @@
#include <vcl/window.hxx>
#include <editeng/svxfont.hxx>
#include "svx/svxdllapi.h"
+#include <svl/itempool.hxx>
+#include <svl/itemset.hxx>
#include <rtl/ustring.hxx>
@@ -57,6 +59,8 @@ public:
virtual void StateChanged( StateChangedType nStateChange );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ void Init( const SfxItemSet& rSet );
+
// for reasons of efficiency not const
SvxFont& GetFont();
const SvxFont& GetFont() const;
@@ -70,9 +74,10 @@ public:
void ResetColor();
void SetBackColor( const Color& rColor );
void UseResourceText( sal_Bool bUse = sal_True );
+ void SetDrawBaseLine( sal_Bool bSet = sal_True );
void Paint( const Rectangle& );
- sal_Bool IsTwoLines() const;
+ sal_Bool IsTwoLines() const;
void SetTwoLines(sal_Bool bSet);
void SetBrackets(sal_Unicode cStart, sal_Unicode cEnd);
@@ -83,6 +88,12 @@ public:
void SetPreviewText( const ::rtl::OUString& rString );
void SetFontNameAsPreviewText();
+
+ void SetFontSize( const SfxItemSet& rSet, sal_uInt16 nSlot,
SvxFont& rFont );
+ void SetFont( const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont&
rFont );
+ void SetFontStyle( const SfxItemSet& rSet, sal_uInt16
nSlotPosture, sal_uInt16 nSlotWeight, SvxFont& rFont ); // posture/weight
+ void SetFontWidthScale( const SfxItemSet& rSet );
+ void SetFontEscapement( sal_uInt8 nProp, sal_uInt8 nEscProp,
short nEsc );
};
#endif // #ifndef _SVX_FNTCTRL_HXX
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
old mode 100755
new mode 100644
index a34cae1..fbe2817
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -54,6 +54,39 @@
#include <svx/dialogs.hrc>
#define TEXT_WIDTH 20
+// RMQ voir si tous ces include sont indispensables
+#include <editeng/editids.hrc>
+#include "editeng/fontitem.hxx"
+#include <editeng/postitem.hxx>
+#include <editeng/udlnitem.hxx>
+#include <editeng/crsditem.hxx>
+#include <editeng/cntritem.hxx>
+#include <editeng/langitem.hxx>
+#include <editeng/wghtitem.hxx>
+#include <editeng/fhgtitem.hxx>
+#include <editeng/shdditem.hxx>
+#include <editeng/escpitem.hxx>
+#include <editeng/prszitem.hxx>
+#include <editeng/wrlmitem.hxx>
+#include <editeng/cmapitem.hxx>
+#include <editeng/kernitem.hxx>
+#include <editeng/blnkitem.hxx>
+#include "editeng/flstitem.hxx"
+#include <editeng/akrnitem.hxx>
+#include <editeng/brshitem.hxx>
+#include <editeng/colritem.hxx>
+#include <editeng/emphitem.hxx>
+#include <editeng/charreliefitem.hxx>
+#include <editeng/twolinesitem.hxx>
+#include <editeng/charhiddenitem.hxx>
+#include <svl/stritem.hxx>
+#include <editeng/charscaleitem.hxx>
+#include <editeng/charrotateitem.hxx>
+
+// define ----------------------------------------------------------------
+
+#define ISITEMSET rSet.GetItemState(nWhich)>=SFX_ITEM_DEFAULT
+
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using ::com::sun::star::i18n::XBreakIterator;
@@ -137,6 +170,7 @@ class FontPrevWin_Impl
sal_Bool bSelection : 1,
bGetSelection : 1,
bUseResText : 1,
+ bDrawBaseLine : 1,
bTwoLines : 1,
bIsCJKUI : 1,
bIsCTLUI : 1,
@@ -150,7 +184,7 @@ public:
pColor( NULL ), pBackColor( 0 ), nAscent( 0 ),
cStartBracket( 0 ), cEndBracket( 0 ), nFontWidthScale( 100 ),
bSelection( sal_False ), bGetSelection( sal_False ), bUseResText( sal_False ),
- bTwoLines( sal_False ),
+ bDrawBaseLine( sal_True ), bTwoLines( sal_False ),
bIsCJKUI( sal_False ), bIsCTLUI( sal_False ),
bUseFontNameAsText( sal_False ), bTextInited( sal_False )
{
@@ -646,6 +680,13 @@ void SvxFontPrevWindow::UseResourceText( sal_Bool bUse )
// -----------------------------------------------------------------------
+void SvxFontPrevWindow::SetDrawBaseLine( sal_Bool bSet )
+{
+ pImpl->bDrawBaseLine = bSet;
+}
+
+// -----------------------------------------------------------------------
+
void SvxFontPrevWindow::Paint( const Rectangle& )
{
Printer* pPrinter = pImpl->pPrinter;
@@ -761,8 +802,11 @@ void SvxFontPrevWindow::Paint( const Rectangle& )
nResultWidth += nTextWidth;
long _nX = (aLogSize.Width() - nResultWidth) / 2;
- DrawLine( Point( 0, nY ), Point( _nX, nY ) );
- DrawLine( Point( _nX + nResultWidth, nY ), Point( aLogSize.Width(), nY ) );
+ if ( pImpl->bDrawBaseLine )
+ {
+ DrawLine( Point( 0, nY ), Point( _nX, nY ) );
+ DrawLine( Point( _nX + nResultWidth, nY ), Point( aLogSize.Width(), nY ) );
+ }
long nSmallAscent = pImpl->nAscent;
long nOffset = (nStdAscent - nSmallAscent ) / 2;
@@ -793,9 +837,11 @@ void SvxFontPrevWindow::Paint( const Rectangle& )
Color aLineCol = GetLineColor();
SetLineColor( rFont.GetColor() );
- DrawLine( Point( 0, nY ), Point( nX, nY ) );
- DrawLine( Point( nX + aTxtSize.Width(), nY ), Point( aLogSize.Width(), nY ) );
-
+ if ( pImpl->bDrawBaseLine )
+ {
+ DrawLine( Point( 0, nY ), Point( nX, nY ) );
+ DrawLine( Point( nX + aTxtSize.Width(), nY ), Point( aLogSize.Width(), nY ) );
+ }
SetLineColor( aLineCol );
Point aTmpPoint( nX, nY );
@@ -843,4 +889,335 @@ void SvxFontPrevWindow::AutoCorrectFontColor( void )
pImpl->aCTLFont.SetColor( aFontColor );
}
+// -----------------------------------------------------------------------
+
+void SvxFontPrevWindow::Init( const SfxItemSet& rSet )
+{
+ SvxFont& rFont = GetFont();
+ SvxFont& rCJKFont = GetCJKFont();
+ SvxFont& rCTLFont = GetCTLFont();
+
+ initFont(rFont);
+ initFont(rCJKFont);
+ initFont(rCTLFont);
+ InitSettings( sal_True, sal_True );
+
+ sal_uInt16 nWhich;
+ nWhich = rSet.GetPool()->GetWhich( SID_CHAR_DLG_PREVIEW_STRING );
+ if( ISITEMSET )
+ {
+ const SfxStringItem& rItem = ( SfxStringItem& ) rSet.Get( nWhich );
+ ::rtl::OUString aString = rItem.GetValue();
+ if( aString.getLength() != 0 )
+ SetPreviewText( aString );
+ else
+ SetFontNameAsPreviewText();
+// RMQ SetPreviewText( aString );
+ }
+
+ // Underline
+ FontUnderline eUnderline;
+ nWhich = rSet.GetPool()->GetWhich( SID_ATTR_CHAR_UNDERLINE );
+ if( ISITEMSET )
+ {
+ const SvxUnderlineItem& rItem = ( SvxUnderlineItem& ) rSet.Get( nWhich );
+ eUnderline = ( FontUnderline ) rItem.GetValue();
+ SetTextLineColor( rItem.GetColor() );
+ }
+ else
+ eUnderline = UNDERLINE_NONE;
+
+ rFont.SetUnderline( eUnderline );
+ rCJKFont.SetUnderline( eUnderline );
+ rCTLFont.SetUnderline( eUnderline );
+
+ // Overline
+ FontUnderline eOverline;
+ nWhich = rSet.GetPool()->GetWhich( SID_ATTR_CHAR_OVERLINE );
+ if( ISITEMSET )
+ {
+ const SvxOverlineItem& rItem = ( SvxOverlineItem& ) rSet.Get( nWhich );
+ eOverline = ( FontUnderline ) rItem.GetValue();
+ SetOverlineColor( rItem.GetColor() );
+ }
+ else
+ eOverline = UNDERLINE_NONE;
+
+ rFont.SetOverline( eOverline );
+ rCJKFont.SetOverline( eOverline );
+ rCTLFont.SetOverline( eOverline );
+
+ // Strikeout
+ FontStrikeout eStrikeout;
+ nWhich = rSet.GetPool()->GetWhich( SID_ATTR_CHAR_STRIKEOUT );
+ if( ISITEMSET )
+ {
+ const SvxCrossedOutItem& rItem = ( SvxCrossedOutItem& ) rSet.Get( nWhich );
+ eStrikeout = ( FontStrikeout ) rItem.GetValue();
+ }
+ else
+ eStrikeout = STRIKEOUT_NONE;
+
+ rFont.SetStrikeout( eStrikeout );
+ rCJKFont.SetStrikeout( eStrikeout );
+ rCTLFont.SetStrikeout( eStrikeout );
+
+ // WordLineMode
+ nWhich = rSet.GetPool()->GetWhich( SID_ATTR_CHAR_WORDLINEMODE );
+ if( ISITEMSET )
+ {
+ const SvxWordLineModeItem& rItem = ( SvxWordLineModeItem& ) rSet.Get( nWhich );
+ rFont.SetWordLineMode( rItem.GetValue() );
+ rCJKFont.SetWordLineMode( rItem.GetValue() );
+ rCTLFont.SetWordLineMode( rItem.GetValue() );
+ }
+
+ // Emphasis
+ nWhich = rSet.GetPool()->GetWhich( SID_ATTR_CHAR_EMPHASISMARK );
+ if( ISITEMSET )
+ {
+ const SvxEmphasisMarkItem& rItem = ( SvxEmphasisMarkItem& ) rSet.Get( nWhich );
+ FontEmphasisMark eMark = rItem.GetEmphasisMark();
+ rFont.SetEmphasisMark( eMark );
+ rCJKFont.SetEmphasisMark( eMark );
+ rCTLFont.SetEmphasisMark( eMark );
+ }
+
+ // Relief
+ nWhich = rSet.GetPool()->GetWhich( SID_ATTR_CHAR_RELIEF );
+ if( ISITEMSET )
+ {
+ const SvxCharReliefItem& rItem = ( SvxCharReliefItem& ) rSet.Get( nWhich );
+ FontRelief eFontRelief = ( FontRelief ) rItem.GetValue();
+ rFont.SetRelief( eFontRelief );
+ rCJKFont.SetRelief( eFontRelief );
+ rCTLFont.SetRelief( eFontRelief );
+ }
+
+ // Effects
+ nWhich = rSet.GetPool()->GetWhich( SID_ATTR_CHAR_CASEMAP );
+ if( ISITEMSET )
+ {
+ const SvxCaseMapItem& rItem = ( SvxCaseMapItem& ) rSet.Get( nWhich );
+ SvxCaseMap eCaseMap = ( SvxCaseMap ) rItem.GetValue();
+ rFont.SetCaseMap( eCaseMap );
+ rCJKFont.SetCaseMap( eCaseMap );
+ // #i78474# small caps do not exist in CTL fonts
+ rCTLFont.SetCaseMap( eCaseMap == SVX_CASEMAP_KAPITAELCHEN ? SVX_CASEMAP_NOT_MAPPED :
eCaseMap );
+ }
+
+ // Outline
+ nWhich = rSet.GetPool()->GetWhich( SID_ATTR_CHAR_CONTOUR );
+ if( ISITEMSET )
+ {
+ const SvxContourItem& rItem = ( SvxContourItem& ) rSet.Get( nWhich );
+ sal_Bool bOutline = rItem.GetValue();
+ rFont.SetOutline( bOutline );
+ rCJKFont.SetOutline( bOutline );
+ rCTLFont.SetOutline( bOutline );
+ }
+
+ // Shadow
+ nWhich = rSet.GetPool()->GetWhich( SID_ATTR_CHAR_SHADOWED );
+ if( ISITEMSET )
+ {
+ const SvxShadowedItem& rItem = ( SvxShadowedItem& ) rSet.Get( nWhich );
+ sal_Bool bShadow = rItem.GetValue();
+ rFont.SetShadow( bShadow );
+ rCJKFont.SetShadow( bShadow );
+ rCTLFont.SetShadow( bShadow );
+ }
+
+ // Background
+ sal_Bool bTransparent;
+sal_Bool m_bPreviewBackgroundToCharacter = sal_False; // RMQ
+ nWhich = rSet.GetPool()->GetWhich( m_bPreviewBackgroundToCharacter ? SID_ATTR_BRUSH :
SID_ATTR_BRUSH_CHAR );
+ if( ISITEMSET )
+ {
+ const SvxBrushItem& rBrush = ( SvxBrushItem& ) rSet.Get( nWhich );
+ const Color& rColor = rBrush.GetColor();
+ bTransparent = rColor.GetTransparency() > 0;
+ rFont.SetFillColor( rColor );
+ rCJKFont.SetFillColor( rColor );
+ rCTLFont.SetFillColor( rColor );
+ }
+ else
+ bTransparent = sal_True;
+
+ rFont.SetTransparent( bTransparent );
+ rCJKFont.SetTransparent( bTransparent );
+ rCTLFont.SetTransparent( bTransparent );
+
+ Color aBackCol( COL_TRANSPARENT );
+ if( !m_bPreviewBackgroundToCharacter )
+ {
+ nWhich = rSet.GetPool()->GetWhich( SID_ATTR_BRUSH );
+ if( ISITEMSET )
+ {
+ const SvxBrushItem& rBrush = ( SvxBrushItem& ) rSet.Get( nWhich );
+ if( GPOS_NONE == rBrush.GetGraphicPos() )
+ aBackCol = rBrush.GetColor();
+ }
+ }
+ SetBackColor( aBackCol );
+
+ // Font
+ SetFont( rSet, SID_ATTR_CHAR_FONT, rFont );
+ SetFont( rSet, SID_ATTR_CHAR_CJK_FONT, rCJKFont );
+ SetFont( rSet, SID_ATTR_CHAR_CTL_FONT, rCTLFont );
+
+ // Style
+ SetFontStyle( rSet, SID_ATTR_CHAR_POSTURE, SID_ATTR_CHAR_WEIGHT, rFont );
+ SetFontStyle( rSet, SID_ATTR_CHAR_CJK_POSTURE, SID_ATTR_CHAR_CJK_WEIGHT, rCJKFont );
+ SetFontStyle( rSet, SID_ATTR_CHAR_CTL_POSTURE, SID_ATTR_CHAR_CTL_WEIGHT, rCTLFont );
+
+ // Size
+ SetFontSize( rSet, SID_ATTR_CHAR_FONTHEIGHT, rFont );
+ SetFontSize( rSet, SID_ATTR_CHAR_CJK_FONTHEIGHT, rCJKFont );
+ SetFontSize( rSet, SID_ATTR_CHAR_CTL_FONTHEIGHT, rCTLFont );
+
+ // Color
+ nWhich = rSet.GetPool()->GetWhich( SID_ATTR_CHAR_COLOR );
+ if( ISITEMSET )
+ {
+ const SvxColorItem& rItem = ( SvxColorItem& ) rSet.Get( nWhich );
+ Color aCol( rItem.GetValue() );
+ rFont.SetColor( aCol );
+ rCJKFont.SetColor( aCol );
+ rCTLFont.SetColor( aCol );
+
+ AutoCorrectFontColor(); // handle color COL_AUTO
+ }
+
+ // Kerning
+ nWhich = rSet.GetPool()->GetWhich( SID_ATTR_CHAR_KERNING );
+ if( ISITEMSET )
+ {
+ const SvxKerningItem& rItem = ( SvxKerningItem& ) rSet.Get( nWhich );
+ short nKern = ( short )
+ LogicToLogic( rItem.GetValue(), ( MapUnit ) rSet.GetPool()->GetMetric(
nWhich ), MAP_TWIP );
+ rFont.SetFixKerning( nKern );
+ rCJKFont.SetFixKerning( nKern );
+ rCTLFont.SetFixKerning( nKern );
+ }
+
+ // Escapement
+ nWhich = rSet.GetPool()->GetWhich( SID_ATTR_CHAR_ESCAPEMENT );
+ const sal_uInt8 nProp = 100;
+ short nEsc;
+ sal_uInt8 nEscProp;
+ if( ISITEMSET )
+ {
+ const SvxEscapementItem& rItem = ( SvxEscapementItem& ) rSet.Get( nWhich );
+ nEsc = rItem.GetEsc();
+ nEscProp = rItem.GetProp();
+
+ if( nEsc == DFLT_ESC_AUTO_SUPER )
+ nEsc = DFLT_ESC_SUPER;
+ else if( nEsc == DFLT_ESC_AUTO_SUB )
+ nEsc = DFLT_ESC_SUB;
+ }
+ else
+ {
+ nEsc = 0;
+ nEscProp = 100;
+ }
+
+ SetFontEscapement( nProp, nEscProp, nEsc );
+
+ // Font width scale
+ SetFontWidthScale( rSet );
+
+ Invalidate();
+}
+
+// -----------------------------------------------------------------------
+
+void SvxFontPrevWindow::SetFontSize( const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont )
+{
+ sal_uInt16 nWhich = rSet.GetPool()->GetWhich( nSlot );
+ long nH;
+ if( rSet.GetItemState( nWhich ) >= SFX_ITEM_SET )
+ {
+ nH = LogicToLogic( ( ( SvxFontHeightItem& ) rSet.Get( nWhich ) ).GetHeight(),
+ ( MapUnit ) rSet.GetPool()->GetMetric( nWhich ),
+ MAP_TWIP );
+ }
+ else
+ nH = 240; // as default 12pt
+
+ rFont.SetSize( Size( 0, nH ) );
+}
+
+// -----------------------------------------------------------------------
+
+void SvxFontPrevWindow::SetFont( const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont )
+{
+ sal_uInt16 nWhich = rSet.GetPool()->GetWhich( nSlot );
+ if( ISITEMSET )
+ {
+ const SvxFontItem& rFontItem = ( SvxFontItem& ) rSet.Get( nWhich );
+ rFont.SetFamily( rFontItem.GetFamily() );
+ rFont.SetName( rFontItem.GetFamilyName() );
+ rFont.SetPitch( rFontItem.GetPitch() );
+ rFont.SetCharSet( rFontItem.GetCharSet() );
+ rFont.SetStyleName( rFontItem.GetStyleName() );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void SvxFontPrevWindow::SetFontStyle( const SfxItemSet& rSet, sal_uInt16 nPosture, sal_uInt16
nWeight, SvxFont& rFont )
+{
+ sal_uInt16 nWhich = rSet.GetPool()->GetWhich( nPosture );
+ if( ISITEMSET )
+ {
+ const SvxPostureItem& rItem = ( SvxPostureItem& ) rSet.Get( nWhich );
+ rFont.SetItalic( ( FontItalic ) rItem.GetValue() != ITALIC_NONE ? ITALIC_NORMAL :
ITALIC_NONE );
+ }
+
+ nWhich = rSet.GetPool()->GetWhich( nWeight );
+ if( ISITEMSET )
+ {
+ SvxWeightItem& rItem = ( SvxWeightItem& ) rSet.Get( nWhich );
+ rFont.SetWeight( ( FontWeight ) rItem.GetValue() != WEIGHT_NORMAL ? WEIGHT_BOLD :
WEIGHT_NORMAL );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void SvxFontPrevWindow::SetFontWidthScale( const SfxItemSet& rSet )
+{
+ sal_uInt16 nWhich = rSet.GetPool()->GetWhich( SID_ATTR_CHAR_SCALEWIDTH );
+ if( ISITEMSET )
+ {
+ const SvxCharScaleWidthItem& rItem = ( SvxCharScaleWidthItem& ) rSet.Get( nWhich );
+
+ SetFontWidthScale( rItem.GetValue() );
+ }
+}
+
+// -----------------------------------------------------------------------
+namespace
+{
+ // -----------------------------------------------------------------------
+ void setFontEscapement(SvxFont& _rFont,sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc )
+ {
+ _rFont.SetPropr( nProp );
+ _rFont.SetProprRel( nEscProp );
+ _rFont.SetEscapement( nEsc );
+ }
+ // -----------------------------------------------------------------------
+ // -----------------------------------------------------------------------
+}
+// -----------------------------------------------------------------------
+
+void SvxFontPrevWindow::SetFontEscapement( sal_uInt8 nProp, sal_uInt8 nEscProp, short nEsc )
+{
+ setFontEscapement(GetFont(),nProp,nEscProp,nEsc);
+ setFontEscapement(GetCJKFont(),nProp,nEscProp,nEsc);
+ setFontEscapement(GetCTLFont(),nProp,nEscProp,nEsc);
+ Invalidate();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 46f3a40..0c34b62 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -97,6 +97,7 @@ const sal_Unicode CHAR_ZWNBSP = 0x2060;
const SCSIZE MAXSUBTOTAL = 3;
const SCSIZE MAXQUERY = 8;
+const SCSIZE MAXCONDFRMT = 100;
#define SC_START_INDEX_DB_COLL 50000
// Above this threshold are indices
diff --git a/sc/source/ui/attrdlg/condfrmt.cxx b/sc/source/ui/attrdlg/condfrmt.cxx
index 378655b..c31c92c 100644
--- a/sc/source/ui/attrdlg/condfrmt.cxx
+++ b/sc/source/ui/attrdlg/condfrmt.cxx
@@ -72,6 +72,8 @@ ScConditionalFormatDlg::ScConditionalFormatDlg(
aFtCond1Template ( this, ScResId( FT_COND1_TEMPLATE ) ),
aLbCond1Template ( this, ScResId( LB_COND1_TEMPLATE ) ),
aBtnNew1 ( this, ScResId( BTN_COND1_NEW ) ),
+ aPreviewWin1 ( this, ScResId( WIN_CHAR_PREVIEW_COND1 ) ),
+ aFlSep1 ( this, ScResId( FL_SEP1 ) ),
aCbxCond2 ( this, ScResId( CBX_COND2 ) ),
aLbCond21 ( this, ScResId( LB_COND2_1 ) ),
@@ -84,6 +86,8 @@ ScConditionalFormatDlg::ScConditionalFormatDlg(
aFtCond2Template ( this, ScResId( FT_COND2_TEMPLATE ) ),
aLbCond2Template ( this, ScResId( LB_COND2_TEMPLATE ) ),
aBtnNew2 ( this, ScResId( BTN_COND2_NEW ) ),
+ aPreviewWin2 ( this, ScResId( WIN_CHAR_PREVIEW_COND2 ) ),
+ aFlSep2 ( this, ScResId( FL_SEP2 ) ),
aCbxCond3 ( this, ScResId( CBX_COND3 ) ),
aLbCond31 ( this, ScResId( LB_COND3_1 ) ),
@@ -96,35 +100,58 @@ ScConditionalFormatDlg::ScConditionalFormatDlg(
aFtCond3Template ( this, ScResId( FT_COND3_TEMPLATE ) ),
aLbCond3Template ( this, ScResId( LB_COND3_TEMPLATE ) ),
aBtnNew3 ( this, ScResId( BTN_COND3_NEW ) ),
+ aPreviewWin3 ( this, ScResId( WIN_CHAR_PREVIEW_COND3 ) ),
+ aScrollBar ( this, ScResId( LB_SCROLL ) ),
aBtnOk ( this, ScResId( BTN_OK ) ),
aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
+ aBtnInsert ( this, ScResId( BTN_INSERT ) ),
+
aBtnHelp ( this, ScResId( BTN_HELP ) ),
- aFlSep2 ( this, ScResId( FL_SEP2 ) ),
- aFlSep1 ( this, ScResId( FL_SEP1 ) ),
pEdActive ( NULL ),
bDlgLostFocus ( false ),
- pDoc ( pCurDoc )
+ pDoc ( pCurDoc ),
+ nCurrentOffset ( 0 )
{
Point aPos;
String aName;
SfxStyleSheetBase* pStyle;
+ const ScCondFormatEntry* pEntry;
+ for (SCSIZE i=0; i<MAXCONDFRMT; i++)
+ {
+ if ( pCurrentFormat && ( i < pCurrentFormat->Count() ) )
+ {
+ pEntry = pCurrentFormat->GetEntry( i );
+ pEntryLists[i] = new ScCondFormatEntry( *pEntry );
+ }
+ else
+ pEntryLists[i] = NULL;
+ }
+
FreeResource();
+ aScrollBar.SetEndScrollHdl( LINK( this, ScConditionalFormatDlg, ScrollHdl ) );
+ aScrollBar.SetScrollHdl( LINK( this, ScConditionalFormatDlg, ScrollHdl ) );
+ aScrollBar.SetRange( Range( 0, MAXCONDFRMT - 3 ) );
+ aScrollBar.SetLineSize( 1 );
+
// Handler setzen
aCbxCond1.SetClickHdl ( LINK( this, ScConditionalFormatDlg, ClickCond1Hdl ) );
aLbCond11.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond11Hdl ) );
aLbCond12.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond12Hdl ) );
+ aLbCond1Template.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond1TemplateHdl ) );
aCbxCond2.SetClickHdl ( LINK( this, ScConditionalFormatDlg, ClickCond2Hdl ) );
aLbCond21.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond21Hdl ) );
aLbCond22.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond22Hdl ) );
+ aLbCond2Template.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond2TemplateHdl ) );
aCbxCond3.SetClickHdl ( LINK( this, ScConditionalFormatDlg, ClickCond3Hdl ) );
aLbCond31.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond31Hdl ) );
aLbCond32.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond32Hdl ) );
+ aLbCond3Template.SetSelectHdl( LINK( this, ScConditionalFormatDlg, ChangeCond3TemplateHdl ) );
aBtnOk.SetClickHdl ( LINK( this, ScConditionalFormatDlg, BtnHdl ) );
//? aBtnCancel.SetClickHdl( LINK( this, ScConditionalFormatDlg, BtnHdl ) );
@@ -172,10 +199,13 @@ ScConditionalFormatDlg::ScConditionalFormatDlg(
aCond1Size3 = aEdtCond11.GetSizePixel();
aCond1Size2 = Size( aPos.X() - aCond1Pos2.X(), aCond1Size3.Height() );
aCond1Size1 = Size( aPos.X() - aCond1Pos1.X(), aCond1Size3.Height() );
+ aCbxCond1InitialText = aCbxCond1.GetText();
aCbxCond1.Check();
aLbCond11.SelectEntryPos( 0 );
aLbCond12.SelectEntryPos( 0 );
+ aPreviewWin1.SetDrawBaseLine( false );
+ aPreviewWin1.UseResourceText( true );
// Condition 2
aCond2Pos1 = aLbCond22.GetPosPixel(); // Position Edit ohne Listbox
@@ -187,10 +217,13 @@ ScConditionalFormatDlg::ScConditionalFormatDlg(
aCond2Size3 = aEdtCond21.GetSizePixel();
aCond2Size2 = Size( aPos.X() - aCond2Pos2.X(), aCond2Size3.Height() );
aCond2Size1 = Size( aPos.X() - aCond2Pos1.X(), aCond2Size3.Height() );
+ aCbxCond2InitialText = aCbxCond2.GetText();
aCbxCond2.Check( false );
aLbCond21.SelectEntryPos( 0 );
aLbCond22.SelectEntryPos( 0 );
+ aPreviewWin2.SetDrawBaseLine( false );
+ aPreviewWin2.UseResourceText( true );
// Condition 3
aCond3Pos1 = aLbCond32.GetPosPixel(); // Position Edit ohne Listbox
@@ -202,10 +235,13 @@ ScConditionalFormatDlg::ScConditionalFormatDlg(
aCond3Size3 = aEdtCond31.GetSizePixel();
aCond3Size2 = Size( aPos.X() - aCond3Pos2.X(), aCond3Size3.Height() );
aCond3Size1 = Size( aPos.X() - aCond3Pos1.X(), aCond3Size3.Height() );
+ aCbxCond3InitialText = aCbxCond3.GetText();
aCbxCond3.Check( false );
aLbCond31.SelectEntryPos( 0 );
aLbCond32.SelectEntryPos( 0 );
+ aPreviewWin3.SetDrawBaseLine( false );
+ aPreviewWin3.UseResourceText( true );
// Vorlagen aus pDoc holen
SfxStyleSheetIterator aStyleIter( pDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA );
@@ -228,6 +264,110 @@ ScConditionalFormatDlg::ScConditionalFormatDlg(
aLbCond2Template.SelectEntry( aName );
aLbCond3Template.SelectEntry( aName );
+ Refresh( nCurrentOffset );
+ Cond1Cheked( true );
+
+ ClickCond1Hdl( NULL );
+ ClickCond2Hdl( NULL );
+ ClickCond3Hdl( NULL );
+
+ ChangeCond12Hdl( NULL );
+ ChangeCond22Hdl( NULL );
+ ChangeCond32Hdl( NULL );
+
+ aEdtCond11.GrabFocus();
+ pEdActive = &aEdtCond11;
+ //@BugID 54702 Enablen/Disablen nur noch in Basisklasse
+ //SFX_APPWINDOW->Enable(); // Ref-Feld hat Focus
+// SFX_APPWINDOW->Disable();
+
+ aLbCond11.SetAccessibleRelationLabeledBy( &aCbxCond1 );
+ aLbCond12.SetAccessibleRelationLabeledBy( &aCbxCond1 );
+ aEdtCond11.SetAccessibleRelationLabeledBy( &aCbxCond1 );
+ aRbCond11.SetAccessibleRelationLabeledBy( &aCbxCond1 );
+
+ aLbCond21.SetAccessibleRelationLabeledBy( &aCbxCond2 );
+ aLbCond22.SetAccessibleRelationLabeledBy( &aCbxCond2 );
+ aEdtCond21.SetAccessibleRelationLabeledBy( &aCbxCond2 );
+ aRbCond21.SetAccessibleRelationLabeledBy( &aCbxCond2 );
+
+ aLbCond31.SetAccessibleRelationLabeledBy( &aCbxCond3 );
+ aLbCond32.SetAccessibleRelationLabeledBy( &aCbxCond3 );
+ aEdtCond31.SetAccessibleRelationLabeledBy( &aCbxCond3 );
+ aRbCond31.SetAccessibleRelationLabeledBy( &aCbxCond3 );
+ aLbCond11.SetAccessibleName( ScResId(LABEL_FORMARTTING_CONDITIONS) );
+ aLbCond12.SetAccessibleName( ScResId(LABEL_CONDITIONS) );
+ aEdtCond11.SetAccessibleName( ScResId(LABEL_CONDITION_VALUE) );
+
+ aLbCond21.SetAccessibleName( ScResId(LABEL_FORMARTTING_CONDITIONS) );
+ aLbCond22.SetAccessibleName( ScResId(LABEL_CONDITIONS) );
+ aEdtCond21.SetAccessibleName( ScResId(LABEL_CONDITION_VALUE) );
+
+ aLbCond31.SetAccessibleName( ScResId(LABEL_FORMARTTING_CONDITIONS) );
+ aLbCond32.SetAccessibleName( ScResId(LABEL_CONDITIONS) );
+ aEdtCond31.SetAccessibleName( ScResId(LABEL_CONDITION_VALUE) );
+}
+
+//----------------------------------------------------------------------------
+// Destruktor
+
+ScConditionalFormatDlg::~ScConditionalFormatDlg()
+{
+ for (SCSIZE i=0; i<MAXCONDFRMT; i++)
+ delete pEntryLists[i];
+}
+
+//----------------------------------------------------------------------------
+void ScConditionalFormatDlg::Cond1Cheked( sal_Bool bChecked )
+{
+ aCbxCond1.Check( bChecked );
+ aLbCond11.Enable( bChecked );
+ aLbCond12.Enable( bChecked );
+ aEdtCond11.Enable( bChecked );
+ aRbCond11.Enable( bChecked );
+ aFtCond1And.Enable( bChecked );
+ aEdtCond12.Enable( bChecked );
+ aRbCond12.Enable( bChecked );
+ aFtCond1Template.Enable( bChecked );
+ aLbCond1Template.Enable( bChecked );
+ aBtnNew1.Enable( bChecked );
+//RMQ aPreviewWin1.Enable( bChecked );
+}
+
+void ScConditionalFormatDlg::Cond2Cheked( sal_Bool bChecked )
+{
+ aCbxCond2.Check( bChecked );
+ aLbCond21.Enable( bChecked );
+ aLbCond22.Enable( bChecked );
+ aEdtCond21.Enable( bChecked );
+ aRbCond21.Enable( bChecked );
+ aFtCond2And.Enable( bChecked );
+ aEdtCond22.Enable( bChecked );
+ aRbCond22.Enable( bChecked );
+ aFtCond2Template.Enable( bChecked );
+ aLbCond2Template.Enable( bChecked );
+ aBtnNew2.Enable( bChecked );
+//RMQ aPreviewWin2.Enable( bChecked );
+}
+
+void ScConditionalFormatDlg::Cond3Cheked( sal_Bool bChecked )
+{
+ aCbxCond3.Check( bChecked );
+ aLbCond31.Enable( bChecked );
+ aLbCond32.Enable( bChecked );
+ aEdtCond31.Enable( bChecked );
+ aRbCond31.Enable( bChecked );
+ aFtCond3And.Enable( bChecked );
+ aEdtCond32.Enable( bChecked );
+ aRbCond32.Enable( bChecked );
+ aFtCond3Template.Enable( bChecked );
+ aLbCond3Template.Enable( bChecked );
+ aBtnNew3.Enable( bChecked );
+//RMQ aPreviewWin3.Enable( bChecked );
+}
+
+void ScConditionalFormatDlg::Refresh( sal_uInt16 nOffset )
+{
ScAddress aCurPos;
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
@@ -236,129 +376,197 @@ ScConditionalFormatDlg::ScConditionalFormatDlg(
aCurPos = ScAddress( pData->GetCurX(), pData->GetCurY(), pData->GetTabNo() );
}
- // Inhalt aus ConditionalFormat holen
- if ( pCurrentFormat )
- {
+ String aEmptyString = ScGlobal::GetEmptyString();
+
+ // update checkBox text
+ String aValNum1 = aEmptyString;
+ if ( (nOffset + 1) >= 10)
+ aValNum1 = String::CreateFromInt32( (nOffset + 1) / 10 );
+ aValNum1 += String::CreateFromAscii("~");
+ aValNum1 += String::CreateFromInt32( (nOffset + 1) % 10 );
+ String aVal1 = aCbxCond1InitialText;
+ aVal1.SearchAndReplace( String::CreateFromAscii( "~1" ), aValNum1 );
+ aCbxCond1.SetText(aVal1);
+
+ String aValNum2 = aEmptyString;
+ if ( (nOffset + 2) >= 10)
+ aValNum2 = String::CreateFromInt32( (nOffset + 2) / 10 );
+ aValNum2 += String::CreateFromAscii("~");
+ aValNum2 += String::CreateFromInt32( (nOffset + 2) % 10 );
+ String aVal2 = aCbxCond2InitialText;
+ aVal2.SearchAndReplace( String::CreateFromAscii( "~2" ), aValNum2 );
+ aCbxCond2.SetText(aVal2);
+
+ String aValNum3 = aEmptyString;
+ if ( (nOffset + 3) >= 10)
+ aValNum3 = String::CreateFromInt32( (nOffset + 3) / 10 );
+ aValNum3 += String::CreateFromAscii("~");
+ aValNum3 += String::CreateFromInt32( (nOffset + 3) % 10 );
+ String aVal3 = aCbxCond3InitialText;
+ aVal3.SearchAndReplace( String::CreateFromAscii( "~3" ), aValNum3 );
+ aCbxCond3.SetText(aVal3);
+
const ScCondFormatEntry* pEntry;
- if ( pCurrentFormat->Count() > 0 )
+ if ( pEntryLists[ nOffset + 0 ] )
{
- pEntry= pCurrentFormat->GetEntry( 0 );
+ Cond1Cheked( true );
+ pEntry= pEntryLists[ nOffset + 0 ];
aEdtCond11.SetText( pEntry->GetExpression( aCurPos, 0 ) );
aLbCond1Template.SelectEntry( pEntry->GetStyle() );
+ ChangeCond1TemplateHdl( NULL );
ScConditionMode eMode = pEntry->GetOperation();
if ( eMode == SC_COND_DIRECT ) // via Formel
- {
aLbCond11.SelectEntryPos( 1 );
- ChangeCond11Hdl( NULL );
- }
else if ( eMode == SC_COND_NONE ) // ???
;
else // via Werte
{
+ aLbCond11.SelectEntryPos( 0 );
aLbCond12.SelectEntryPos( sal::static_int_cast<sal_uInt16>( eMode ) );
if ( ( eMode == SC_COND_BETWEEN ) || ( eMode == SC_COND_NOTBETWEEN ) )
aEdtCond12.SetText( pEntry->GetExpression( aCurPos, 1 ) );
}
}
+ else
+ {
+ Cond1Cheked( false );
+ aLbCond11.SelectEntryPos( 0 );
+ aLbCond12.SelectEntryPos( 0 );
+ aLbCond1Template.SelectEntryPos( 0 );
+ aEdtCond11.SetText( aEmptyString );
+ aEdtCond12.SetText( aEmptyString );
+ }
+ ChangeCond11Hdl( NULL );
- if ( pCurrentFormat->Count() > 1 )
+ if ( pEntryLists[ nOffset + 1 ] )
{
- aCbxCond2.Check( sal_True );
- pEntry= pCurrentFormat->GetEntry( 1 );
+ Cond2Cheked( true );
+ pEntry= pEntryLists[ nOffset + 1 ];
aEdtCond21.SetText( pEntry->GetExpression( aCurPos, 0 ) );
aLbCond2Template.SelectEntry( pEntry->GetStyle() );
+ ChangeCond2TemplateHdl( NULL );
ScConditionMode eMode = pEntry->GetOperation();
if ( eMode == SC_COND_DIRECT ) // via Formel
- {
aLbCond21.SelectEntryPos( 1 );
- ChangeCond21Hdl( NULL );
- }
- else if ( eMode == SC_COND_NONE ) // ???
+ else if ( eMode == SC_COND_NONE ) // ???
;
else // via Werte
{
+ aLbCond21.SelectEntryPos( 0 );
aLbCond22.SelectEntryPos( sal::static_int_cast<sal_uInt16>( eMode ) );
if ( ( eMode == SC_COND_BETWEEN ) || ( eMode == SC_COND_NOTBETWEEN ) )
aEdtCond22.SetText( pEntry->GetExpression( aCurPos, 1 ) );
}
}
+ else
+ {
+ Cond2Cheked( false );
+ aLbCond21.SelectEntryPos( 0 );
+ aLbCond22.SelectEntryPos( 0 );
+ aLbCond2Template.SelectEntryPos( 0 );
+ aEdtCond21.SetText( aEmptyString );
+ aEdtCond22.SetText( aEmptyString );
+ }
+ ChangeCond21Hdl( NULL );
- if ( pCurrentFormat->Count() > 2 )
+ if ( pEntryLists[ nOffset + 2 ] )
{
- aCbxCond3.Check( sal_True );
- pEntry= pCurrentFormat->GetEntry( 2 );
+ Cond3Cheked( true );
+ pEntry= pEntryLists[ nOffset + 2 ];
aEdtCond31.SetText( pEntry->GetExpression( aCurPos, 0 ) );
aLbCond3Template.SelectEntry( pEntry->GetStyle() );
+ ChangeCond3TemplateHdl( NULL );
ScConditionMode eMode = pEntry->GetOperation();
if ( eMode == SC_COND_DIRECT ) // via Formel
- {
aLbCond31.SelectEntryPos( 1 );
- ChangeCond31Hdl( NULL );
- }
- else if ( eMode == SC_COND_NONE ) // ???
+ else if ( eMode == SC_COND_NONE ) // ???
;
else // via Werte
{
+ aLbCond31.SelectEntryPos( 0 );
aLbCond32.SelectEntryPos( sal::static_int_cast<sal_uInt16>( eMode ) );
if ( ( eMode == SC_COND_BETWEEN ) || ( eMode == SC_COND_NOTBETWEEN ) )
aEdtCond32.SetText( pEntry->GetExpression( aCurPos, 1 ) );
}
}
- }
-
- ClickCond1Hdl( NULL );
- ClickCond2Hdl( NULL );
- ClickCond3Hdl( NULL );
-
- ChangeCond12Hdl( NULL );
- ChangeCond22Hdl( NULL );
- ChangeCond32Hdl( NULL );
-
- aEdtCond11.GrabFocus();
- pEdActive = &aEdtCond11;
- //@BugID 54702 Enablen/Disablen nur noch in Basisklasse
- //SFX_APPWINDOW->Enable(); // Ref-Feld hat Focus
-// SFX_APPWINDOW->Disable();
-
- aLbCond11.SetAccessibleRelationLabeledBy( &aCbxCond1 );
- aLbCond12.SetAccessibleRelationLabeledBy( &aCbxCond1 );
- aEdtCond11.SetAccessibleRelationLabeledBy( &aCbxCond1 );
- aRbCond11.SetAccessibleRelationLabeledBy( &aCbxCond1 );
-
- aLbCond21.SetAccessibleRelationLabeledBy( &aCbxCond2 );
- aLbCond22.SetAccessibleRelationLabeledBy( &aCbxCond2 );
- aEdtCond21.SetAccessibleRelationLabeledBy( &aCbxCond2 );
- aRbCond21.SetAccessibleRelationLabeledBy( &aCbxCond2 );
+ else
+ {
+ Cond3Cheked( false );
+ aLbCond31.SelectEntryPos( 0 );
+ aLbCond32.SelectEntryPos( 0 );
+ aLbCond3Template.SelectEntryPos( 0 );
+ aEdtCond31.SetText( aEmptyString );
+ aEdtCond32.SetText( aEmptyString );
+ }
+ ChangeCond31Hdl( NULL );
+}
- aLbCond31.SetAccessibleRelationLabeledBy( &aCbxCond3 );
- aLbCond32.SetAccessibleRelationLabeledBy( &aCbxCond3 );
- aEdtCond31.SetAccessibleRelationLabeledBy( &aCbxCond3 );
- aRbCond31.SetAccessibleRelationLabeledBy( &aCbxCond3 );
- aLbCond11.SetAccessibleName( ScResId(LABEL_FORMARTTING_CONDITIONS) );
- aLbCond12.SetAccessibleName( ScResId(LABEL_CONDITIONS) );
- aEdtCond11.SetAccessibleName( ScResId(LABEL_CONDITION_VALUE) );
+//----------------------------------------------------------------------------
+void ScConditionalFormatDlg::UpdateValueList( sal_uInt16 nOffset )
+{
+ ScConditionMode eOper;
+ String sExpr1;
+ String sExpr2;
+ String sStyle;
+ ScAddress aCurPos;
- aLbCond21.SetAccessibleName( ScResId(LABEL_FORMARTTING_CONDITIONS) );
- aLbCond22.SetAccessibleName( ScResId(LABEL_CONDITIONS) );
- aEdtCond21.SetAccessibleName( ScResId(LABEL_CONDITION_VALUE) );
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if (pViewShell)
+ {
+ ScViewData* pData = pViewShell->GetViewData();
+ aCurPos = ScAddress( pData->GetCurX(), pData->GetCurY(), pData->GetTabNo() );
+ }
- aLbCond31.SetAccessibleName( ScResId(LABEL_FORMARTTING_CONDITIONS) );
- aLbCond32.SetAccessibleName( ScResId(LABEL_CONDITIONS) );
- aEdtCond31.SetAccessibleName( ScResId(LABEL_CONDITION_VALUE) );
-}
+ delete pEntryLists[ nOffset + 0 ];
+ if ( aCbxCond1.IsChecked() )
+ {
+ if ( aLbCond11.GetSelectEntryPos() == 1 ) // via Formel
+ eOper = SC_COND_DIRECT;
+ else
+ eOper = (ScConditionMode)aLbCond12.GetSelectEntryPos();
+ sExpr1 = aEdtCond11.GetText();
+ sExpr2 = aEdtCond12.GetText();
+ sStyle = aLbCond1Template.GetSelectEntry();
+ pEntryLists[ nOffset + 0 ] = new ScCondFormatEntry( eOper, sExpr1, sExpr2, pDoc, aCurPos,
sStyle );
+ }
+ else
+ pEntryLists[ nOffset + 0 ] = NULL;
-//----------------------------------------------------------------------------
-// Destruktor
+ delete pEntryLists[ nOffset + 1 ];
+ if ( aCbxCond2.IsChecked() )
+ {
+ if ( aLbCond21.GetSelectEntryPos() == 1 ) // via Formel???
+ eOper = SC_COND_DIRECT;
+ else
+ eOper = (ScConditionMode)aLbCond22.GetSelectEntryPos();
+ sExpr1 = aEdtCond21.GetText();
+ sExpr2 = aEdtCond22.GetText();
+ sStyle = aLbCond2Template.GetSelectEntry();
+ pEntryLists[ nOffset + 1 ] = new ScCondFormatEntry( eOper, sExpr1, sExpr2, pDoc, aCurPos,
sStyle );
+ }
+ else
+ pEntryLists[ nOffset + 1 ] = NULL;
-ScConditionalFormatDlg::~ScConditionalFormatDlg()
-{
+ delete pEntryLists[ nOffset + 2 ];
+ if ( aCbxCond3.IsChecked() )
+ {
+ if ( aLbCond31.GetSelectEntryPos() == 1 ) // via Formel???
+ eOper = SC_COND_DIRECT;
+ else
+ eOper = (ScConditionMode)aLbCond32.GetSelectEntryPos();
+ sExpr1 = aEdtCond31.GetText();
+ sExpr2 = aEdtCond32.GetText();
+ sStyle = aLbCond3Template.GetSelectEntry();
+ pEntryLists[ nOffset + 2 ] = new ScCondFormatEntry( eOper, sExpr1, sExpr2, pDoc, aCurPos,
sStyle );
+ }
+ else
+ pEntryLists[ nOffset + 2 ] = NULL;
}
//----------------------------------------------------------------------------
-
void ScConditionalFormatDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
{
if ( pEdActive )
@@ -424,12 +632,6 @@ void ScConditionalFormatDlg::SetActive()
void ScConditionalFormatDlg::GetConditionalFormat( ScConditionalFormat& rCndFmt )
{
- ScConditionMode eOper;
- String sExpr1;
- String sExpr2;
- String sStyle;
- ScAddress aCurPos;
-
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
if (pViewShell)
{
@@ -437,47 +639,12 @@ void ScConditionalFormatDlg::GetConditionalFormat( ScConditionalFormat&
rCndFmt
ScRangeListRef rRanges;
pData->GetMultiArea( rRanges );
rCndFmt.AddRangeInfo( rRanges );
- aCurPos = ScAddress( pData->GetCurX(), pData->GetCurY(), pData->GetTabNo() );
- }
-
- if ( aCbxCond1.IsChecked() )
- {
- if ( aLbCond11.GetSelectEntryPos() == 1 ) // via Formel
- eOper = SC_COND_DIRECT;
- else
- eOper = (ScConditionMode)aLbCond12.GetSelectEntryPos();
- sExpr1 = aEdtCond11.GetText();
- sExpr2 = aEdtCond12.GetText();
- sStyle = aLbCond1Template.GetSelectEntry();
- ScCondFormatEntry aNewEntry( eOper, sExpr1, sExpr2, pDoc, aCurPos, sStyle );
- rCndFmt.AddEntry( aNewEntry );
- }
-
- if ( aCbxCond2.IsChecked() )
- {
- if ( aLbCond21.GetSelectEntryPos() == 1 ) // via Formel???
- eOper = SC_COND_DIRECT;
- else
- eOper = (ScConditionMode)aLbCond22.GetSelectEntryPos();
- sExpr1 = aEdtCond21.GetText();
- sExpr2 = aEdtCond22.GetText();
- sStyle = aLbCond2Template.GetSelectEntry();
- ScCondFormatEntry aNewEntry( eOper, sExpr1, sExpr2, pDoc, aCurPos, sStyle );
- rCndFmt.AddEntry( aNewEntry );
}
- if ( aCbxCond3.IsChecked() )
- {
- if ( aLbCond31.GetSelectEntryPos() == 1 ) // via Formel???
- eOper = SC_COND_DIRECT;
- else
- eOper = (ScConditionMode)aLbCond32.GetSelectEntryPos();
- sExpr1 = aEdtCond31.GetText();
- sExpr2 = aEdtCond32.GetText();
- sStyle = aLbCond3Template.GetSelectEntry();
- ScCondFormatEntry aNewEntry( eOper, sExpr1, sExpr2, pDoc, aCurPos, sStyle );
- rCndFmt.AddEntry( aNewEntry );
- }
+ UpdateValueList( nCurrentOffset );
+ for (SCSIZE i=0; i<MAXCONDFRMT; i++)
+ if ( pEntryLists[i] )
+ rCndFmt.AddEntry( *pEntryLists[i] );
}
//----------------------------------------------------------------------------
@@ -492,23 +659,35 @@ sal_Bool ScConditionalFormatDlg::Close()
// Handler:
//----------------------------------------------------------------------------
+IMPL_LINK( ScConditionalFormatDlg, ScrollHdl, ScrollBar*, EMPTYARG )
+{
+ SliderMoved();
+ return 0;
+}
+
+void ScConditionalFormatDlg::SliderMoved()
+{
+ sal_uInt16 nOffset = GetSliderPos();
+ if ( nOffset != nCurrentOffset )
+ {
+ UpdateValueList( nCurrentOffset );
+ Refresh( nOffset );
+ }
+ nCurrentOffset = nOffset;
+}
+sal_uInt16 ScConditionalFormatDlg::GetSliderPos()
+{
+ return (sal_uInt16) aScrollBar.GetThumbPos();
+}
+
+//----------------------------------------------------------------------------
// Enabled/Disabled Condition1-Controls
IMPL_LINK( ScConditionalFormatDlg, ClickCond1Hdl, void *, EMPTYARG )
{
sal_Bool bChecked = aCbxCond1.IsChecked();
- aLbCond11.Enable( bChecked );
- aLbCond12.Enable( bChecked );
- aEdtCond11.Enable( bChecked );
- aRbCond11.Enable( bChecked );
- aFtCond1And.Enable( bChecked );
- aEdtCond12.Enable( bChecked );
- aRbCond12.Enable( bChecked );
- aFtCond1Template.Enable( bChecked );
- aLbCond1Template.Enable( bChecked );
- aBtnNew1.Enable( bChecked );
-
+ Cond1Cheked( bChecked );
return( 0L );
}
@@ -580,23 +759,27 @@ IMPL_LINK( ScConditionalFormatDlg, ChangeCond12Hdl, void *, EMPTYARG )
}
//----------------------------------------------------------------------------
+
+IMPL_LINK( ScConditionalFormatDlg, ChangeCond1TemplateHdl, void *, EMPTYARG )
+{
+ String aStyleName = aLbCond1Template.GetSelectEntry();
+ SfxStyleSheetBase* pStyleSheet = pDoc->GetStyleSheetPool()->Find( aStyleName,
SFX_STYLE_FAMILY_PARA );
+ if ( pStyleSheet )
+ {
+ const SfxItemSet& rSet = pStyleSheet->GetItemSet();
+ aPreviewWin1.Init( rSet );
+ }
+ return( 0L );
+}
+
+//----------------------------------------------------------------------------
// Enabled/Disabled Condition2-Controls
IMPL_LINK( ScConditionalFormatDlg, ClickCond2Hdl, void *, EMPTYARG )
{
sal_Bool bChecked = aCbxCond2.IsChecked();
- aLbCond21.Enable( bChecked );
- aLbCond22.Enable( bChecked );
- aEdtCond21.Enable( bChecked );
- aRbCond21.Enable( bChecked );
- aFtCond2And.Enable( bChecked );
- aEdtCond22.Enable( bChecked );
- aRbCond22.Enable( bChecked );
- aFtCond2Template.Enable( bChecked );
- aLbCond2Template.Enable( bChecked );
- aBtnNew2.Enable( bChecked );
-
+ Cond2Cheked( bChecked );
return( 0L );
}
@@ -668,23 +851,27 @@ IMPL_LINK( ScConditionalFormatDlg, ChangeCond22Hdl, void *, EMPTYARG )
}
//----------------------------------------------------------------------------
+
+IMPL_LINK( ScConditionalFormatDlg, ChangeCond2TemplateHdl, void *, EMPTYARG )
+{
+ String aStyleName = aLbCond2Template.GetSelectEntry();
+ SfxStyleSheetBase* pStyleSheet = pDoc->GetStyleSheetPool()->Find( aStyleName,
SFX_STYLE_FAMILY_PARA );
+ if ( pStyleSheet )
+ {
+ const SfxItemSet& rSet = pStyleSheet->GetItemSet();
+ aPreviewWin2.Init( rSet );
+ }
+ return( 0L );
+}
+
+//----------------------------------------------------------------------------
// Enabled/Disabled Condition3-Controls
IMPL_LINK( ScConditionalFormatDlg, ClickCond3Hdl, void *, EMPTYARG )
{
sal_Bool bChecked = aCbxCond3.IsChecked();
- aLbCond31.Enable( bChecked );
- aLbCond32.Enable( bChecked );
- aEdtCond31.Enable( bChecked );
- aRbCond31.Enable( bChecked );
- aFtCond3And.Enable( bChecked );
- aEdtCond32.Enable( bChecked );
- aRbCond32.Enable( bChecked );
- aFtCond3Template.Enable( bChecked );
- aLbCond3Template.Enable( bChecked );
- aBtnNew3.Enable( bChecked );
-
+ Cond3Cheked( bChecked );
return( 0L );
}
@@ -757,6 +944,20 @@ IMPL_LINK( ScConditionalFormatDlg, ChangeCond32Hdl, void *, EMPTYARG )
//----------------------------------------------------------------------------
+IMPL_LINK( ScConditionalFormatDlg, ChangeCond3TemplateHdl, void *, EMPTYARG )
+{
+ String aStyleName = aLbCond3Template.GetSelectEntry();
+ SfxStyleSheetBase* pStyleSheet = pDoc->GetStyleSheetPool()->Find( aStyleName,
SFX_STYLE_FAMILY_PARA );
+ if ( pStyleSheet )
+ {
+ const SfxItemSet& rSet = pStyleSheet->GetItemSet();
+ aPreviewWin3.Init( rSet );
+ }
+ return( 0L );
+}
+
+//----------------------------------------------------------------------------
+
IMPL_LINK( ScConditionalFormatDlg, GetFocusHdl, Control*, pCtrl )
{
if( (pCtrl == (Control*)&aEdtCond11) || (pCtrl == (Control*)&aRbCond11) )
@@ -863,6 +1064,10 @@ IMPL_LINK( ScConditionalFormatDlg, NewBtnHdl, PushButton*, pBtn )
pListBox = &aLbCond3Template;
pListBox->SelectEntry( aNewStyle );
+
+ ChangeCond1TemplateHdl( NULL );
+ ChangeCond2TemplateHdl( NULL );
+ ChangeCond3TemplateHdl( NULL );
}
return 0;
diff --git a/sc/source/ui/inc/condfrmt.hrc b/sc/source/ui/inc/condfrmt.hrc
index 01db4be..0452018 100644
--- a/sc/source/ui/inc/condfrmt.hrc
+++ b/sc/source/ui/inc/condfrmt.hrc
@@ -63,6 +63,13 @@
#define FL_SEP1 41
#define FL_SEP2 42
+#define LB_SCROLL 43
+
+#define WIN_CHAR_PREVIEW_COND1 44
+#define WIN_CHAR_PREVIEW_COND2 45
+#define WIN_CHAR_PREVIEW_COND3 46
+#define BTN_INSERT 47
+
//IAccessibility2 Implementation 2009-----
#define LABEL_FORMARTTING_CONDITIONS 5043
#define LABEL_CONDITIONS 5044
diff --git a/sc/source/ui/inc/condfrmt.hxx b/sc/source/ui/inc/condfrmt.hxx
index b5e9ed9..6ba788d 100644
--- a/sc/source/ui/inc/condfrmt.hxx
+++ b/sc/source/ui/inc/condfrmt.hxx
@@ -33,6 +33,7 @@
#include "anyrefdg.hxx"
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
+#include <svx/fntctrl.hxx>
class ScDocument;
@@ -56,6 +57,8 @@ public:
virtual void AddRefEntry();
virtual sal_Bool IsRefInputMode() const;
virtual void SetActive();
+ void SliderMoved();
+ sal_uInt16 GetSliderPos();
virtual sal_Bool Close();
private:
@@ -70,6 +73,9 @@ private:
FixedText aFtCond1Template;
ListBox aLbCond1Template;
PushButton aBtnNew1;
+ SvxFontPrevWindow aPreviewWin1;
+ FixedLine aFlSep1;
+
CheckBox aCbxCond2;
ListBox aLbCond21;
ListBox aLbCond22;
@@ -81,6 +87,9 @@ private:
FixedText aFtCond2Template;
ListBox aLbCond2Template;
PushButton aBtnNew2;
+ SvxFontPrevWindow aPreviewWin2;
+ FixedLine aFlSep2;
+
CheckBox aCbxCond3;
ListBox aLbCond31;
ListBox aLbCond32;
@@ -92,9 +101,12 @@ private:
FixedText aFtCond3Template;
ListBox aLbCond3Template;
PushButton aBtnNew3;
+ SvxFontPrevWindow aPreviewWin3;
+ ScrollBar aScrollBar;
OKButton aBtnOk;
CancelButton aBtnCancel;
+ PushButton aBtnInsert;
HelpButton aBtnHelp;
Point aCond1Pos1;
@@ -120,31 +132,45 @@ private:
Size aCond3Size1;
Size aCond3Size2;
Size aCond3Size3;
- FixedLine aFlSep2;
- FixedLine aFlSep1;
+
formula::RefEdit* pEdActive;
sal_Bool bDlgLostFocus;
ScDocument* pDoc;
+ ScCondFormatEntry* pEntryLists[MAXCONDFRMT];
+ sal_uInt16 nCurrentOffset;
+ String aCbxCond1InitialText;
+ String aCbxCond2InitialText;
+ String aCbxCond3InitialText;
#ifdef _CONDFRMT_CXX
void GetConditionalFormat( ScConditionalFormat& rCndFmt );
+ void Refresh( sal_uInt16 nOffset );
+ void UpdateValueList ( sal_uInt16 nOffset );
+ void Cond1Cheked( sal_Bool bChecked );
+ void Cond2Cheked( sal_Bool bChecked );
+ void Cond3Cheked( sal_Bool bChecked );
DECL_LINK( ClickCond1Hdl, void * );
DECL_LINK( ChangeCond11Hdl, void * );
DECL_LINK( ChangeCond12Hdl, void * );
+ DECL_LINK( ChangeCond1TemplateHdl, void * );
DECL_LINK( ClickCond2Hdl, void * );
DECL_LINK( ChangeCond21Hdl, void * );
DECL_LINK( ChangeCond22Hdl, void * );
+ DECL_LINK( ChangeCond2TemplateHdl, void * );
DECL_LINK( ClickCond3Hdl, void * );
DECL_LINK( ChangeCond31Hdl, void * );
DECL_LINK( ChangeCond32Hdl, void * );
+ DECL_LINK( ChangeCond3TemplateHdl, void * );
DECL_LINK( GetFocusHdl, Control* );
DECL_LINK( LoseFocusHdl, Control* );
DECL_LINK( BtnHdl, PushButton* );
DECL_LINK( NewBtnHdl, PushButton* );
+ DECL_LINK( ScrollHdl, ScrollBar* );
+
#endif // _CONDFRMT_CXX
};
diff --git a/sc/source/ui/src/condfrmt.src b/sc/source/ui/src/condfrmt.src
index bc10d1f..32e6f74 100644
--- a/sc/source/ui/src/condfrmt.src
+++ b/sc/source/ui/src/condfrmt.src
@@ -31,7 +31,7 @@ ModelessDialog RID_SCDLG_CONDFORMAT
{
OutputSize = TRUE ;
SVLook = TRUE ;
- Size = MAP_APPFONT ( 316 , 161 ) ;
+ Size = MAP_APPFONT ( 326 , 161 ) ;
Moveable = TRUE ;
Closeable = TRUE ;
HelpId = HID_SCDLG_CONDFORMAT ;
@@ -136,10 +136,17 @@ ModelessDialog RID_SCDLG_CONDFORMAT
DropDown = TRUE ;
Sort = TRUE ;
};
+ Window WIN_CHAR_PREVIEW_COND1
+ {
+ Border = FALSE ;
+ Pos = MAP_APPFONT ( 124 , 34 ) ;
+ Size = MAP_APPFONT ( 41 , 14 ) ;
+ Text [ en-US ] = "Example";
+ };
PushButton BTN_COND1_NEW
{
HelpID = "sc:PushButton:RID_SCDLG_CONDFORMAT:BTN_COND1_NEW";
- Pos = MAP_APPFONT ( 124 , 34 ) ;
+ Pos = MAP_APPFONT ( 169 , 34 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~New Style..." ;
@@ -249,10 +256,17 @@ ModelessDialog RID_SCDLG_CONDFORMAT
DropDown = TRUE ;
Sort = TRUE ;
};
+ Window WIN_CHAR_PREVIEW_COND2
+ {
+ Border = FALSE ;
+ Pos = MAP_APPFONT ( 124 , 88 ) ;
+ Size = MAP_APPFONT ( 41 , 14 ) ;
+ Text [ en-US ] = "Example";
+ };
PushButton BTN_COND2_NEW
{
HelpID = "sc:PushButton:RID_SCDLG_CONDFORMAT:BTN_COND2_NEW";
- Pos = MAP_APPFONT ( 124 , 88 ) ;
+ Pos = MAP_APPFONT ( 169 , 88 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Ne~w Style..." ;
@@ -362,30 +376,51 @@ ModelessDialog RID_SCDLG_CONDFORMAT
DropDown = TRUE ;
Sort = TRUE ;
};
+ Window WIN_CHAR_PREVIEW_COND3
+ {
+ Border = FALSE ;
+ Pos = MAP_APPFONT ( 124 , 142 ) ;
+ Size = MAP_APPFONT ( 41 , 14 ) ;
+ Text [ en-US ] = "Example";
+ };
PushButton BTN_COND3_NEW
{
HelpID = "sc:PushButton:RID_SCDLG_CONDFORMAT:BTN_COND3_NEW";
- Pos = MAP_APPFONT ( 124 , 142 ) ;
+ Pos = MAP_APPFONT ( 169 , 142 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
Text [ en-US ] = "New ~Style..." ;
};
+ ScrollBar LB_SCROLL
+ {
+ Pos = MAP_APPFONT ( 260, 6 ) ;
+ Size = MAP_APPFONT ( 10 , 150 ) ;
+ TabStop = TRUE ;
+ VScroll = TRUE ;
+ };
OKButton BTN_OK
{
- Pos = MAP_APPFONT ( 260 , 6 ) ;
+ Pos = MAP_APPFONT ( 270 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
};
CancelButton BTN_CANCEL
{
- Pos = MAP_APPFONT ( 260 , 23 ) ;
+ Pos = MAP_APPFONT ( 270 , 23 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ PushButton BTN_INSERT
+ {
+ Pos = MAP_APPFONT ( 270 , 57 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
+ Text [ en-US ] = "~Insert" ;
};
HelpButton BTN_HELP
{
- Pos = MAP_APPFONT ( 260 , 43 ) ;
+ Pos = MAP_APPFONT ( 270 , 74 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.