cppcanvas/source/mtfrenderer/emfplus.cxx | 32 -- extensions/UIConfig_sbibliography.mk | 4 extensions/inc/bibliography.hrc | 2 extensions/source/bibliography/bib.hrc | 1 extensions/source/bibliography/datman.cxx | 70 +----- extensions/source/bibliography/datman.hrc | 5 extensions/source/bibliography/datman.src | 47 ---- extensions/uiconfig/sbibliography/ui/choosedatasourcedialog.ui | 110 ++++++++++ include/sal/log-areas.dox | 1 vcl/source/filter/wmf/enhwmf.cxx | 15 - 10 files changed, 137 insertions(+), 150 deletions(-)
New commits: commit f03e95da68138a48ba2d4b6ab382b839577f0a1d Author: Caolán McNamara <[email protected]> Date: Mon Feb 17 09:27:25 2014 +0000 convert biblio choose data source dialog to .ui Change-Id: Ia94c417be95f5cd8c1d694a61c5004b0e8486416 diff --git a/extensions/UIConfig_sbibliography.mk b/extensions/UIConfig_sbibliography.mk index 1517d1d..717c1ae 100644 --- a/extensions/UIConfig_sbibliography.mk +++ b/extensions/UIConfig_sbibliography.mk @@ -13,4 +13,8 @@ $(eval $(call gb_UIConfig_add_menubarfiles,modules/sbibliography,\ extensions/uiconfig/sbibliography/menubar/menubar \ )) +$(eval $(call gb_UIConfig_add_uifiles,modules/sbibliography,\ + extensions/uiconfig/sbibliography/ui/choosedatasourcedialog \ +)) + # vim: set noet sw=4 ts=4: diff --git a/extensions/inc/bibliography.hrc b/extensions/inc/bibliography.hrc index a7b22b1..ec420e9 100644 --- a/extensions/inc/bibliography.hrc +++ b/extensions/inc/bibliography.hrc @@ -62,8 +62,6 @@ #define UID_BIB_FRAME_WINDOW "EXTENSIONS_UID_BIB_FRAME_WINDOW" #define HID_BIB_DB_GRIDCTRL "EXTENSIONS_HID_BIB_DB_GRIDCTRL" #define HID_DLG_MAPPING "EXTENSIONS_HID_DLG_MAPPING" -#define HID_DLG_DBCHANGE "EXTENSIONS_HID_DLG_DBCHANGE" -#define HID_SELECTION_TLB "EXTENSIONS_HID_SELECTION_TLB" #endif // EXTENSIONS_BIBLIOGRAPHY_HRC diff --git a/extensions/source/bibliography/bib.hrc b/extensions/source/bibliography/bib.hrc index a464de7..7b2fd10 100644 --- a/extensions/source/bibliography/bib.hrc +++ b/extensions/source/bibliography/bib.hrc @@ -29,7 +29,6 @@ #define RID_BIB_DIALOG (RID_BIB_START) #define RID_TP_GENERAL (RID_BIB_DIALOG) #define RID_DLG_MAPPING (RID_BIB_DIALOG + 1) -#define RID_DLG_DBCHANGE (RID_BIB_DIALOG + 2) //Controls(100) #define RID_BIB_CONTROLS (RID_BIB_START + 100) diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index 0baaf88..49f0201 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -528,14 +528,8 @@ IMPL_LINK_NOARG(MappingDialog_Impl, OkHdl) class DBChangeDialog_Impl : public ModalDialog { - OKButton aOKBT; - CancelButton aCancelBT; - HelpButton aHelpBT; - FixedLine aSelectionGB; - SvTabListBox aSelectionLB; - HeaderBar aSelectionHB; + ListBox* m_pSelectionLB; DBChangeDialogConfig_Impl aConfig; - OUString aEntryST; BibDataManager* pDatMan; @@ -547,51 +541,33 @@ public: OUString GetCurrentURL()const; }; -DBChangeDialog_Impl::DBChangeDialog_Impl(Window* pParent, BibDataManager* pMan ) : - ModalDialog(pParent, BibResId(RID_DLG_DBCHANGE) ), - aOKBT(this, BibResId( BT_OK )), - aCancelBT(this, BibResId( BT_CANCEL )), - aHelpBT(this, BibResId( BT_HELP )), - aSelectionGB(this, BibResId( GB_SELECTION )), - aSelectionLB(this, BibResId( LB_SELECTION )), - aSelectionHB(this, BibResId( HB_SELECTION )), - aEntryST(BIB_RESSTR(ST_ENTRY)), +DBChangeDialog_Impl::DBChangeDialog_Impl(Window* pParent, BibDataManager* pMan ) + : ModalDialog(pParent, "ChooseDataSourceDialog", + "modules/sbibliography/ui/choosedatasourcedialog.ui") + , pDatMan(pMan) { - FreeResource(); - aSelectionLB.SetDoubleClickHdl( LINK(this, DBChangeDialog_Impl, DoubleClickHdl)); - try - { - ::Size aSize = aSelectionHB.GetSizePixel(); - long nTabs[2]; - nTabs[0] = 1;// Number of Tabs - nTabs[1] = aSize.Width() / 4; - - aSelectionHB.SetStyle(aSelectionHB.GetStyle()|WB_STDHEADERBAR); - aSelectionHB.InsertItem( 1, aEntryST, aSize.Width()); - aSelectionHB.SetSizePixel(aSelectionHB.CalcWindowSizePixel()); - aSelectionHB.Show(); + get(m_pSelectionLB, "treeview"); + m_pSelectionLB->set_height_request(m_pSelectionLB->GetTextHeight() * 6); - aSelectionLB.SetTabs( &nTabs[0], MAP_PIXEL ); - aSelectionLB.SetStyle(aSelectionLB.GetStyle()|WB_CLIPCHILDREN|WB_SORT); - aSelectionLB.GetModel()->SetSortMode(SortAscending); + m_pSelectionLB->SetStyle(m_pSelectionLB->GetStyle() | WB_SORT); + m_pSelectionLB->SetDoubleClickHdl( LINK(this, DBChangeDialog_Impl, DoubleClickHdl)); + try + { OUString sActiveSource = pDatMan->getActiveDataSource(); const Sequence< OUString >& rSources = aConfig.GetDataSourceNames(); const OUString* pSourceNames = rSources.getConstArray(); - for(int i = 0; i < rSources.getLength(); i++) - { - SvTreeListEntry* pEntry = aSelectionLB.InsertEntry(pSourceNames[i]); - if(pSourceNames[i] == sActiveSource) - { - aSelectionLB.Select(pEntry); - } - } - aSelectionLB.GetModel()->Resort(); + for (sal_Int32 i = 0; i < rSources.getLength(); ++i) + m_pSelectionLB->InsertEntry(pSourceNames[i]); + + m_pSelectionLB->SelectEntry(sActiveSource); } - catch (const Exception&) + catch (const Exception& e) { - OSL_FAIL("Exception in BibDataManager::DBChangeDialog_Impl::DBChangeDialog_Impl"); + SAL_WARN("extensions.biblio", + "Exception in BibDataManager::DBChangeDialog_Impl::DBChangeDialog_Impl " + << e.Message); } } @@ -607,13 +583,7 @@ DBChangeDialog_Impl::~DBChangeDialog_Impl() OUString DBChangeDialog_Impl::GetCurrentURL()const { - OUString sRet; - SvTreeListEntry* pEntry = aSelectionLB.FirstSelected(); - if(pEntry) - { - sRet = aSelectionLB.GetEntryText(pEntry, 0); - } - return sRet; + return m_pSelectionLB->GetSelectEntry(); } // XDispatchProvider diff --git a/extensions/source/bibliography/datman.hrc b/extensions/source/bibliography/datman.hrc index 42fb77a..b7515ba 100644 --- a/extensions/source/bibliography/datman.hrc +++ b/extensions/source/bibliography/datman.hrc @@ -87,9 +87,4 @@ #define FT_CUSTOM5 66 #define LB_CUSTOM5 67 -#define GB_SELECTION 68 -#define ST_ENTRY 69 -#define LB_SELECTION 71 -#define HB_SELECTION 72 - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/bibliography/datman.src b/extensions/source/bibliography/datman.src index 555e1e8..ef862d1 100644 --- a/extensions/source/bibliography/datman.src +++ b/extensions/source/bibliography/datman.src @@ -425,52 +425,5 @@ ModalDialog RID_DLG_MAPPING }; Text [ en-US ] = "Column Layout for Table %1"; }; -ModalDialog RID_DLG_DBCHANGE -{ - HelpID = HID_DLG_DBCHANGE; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 291 , 131 ) ; - Moveable = TRUE ; - Text [ en-US ] = "Choose Data Source"; - OKButton BT_OK - { - Pos = MAP_APPFONT ( 238 , 3 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - }; - CancelButton BT_CANCEL - { - Pos = MAP_APPFONT ( 238 , 18 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - }; - HelpButton BT_HELP - { - Pos = MAP_APPFONT ( 238 , 36 ) ; - Size = MAP_APPFONT ( 50 , 12 ) ; - }; - FixedLine GB_SELECTION - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 229 , 8 ) ; - }; - String ST_ENTRY - { - Text [ en-US ] = "Entry"; - }; - Control LB_SELECTION - { - Pos = MAP_APPFONT ( 9 , 24 ) ; - Size = MAP_APPFONT ( 223 , 100 ) ; - Border = TRUE; - TabStop = TRUE; - HelpId = HID_SELECTION_TLB; - }; - Window HB_SELECTION - { - Pos = MAP_APPFONT ( 9 , 12 ) ; - Size = MAP_APPFONT ( 223 , 12 ) ; - Border = TRUE; - }; -}; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/uiconfig/sbibliography/ui/choosedatasourcedialog.ui b/extensions/uiconfig/sbibliography/ui/choosedatasourcedialog.ui new file mode 100644 index 0000000..ff8c99d --- /dev/null +++ b/extensions/uiconfig/sbibliography/ui/choosedatasourcedialog.ui @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.16.1 --> +<interface> + <requires lib="gtk+" version="3.0"/> + <object class="GtkDialog" id="ChooseDataSourceDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Choose Data Source</property> + <property name="type_hint">dialog</property> + <child internal-child="vbox"> + <object class="GtkBox" id="dialog-vbox1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">12</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="label_xalign">0</property> + <property name="shadow_type">none</property> + <child> + <object class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <property name="top_padding">6</property> + <property name="left_padding">12</property> + <child> + <object class="GtkTreeView" id="treeview:border"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection1"/> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Entry</property> + <attributes> + <attribute name="weight" value="semibold"/> + </attributes> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + <action-widgets> + <action-widget response="0">ok</action-widget> + <action-widget response="0">cancel</action-widget> + </action-widgets> + </object> +</interface> diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox index e4e031f..138134b 100644 --- a/include/sal/log-areas.dox +++ b/include/sal/log-areas.dox @@ -151,6 +151,7 @@ certain functionality. @section extensions +@li @c extensions.biblio @li @c extensions.dbpilots @li @c extensions.plugin @li @c extensions.scanner commit cc74d3ce73583d035b6793c485d0af95c12f7e61 Author: Caolán McNamara <[email protected]> Date: Sun Feb 16 17:12:05 2014 +0000 fix debug=2 build Change-Id: Id7c6db5c6cbefef427d9c2cc4bd210811b5a7991 diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index 1978f3e..95d8d34 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -120,22 +120,6 @@ namespace cppcanvas { namespace internal { - -#if OSL_DEBUG_LEVEL > 1 - void dumpWords (SvStream& s, int i) - { - sal_uInt32 pos = s.Tell (); - sal_Int16 data; - SAL_INFO ("cppcanvas.emf", "EMF+ dumping words"); - for (; i > 0; i --) { - s >> data; - SAL_INFO ("cppcanvas.emf", "EMF+\tdata: " << std::hex << data << std::dec); - } - SAL_INFO ("cppcanvas.emf", "EMF+ end dumping words"); - s.Seek (pos); - } -#endif - struct EMFPPath : public EMFPObject { ::basegfx::B2DPolyPolygon aPolygon; @@ -454,9 +438,6 @@ namespace cppcanvas SAL_INFO("cppcanvas.emf", "EMF+\tpath length: " << pathLength); sal_uInt32 pos = s.Tell (); -#if OSL_DEBUG_LEVEL > 1 - dumpWords (s, 32); -#endif sal_uInt32 pathHeader; sal_Int32 pathPoints, pathFlags; @@ -523,10 +504,6 @@ namespace cppcanvas SAL_INFO("cppcanvas.emf", "EMF+\tcolor[" << i << "]: 0x" << std::hex << color << std::dec); } } - } else { -#if OSL_DEBUG_LEVEL > 1 - dumpWords (s, 1024); -#endif } break; } @@ -1009,7 +986,7 @@ namespace cppcanvas SvFileStream file( emfp_debug_filename, STREAM_WRITE | STREAM_TRUNC ); - mfStream >> file; + mfStream.WriteStream(file); file.Flush(); file.Close(); #endif @@ -1616,10 +1593,6 @@ namespace cppcanvas sal_uInt32 length = pAct->GetDataSize (); SvMemoryStream rMF ((void*) pAct->GetData (), length, STREAM_READ); -#if OSL_DEBUG_LEVEL > 2 - SAL_INFO("cppcanvas.emf", "EMF+\tDump of EMF+ record"); - dumpWords(rMF, length); -#endif length -= 4; while (length > 0) { @@ -2274,9 +2247,6 @@ namespace cppcanvas { SAL_WARN("cppcanvas.emf", "ImplRenderer::processEMFPlus: " "size " << size << " > length " << length); -#if OSL_DEBUG_LEVEL > 1 - dumpWords(rMF, length); -#endif length = 0; } } diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx index c06497b..b83a5cf 100644 --- a/vcl/source/filter/wmf/enhwmf.cxx +++ b/vcl/source/filter/wmf/enhwmf.cxx @@ -236,19 +236,6 @@ static bool ImplReadRegion( PolyPolygon& rPolyPoly, SvStream& rSt, sal_uInt32 nL return bOk; } -#if OSL_DEBUG_LEVEL > 1 -void dumpWords( SvStream& s, int i ) -{ - sal_uInt32 pos = s.Tell(); - sal_Int16 data; - for( ; i > 0; i -- ) { - s >> data; - SAL_INFO("vcl.emf", "\t\t\tdata: " << std::hex << data << std::dec); - } - s.Seek (pos); -}; -#endif - void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC) { if (!bEMFPlus) { @@ -260,7 +247,7 @@ void EnhWMFReader::ReadEMFPlusComment(sal_uInt32 length, sal_Bool& bHaveDC) pWMF->Seek(0); SvFileStream file( OUString( "/tmp/emf-stream.emf" ), STREAM_WRITE | STREAM_TRUNC ); - *pWMF >> file; + pWMF->WriteStream(file); file.Flush(); file.Close();
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
