[ooo-build-commit] .: patches/dev300
Kohei Yoshida
kohei at kemper.freedesktop.org
Fri May 28 06:56:57 PDT 2010
patches/dev300/calc-distributed-cell-text-cui.diff | 224 ++++++++++++++++++++-
1 file changed, 223 insertions(+), 1 deletion(-)
New commits:
commit 57b5ced7f8b2f65b06dc0099fd614c68bad07af0
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Fri May 28 09:55:47 2010 -0400
Ported missing hunks from the 3.2.1 branch.
* patches/dev300/calc-distributed-cell-text-cui.diff: pretty much
all of dialog pane related changes were missing. They are now
recovered, and the feature seems back to working again.
diff --git a/patches/dev300/calc-distributed-cell-text-cui.diff b/patches/dev300/calc-distributed-cell-text-cui.diff
index 1640d9c..b584821 100644
--- a/patches/dev300/calc-distributed-cell-text-cui.diff
+++ b/patches/dev300/calc-distributed-cell-text-cui.diff
@@ -1,5 +1,26 @@
+diff --git cui/source/inc/align.hxx cui/source/inc/align.hxx
+index 84c3cd6..b585c0c 100644
+--- cui/source/inc/align.hxx
++++ cui/source/inc/align.hxx
+@@ -54,6 +54,7 @@ public:
+ static SfxTabPage* Create( Window* pParent, const SfxItemSet& rAttrSet );
+ static USHORT* GetRanges();
+
++ virtual BOOL FillItemSet( SfxItemSet& rSet );
+ virtual void Reset( const SfxItemSet& rSet );
+ virtual int DeactivatePage( SfxItemSet* pSet );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+@@ -64,6 +65,8 @@ private:
+ void InitVsRefEgde();
+ void UpdateEnableControls();
+
++ bool HasAlignmentChanged( const SfxItemSet& rNew, USHORT nWhich ) const;
++
+ DECL_LINK( UpdateEnableHdl, void* );
+
+ private:
diff --git cui/source/tabpages/align.cxx cui/source/tabpages/align.cxx
-index 0735c11..c37463e 100644
+index 0735c11..693d831 100644
--- cui/source/tabpages/align.cxx
+++ cui/source/tabpages/align.cxx
@@ -40,6 +40,7 @@
@@ -10,3 +31,204 @@ index 0735c11..c37463e 100644
#include <dialmgr.hxx>
#include <svx/dlgutil.hxx>
#include <tools/shl.hxx>
+@@ -70,6 +71,7 @@ static const HorJustConnection::MapEntryType s_pHorJustMap[] =
+ { ALIGNDLG_HORALIGN_RIGHT, SVX_HOR_JUSTIFY_RIGHT },
+ { ALIGNDLG_HORALIGN_BLOCK, SVX_HOR_JUSTIFY_BLOCK },
+ { ALIGNDLG_HORALIGN_FILL, SVX_HOR_JUSTIFY_REPEAT },
++ { ALIGNDLG_HORALIGN_DISTRIBUTED, SVX_HOR_JUSTIFY_BLOCK },
+ { LISTBOX_ENTRY_NOTFOUND, SVX_HOR_JUSTIFY_STANDARD }
+ };
+
+@@ -84,6 +86,8 @@ static const VerJustConnection::MapEntryType s_pVerJustMap[] =
+ { ALIGNDLG_VERALIGN_TOP, SVX_VER_JUSTIFY_TOP },
+ { ALIGNDLG_VERALIGN_MID, SVX_VER_JUSTIFY_CENTER },
+ { ALIGNDLG_VERALIGN_BOTTOM, SVX_VER_JUSTIFY_BOTTOM },
++ { ALIGNDLG_VERALIGN_BLOCK, SVX_VER_JUSTIFY_BLOCK },
++ { ALIGNDLG_VERALIGN_DISTRIBUTED, SVX_VER_JUSTIFY_BLOCK },
+ { LISTBOX_ENTRY_NOTFOUND, SVX_VER_JUSTIFY_STANDARD }
+ };
+
+@@ -118,6 +122,48 @@ static USHORT s_pRanges[] =
+
+ // ============================================================================
+
++namespace {
++
++template<typename _JustContainerType, typename _JustEnumType>
++void lcl_MaybeResetAlignToDistro(
++ ListBox& rLB, USHORT nListPos, const SfxItemSet& rCoreAttrs, USHORT nWhichAlign, USHORT nWhichJM, _JustEnumType eBlock)
++{
++ const SfxPoolItem* pItem;
++ if (rCoreAttrs.GetItemState(nWhichAlign, TRUE, &pItem) != SFX_ITEM_SET)
++ // alignment not set.
++ return;
++
++ const SfxEnumItem* p = static_cast<const SfxEnumItem*>(pItem);
++ _JustContainerType eVal = static_cast<_JustContainerType>(p->GetEnumValue());
++ if (eVal != eBlock)
++ // alignment is not 'justify'. No need to go further.
++ return;
++
++ if (rCoreAttrs.GetItemState(nWhichJM, TRUE, &pItem) != SFX_ITEM_SET)
++ // justification method is not set.
++ return;
++
++ p = static_cast<const SfxEnumItem*>(pItem);
++ SvxCellJustifyMethod eMethod = static_cast<SvxCellJustifyMethod>(p->GetEnumValue());
++ if (eMethod == SVX_JUSTIFY_METHOD_DISTRIBUTE)
++ // Select the 'distribute' entry in the specified list box.
++ rLB.SelectEntryPos(nListPos);
++}
++
++void lcl_SetJustifyMethodToItemSet(SfxItemSet& rSet, USHORT nWhichJM, const ListBox& rLB, USHORT nListPos)
++{
++ SvxCellJustifyMethod eJM = SVX_JUSTIFY_METHOD_AUTO;
++ if (rLB.GetSelectEntryPos() == nListPos)
++ eJM = SVX_JUSTIFY_METHOD_DISTRIBUTE;
++
++ SvxJustifyMethodItem aItem(eJM, nWhichJM);
++ rSet.Put(aItem);
++}
++
++}
++
++// ============================================================================
++
+ AlignmentTabPage::AlignmentTabPage( Window* pParent, const SfxItemSet& rCoreAttrs ) :
+
+ SfxTabPage( pParent, CUI_RES( RID_SVXPAGE_ALIGNMENT ), rCoreAttrs ),
+@@ -213,9 +259,43 @@ USHORT* AlignmentTabPage::GetRanges()
+ return s_pRanges;
+ }
+
++BOOL AlignmentTabPage::FillItemSet( SfxItemSet& rSet )
++{
++ bool bChanged = SfxTabPage::FillItemSet(rSet);
++
++ // Special treatment for distributed alignment; we need to set the justify
++ // method to 'distribute' to distinguish from the normal justification.
++
++ USHORT nWhichHorJM = GetWhich(SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD);
++ lcl_SetJustifyMethodToItemSet(rSet, nWhichHorJM, maLbHorAlign, ALIGNDLG_HORALIGN_DISTRIBUTED);
++ if (!bChanged)
++ bChanged = HasAlignmentChanged(rSet, nWhichHorJM);
++
++ USHORT nWhichVerJM = GetWhich(SID_ATTR_ALIGN_VER_JUSTIFY_METHOD);
++ lcl_SetJustifyMethodToItemSet(rSet, nWhichVerJM, maLbVerAlign, ALIGNDLG_VERALIGN_DISTRIBUTED);
++ if (!bChanged)
++ bChanged = HasAlignmentChanged(rSet, nWhichVerJM);
++
++ return bChanged;
++}
++
+ void AlignmentTabPage::Reset( const SfxItemSet& rCoreAttrs )
+ {
+ SfxTabPage::Reset( rCoreAttrs );
++
++ // Special treatment for distributed alignment; we need to set the justify
++ // method to 'distribute' to distinguish from the normal justification.
++
++ lcl_MaybeResetAlignToDistro<SvxCellHorJustify, SvxCellHorJustify>(
++ maLbHorAlign, ALIGNDLG_HORALIGN_DISTRIBUTED, rCoreAttrs,
++ GetWhich(SID_ATTR_ALIGN_HOR_JUSTIFY), GetWhich(SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD),
++ SVX_HOR_JUSTIFY_BLOCK);
++
++ lcl_MaybeResetAlignToDistro<SvxCellVerJustify, SvxCellVerJustify>(
++ maLbVerAlign, ALIGNDLG_VERALIGN_DISTRIBUTED, rCoreAttrs,
++ GetWhich(SID_ATTR_ALIGN_VER_JUSTIFY), GetWhich(SID_ATTR_ALIGN_VER_JUSTIFY_METHOD),
++ SVX_VER_JUSTIFY_BLOCK);
++
+ UpdateEnableControls();
+ }
+
+@@ -264,6 +344,7 @@ void AlignmentTabPage::UpdateEnableControls()
+ bool bHorLeft = (nHorAlign == ALIGNDLG_HORALIGN_LEFT);
+ bool bHorBlock = (nHorAlign == ALIGNDLG_HORALIGN_BLOCK);
+ bool bHorFill = (nHorAlign == ALIGNDLG_HORALIGN_FILL);
++ bool bHorDist = (nHorAlign == ALIGNDLG_HORALIGN_DISTRIBUTED);
+
+ // indent edit field only for left alignment
+ maFtIndent.Enable( bHorLeft );
+@@ -275,8 +356,8 @@ void AlignmentTabPage::UpdateEnableControls()
+ // hyphenation only for automatic line breaks or for block alignment
+ maBtnHyphen.Enable( maBtnWrap.IsChecked() || bHorBlock );
+
+- // shrink only without automatic line break, and not for block and fill
+- maBtnShrink.Enable( (maBtnWrap.GetState() == STATE_NOCHECK) && !bHorBlock && !bHorFill );
++ // shrink only without automatic line break, and not for block, fill or distribute.
++ maBtnShrink.Enable( (maBtnWrap.GetState() == STATE_NOCHECK) && !bHorBlock && !bHorFill && !bHorDist );
+
+ // visibility of fixed lines
+ maFlAlignment.Show( maLbHorAlign.IsVisible() || maEdIndent.IsVisible() || maLbVerAlign.IsVisible() );
+@@ -284,6 +365,27 @@ void AlignmentTabPage::UpdateEnableControls()
+ maFlProperties.Show( maBtnWrap.IsVisible() || maBtnHyphen.IsVisible() || maBtnShrink.IsVisible() || maLbFrameDir.IsVisible() );
+ }
+
++bool AlignmentTabPage::HasAlignmentChanged( const SfxItemSet& rNew, USHORT nWhich ) const
++{
++ const SfxItemSet& rOld = GetItemSet();
++ const SfxPoolItem* pItem;
++ SvxCellJustifyMethod eMethodOld = SVX_JUSTIFY_METHOD_AUTO;
++ SvxCellJustifyMethod eMethodNew = SVX_JUSTIFY_METHOD_AUTO;
++ if (rOld.GetItemState(nWhich, TRUE, &pItem) == SFX_ITEM_SET)
++ {
++ const SfxEnumItem* p = static_cast<const SfxEnumItem*>(pItem);
++ eMethodOld = static_cast<SvxCellJustifyMethod>(p->GetEnumValue());
++ }
++
++ if (rNew.GetItemState(nWhich, TRUE, &pItem) == SFX_ITEM_SET)
++ {
++ const SfxEnumItem* p = static_cast<const SfxEnumItem*>(pItem);
++ eMethodNew = static_cast<SvxCellJustifyMethod>(p->GetEnumValue());
++ }
++
++ return eMethodOld != eMethodNew;
++}
++
+ IMPL_LINK( AlignmentTabPage, UpdateEnableHdl, void*, EMPTYARG )
+ {
+ UpdateEnableControls();
+diff --git cui/source/tabpages/align.hrc cui/source/tabpages/align.hrc
+index 1e17021..1a38c86 100644
+--- cui/source/tabpages/align.hrc
++++ cui/source/tabpages/align.hrc
+@@ -63,11 +63,14 @@
+ #define ALIGNDLG_HORALIGN_RIGHT 3
+ #define ALIGNDLG_HORALIGN_BLOCK 4
+ #define ALIGNDLG_HORALIGN_FILL 5
++#define ALIGNDLG_HORALIGN_DISTRIBUTED 6
+
+-#define ALIGNDLG_VERALIGN_STD 0
+-#define ALIGNDLG_VERALIGN_TOP 1
+-#define ALIGNDLG_VERALIGN_MID 2
+-#define ALIGNDLG_VERALIGN_BOTTOM 3
++#define ALIGNDLG_VERALIGN_STD 0
++#define ALIGNDLG_VERALIGN_TOP 1
++#define ALIGNDLG_VERALIGN_MID 2
++#define ALIGNDLG_VERALIGN_BOTTOM 3
++#define ALIGNDLG_VERALIGN_BLOCK 4
++#define ALIGNDLG_VERALIGN_DISTRIBUTED 5
+
+ // image list for ValueSets:
+ #define IL_LOCK_BMPS 1100
+diff --git cui/source/tabpages/align.src cui/source/tabpages/align.src
+index 50cc9dc..efe3631 100644
+--- cui/source/tabpages/align.src
++++ cui/source/tabpages/align.src
+@@ -70,6 +70,7 @@ TabPage RID_SVXPAGE_ALIGNMENT
+ < "Right" ; ALIGNDLG_HORALIGN_RIGHT ; > ;
+ < "Justified" ; ALIGNDLG_HORALIGN_BLOCK ; > ;
+ < "Filled" ; ALIGNDLG_HORALIGN_FILL ; > ;
++ < "Distributed" ; ALIGNDLG_HORALIGN_DISTRIBUTED ; > ;
+ };
+ };
+ FixedText FT_INDENT
+@@ -109,6 +110,8 @@ TabPage RID_SVXPAGE_ALIGNMENT
+ < "Top" ; ALIGNDLG_VERALIGN_TOP ; > ;
+ < "Middle" ; ALIGNDLG_VERALIGN_MID ; > ;
+ < "Bottom" ; ALIGNDLG_VERALIGN_BOTTOM ; > ;
++ < "Justified" ; ALIGNDLG_VERALIGN_BLOCK ; > ;
++ < "Distributed" ; ALIGNDLG_VERALIGN_DISTRIBUTED ; > ;
+ };
+ };
+ FixedLine FL_ORIENTATION
More information about the ooo-build-commit
mailing list