[Libreoffice-commits] .: 3 commits - sc/sdi sd/sdi svtools/source sw/source vcl/inc vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Oct 8 05:15:47 PDT 2012
sc/sdi/scalc.sdi | 2 -
sd/sdi/sdraw.sdi | 2 -
svtools/source/inc/sgvmain.hxx | 2 +
sw/source/ui/uiview/viewstat.cxx | 9 ----
vcl/inc/vcl/builder.hxx | 12 ++++--
vcl/source/window/builder.cxx | 72 +++++++++++++++++++++++++++++++++++----
6 files changed, 77 insertions(+), 22 deletions(-)
New commits:
commit 530e7ba7528b468344ca69e7892ca83e81fd42c7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Oct 8 13:14:05 2012 +0100
make svtools filter test not loop endlessly
i.e. this partially reverts f26d188ffa00ee6184490fc5c179da16e17301bb
which doesn't take into account raw reads of sizeof(ObjAreaType)
Change-Id: I80f94f610647128262ebb16c7e888a7cc7ecb9d8
diff --git a/svtools/source/inc/sgvmain.hxx b/svtools/source/inc/sgvmain.hxx
index fe08e2d..9d023d5 100644
--- a/svtools/source/inc/sgvmain.hxx
+++ b/svtools/source/inc/sgvmain.hxx
@@ -99,6 +99,8 @@ struct ObjAreaType {
sal_uInt8 FFarbe; // [Index]
sal_uInt8 FBFarbe; // [Index]
sal_uInt8 FIntens; // [%]
+ sal_uInt8 FDummy1; //
+ sal_Int16 FDummy2; //
sal_uInt16 FMuster; // [Index] inkl. Invers, Transparenz
};
commit 6799ec80cd9ec6a5d0c3e11ec8a69084396f5420
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Oct 6 17:14:10 2012 +0100
import GtkScrollbar as scrollbars and connect GtkAdjustments
Change-Id: Idef8a338f09b52cf0758a6a35e3b5bbcc96a7383
diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx
index 246f68d..0a6574c 100644
--- a/vcl/inc/vcl/builder.hxx
+++ b/vcl/inc/vcl/builder.hxx
@@ -19,6 +19,7 @@
class ListBox;
class NumericFormatter;
+class ScrollBar;
class VCL_DLLPUBLIC VclBuilder
{
@@ -90,10 +91,11 @@ private:
}
};
- typedef StringPair SpinButtonAdjustmentMap;
+ typedef StringPair WidgetAdjustmentMap;
Adjustment *get_adjustment_by_name(OString sID);
- static void mungeadjustment(NumericFormatter &rTarget, Adjustment &rAdjustment);
+ static void mungeSpinAdjustment(NumericFormatter &rTarget, Adjustment &rAdjustment);
+ static void mungeScrollAdjustment(ScrollBar &rTarget, Adjustment &rAdjustment);
typedef std::map<OString, OString> WidgetTranslations;
typedef std::map<OString, WidgetTranslations> Translations;
@@ -105,7 +107,8 @@ private:
std::vector<ComboBoxModelMap> m_aModelMaps;
std::vector<ModelAndId> m_aModels;
std::vector<AdjustmentAndId> m_aAdjustments;
- std::vector<SpinButtonAdjustmentMap> m_aAdjustmentMaps;
+ std::vector<WidgetAdjustmentMap> m_aSpinAdjustmentMaps;
+ std::vector<WidgetAdjustmentMap> m_aScrollAdjustmentMaps;
std::vector<ButtonImageWidgetMap> m_aButtonImageWidgetMaps;
StockMap m_aStockMap;
Translations m_aTranslations;
@@ -179,7 +182,8 @@ private:
Window *makeObject(Window *pParent, const OString &rClass, const OString &rID, stringmap &rVec);
bool extractGroup(const OString &id, stringmap &rVec);
bool extractModel(const OString &id, stringmap &rVec);
- bool extractAdjustment(const OString &id, stringmap &rVec);
+ bool extractSpinAdjustment(const OString &id, stringmap &rVec);
+ bool extractScrollAdjustment(const OString &id, stringmap &rVec);
bool extractImage(const OString &id, stringmap &rMap);
bool extractStock(const OString &id, stringmap &rMap);
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 86c06d1..80daaab 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -18,6 +18,7 @@
#include <vcl/layout.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/menubtn.hxx>
+#include <vcl/scrbar.hxx>
#include <vcl/svapp.hxx>
#include <vcl/tabctrl.hxx>
#include <vcl/tabpage.hxx>
@@ -130,14 +131,25 @@ VclBuilder::VclBuilder(Window *pParent, OUString sUIDir, OUString sUIFile, OStri
}
//Set SpinButton adjustments when everything has been imported
- for (std::vector<SpinButtonAdjustmentMap>::iterator aI = m_pParserState->m_aAdjustmentMaps.begin(),
- aEnd = m_pParserState->m_aAdjustmentMaps.end(); aI != aEnd; ++aI)
+ for (std::vector<WidgetAdjustmentMap>::iterator aI = m_pParserState->m_aSpinAdjustmentMaps.begin(),
+ aEnd = m_pParserState->m_aSpinAdjustmentMaps.end(); aI != aEnd; ++aI)
{
NumericFormatter *pTarget = dynamic_cast<NumericFormatter*>(get<Window>(aI->m_sID));
Adjustment *pAdjustment = get_adjustment_by_name(aI->m_sValue);
SAL_WARN_IF(!pTarget || !pAdjustment, "vcl", "missing elements of spinbutton/adjustment");
if (pTarget && pAdjustment)
- mungeadjustment(*pTarget, *pAdjustment);
+ mungeSpinAdjustment(*pTarget, *pAdjustment);
+ }
+
+ //Set ScrollBar adjustments when everything has been imported
+ for (std::vector<WidgetAdjustmentMap>::iterator aI = m_pParserState->m_aScrollAdjustmentMaps.begin(),
+ aEnd = m_pParserState->m_aScrollAdjustmentMaps.end(); aI != aEnd; ++aI)
+ {
+ ScrollBar *pTarget = get<ScrollBar>(aI->m_sID);
+ Adjustment *pAdjustment = get_adjustment_by_name(aI->m_sValue);
+ SAL_WARN_IF(!pTarget || !pAdjustment, "vcl", "missing elements of scrollbar/adjustment");
+ if (pTarget && pAdjustment)
+ mungeScrollAdjustment(*pTarget, *pAdjustment);
}
//Set button images when everything has been imported
@@ -430,18 +442,31 @@ bool VclBuilder::extractGroup(const OString &id, stringmap &rMap)
return false;
}
-bool VclBuilder::extractAdjustment(const OString &id, stringmap &rMap)
+bool VclBuilder::extractSpinAdjustment(const OString &id, stringmap &rMap)
{
VclBuilder::stringmap::iterator aFind = rMap.find(OString("adjustment"));
if (aFind != rMap.end())
{
- m_pParserState->m_aAdjustmentMaps.push_back(SpinButtonAdjustmentMap(id, aFind->second));
+ m_pParserState->m_aSpinAdjustmentMaps.push_back(WidgetAdjustmentMap(id, aFind->second));
rMap.erase(aFind);
return true;
}
return false;
}
+bool VclBuilder::extractScrollAdjustment(const OString &id, stringmap &rMap)
+{
+ VclBuilder::stringmap::iterator aFind = rMap.find(OString("adjustment"));
+ if (aFind != rMap.end())
+ {
+ m_pParserState->m_aScrollAdjustmentMaps.push_back(WidgetAdjustmentMap(id, aFind->second));
+ rMap.erase(aFind);
+ return true;
+ }
+ return false;
+}
+
+
bool VclBuilder::extractModel(const OString &id, stringmap &rMap)
{
VclBuilder::stringmap::iterator aFind = rMap.find(OString("model"));
@@ -580,7 +605,7 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri
}
else if (name == "GtkSpinButton")
{
- extractAdjustment(id, rMap);
+ extractSpinAdjustment(id, rMap);
OString sPattern = extractPattern(rMap);
OString sUnit = sPattern;
@@ -656,6 +681,14 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri
else
pWindow = new FixedLine(pParent, WB_HORZ);
}
+ else if (name == "GtkScrollbar")
+ {
+ extractScrollAdjustment(id, rMap);
+ if (extractOrientation(rMap))
+ pWindow = new ScrollBar(pParent, WB_VERT);
+ else
+ pWindow = new ScrollBar(pParent, WB_HORZ);
+ }
else if (name == "GtkEntry")
{
pWindow = new Edit(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK);
@@ -1479,7 +1512,7 @@ void VclBuilder::mungemodel(ListBox &rTarget, ListStore &rStore)
rTarget.SelectEntryPos(0);
}
-void VclBuilder::mungeadjustment(NumericFormatter &rTarget, Adjustment &rAdjustment)
+void VclBuilder::mungeSpinAdjustment(NumericFormatter &rTarget, Adjustment &rAdjustment)
{
int nMul = rtl_math_pow10Exp(1, rTarget.GetDecimalDigits());
@@ -1517,4 +1550,29 @@ void VclBuilder::mungeadjustment(NumericFormatter &rTarget, Adjustment &rAdjustm
}
}
+void VclBuilder::mungeScrollAdjustment(ScrollBar &rTarget, Adjustment &rAdjustment)
+{
+ for (stringmap::iterator aI = rAdjustment.begin(), aEnd = rAdjustment.end(); aI != aEnd; ++aI)
+ {
+ const OString &rKey = aI->first;
+ const OString &rValue = aI->second;
+
+ if (rKey == "upper")
+ rTarget.SetRangeMax(rValue.toInt32());
+ else if (rKey == "lower")
+ rTarget.SetRangeMin(rValue.toInt32());
+ else if (rKey == "value")
+ rTarget.SetThumbPos(rValue.toInt32());
+ else if (rKey == "step-increment")
+ rTarget.SetLineSize(rValue.toInt32());
+ else if (rKey == "page-increment")
+ rTarget.SetPageSize(rValue.toInt32());
+ else
+ {
+ SAL_INFO("vcl.layout", "unhandled property :" << rKey.getStr());
+ }
+ }
+}
+
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 9897942db6c53dff3a85b880d9d2b955011ef189
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Oct 6 16:19:42 2012 +0100
Tweak hyphen as a togglable option after all
In a65f48f375d218b592ba7c17752f9ca86e14bd65 I wondered why hyphenation was set
to be a toggle able feature when it opens a non-modal dialog.
Looking closer, it *is* a toggable feature on/off for draw/impress, but this
isn't the case for writer. Reverted it for calc too, although apparently
not toggable there.
Change-Id: If02568d58253c380e6d668a728f9c3ae6acf1128
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index 14fb8cc..8e0cf31 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -3439,7 +3439,7 @@ SfxVoidItem Hyphenate SID_ENABLE_HYPHENATION
HasCoreId = FALSE,
HasDialog = TRUE,
ReadOnlyDoc = FALSE,
- Toggle = FALSE,
+ Toggle = TRUE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi
index 2775659..0183a54 100644
--- a/sd/sdi/sdraw.sdi
+++ b/sd/sdi/sdraw.sdi
@@ -3260,7 +3260,7 @@ SfxBoolItem Hyphenation SID_HYPHENATION
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = FALSE,
- Toggle = FALSE,
+ Toggle = TRUE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
diff --git a/sw/source/ui/uiview/viewstat.cxx b/sw/source/ui/uiview/viewstat.cxx
index 7938caa..3aee693 100644
--- a/sw/source/ui/uiview/viewstat.cxx
+++ b/sw/source/ui/uiview/viewstat.cxx
@@ -247,15 +247,6 @@ void SwView::GetState(SfxItemSet &rSet)
rSet.Put((const SvxLanguageItem&)
pWrtShell->GetDefault(RES_CHRATR_CTL_LANGUAGE), RES_CHRATR_CTL_LANGUAGE);
break;
- case FN_HYPHENATE_OPT_DLG:
- {
- sal_Bool bCheck = sal_False;
-
- if (pWrtShell->GetSelectionType() & (nsSelectionType::SEL_DRW_TXT|nsSelectionType::SEL_DRW))
- bCheck = IsDrawTextHyphenate();
- rSet.Put(SfxBoolItem(nWhich, bCheck));
- }
- break;
case FN_REDLINE_ON:
rSet.Put( SfxBoolItem( nWhich, GetDocShell()->IsChangeRecording() ) );
break;
More information about the Libreoffice-commits
mailing list