summaryrefslogtreecommitdiff
path: root/toolkit/workben
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-07-30 13:07:34 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-07-30 13:07:34 +0000
commitb3c3e227c751b3ba3153c0798730e9b3eb4f8453 (patch)
tree2920da80755287f4d061efd586e00567c4e7d422 /toolkit/workben
parent966f1c98f4ec7986119d49f0c0385ec7c65646ee (diff)
INTEGRATION: CWS layoutdialogs (1.2.6); FILE MERGED
2008/07/30 11:17:14 rt 1.2.6.5: Update license header. 2008/03/28 09:53:22 cl 1.2.6.4: merged tklayout into tk lib 2008/03/27 13:08:19 jcn 1.2.6.3: Substitute TAB by 4 spaces. 2008/03/26 13:46:01 cl 1.2.6.2: fixing warnings 2008/03/20 11:56:31 jcn 1.2.6.1: Update from http://lilypond.org/~janneke/vc/toolkit.git/.git 2008-03-20 Jan Nieuwenhuizen <janneke@gnu.org> * source/awt/vclxwindow.cxx: Fix compile warning. 2008-03-20 Jan Nieuwenhuizen <janneke@gnu.org> * util/makefile.mk: Revert obsolete VERSION addition. 2008-03-20 Jan Nieuwenhuizen <janneke@gnu.org> * source/controls/dialogcontrol.cxx, source/controls/unocontrol.cxx, source/helper/tkresmgr.cxx, util/defs/wntmsci11: Revert weird initial patch. 2008-03-20 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO: Doc update. 2008-03-20 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout-post.hxx, inc/layout/layout-pre.hxx, inc/layout/layout.hxx, source/awt/vclxbutton.cxx, source/vclcompat/wbutton.cxx, workben/layout/recover.xml: Implement MoreButton. TODO: images. 2008-03-19 Jan Nieuwenhuizen <janneke@gnu.org> * source/vclcompat/wbutton.cxx: Remove redraw cruft, rename redrawAlready to redraw. 2008-03-19 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout-post.hxx, source/vclcompat/wbutton.cxx: Step towards cleaner redraw. 2008-03-19 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout-post.hxx, inc/layout/layout-pre.hxx, inc/layout/layout.hxx, source/awt/vclxbutton.cxx, source/awt/vclxbutton.hxx, source/layout/helper.cxx, source/vclcompat/wbutton.cxx, workben/layout/recover.cxx, workben/layout/recover.hxx: Extract AdvancedButton implementation from recover.cxx into new widget. 2008-03-19 Jan Nieuwenhuizen <janneke@gnu.org> * workben/layout/recover.cxx, workben/layout/recover.hxx, workben/layout/recover.xml: Update recover dialog, make advanced/simple switching work. 2008-03-14 Jan Nieuwenhuizen <janneke@gnu.org> * workben/layout/zoom.cxx: In test mode, enable everything. 2008-03-14 Jan Nieuwenhuizen <janneke@gnu.org> * workben/layout/localize.sdf: Manually add new translatable strings and translations for de, nl. 2008-03-14 Jan Nieuwenhuizen <janneke@gnu.org> * workben/layout/zoom.xml: Update zoom to have hbox of Zoom factor and View layout alongside each other. 2008-03-14 Jan Nieuwenhuizen <janneke@gnu.org> * workben/layout/zoom.cxx, workben/layout/zoom.hxx, workben/layout/zoom.xml: Merge upstream's zoom. 2008-03-14 Jan Nieuwenhuizen <janneke@gnu.org> * source/vclcompat/wbutton.cxx, source/vclcompat/wrapper.hxx: Nitpick, debugging aid. 2008-03-14 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout.hxx, source/vclcompat/wrapper.cxx: Implement FixedLine.IsEnabled(). 2008-03-14 Jan Nieuwenhuizen <janneke@gnu.org> * util/makefile.mk: Build lib name fix. 2008-03-14 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout-post.hxx, inc/layout/layout-pre.hxx, inc/layout/layout.hxx, source/vclcompat/wcontainer.cxx, workben/layout/recover.cxx, workben/layout/recover.hxx, workben/layout/recover.xml: Complete VBox/HBox wrappers. Not use them in recover, spacing still wrong. 2008-03-13 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, workben/layout/recover.cxx, workben/layout/recover.hxx, workben/layout/recover.xml: More recovery dialog mockuping. 2008-03-13 Jan Nieuwenhuizen <janneke@gnu.org> * source/layout/box-base.cxx: Implement visibility of elements/containers better. 2008-03-13 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout-post.hxx, inc/layout/layout-pre.hxx, inc/layout/layout.hxx, source/layout/helper.cxx, source/layout/import.cxx, source/layout/proplist.cxx, source/vclcompat/wbutton.cxx, source/vclcompat/wfield.cxx, source/vclcompat/wrapper.cxx, source/vclcompat/wrapper.hxx: Implement FixedImage. Needed for recovery dialog. 2008-02-28 Jan Nieuwenhuizen <janneke@gnu.org> * source/layout/box-base.hxx, workben/layout/editor.cxx: Give ChildData virtual distructor. 2008-02-28 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout-post.hxx, inc/layout/layout-pre.hxx, inc/layout/layout.hxx, source/layout/helper.cxx, source/vclcompat/makefile.mk, source/vclcompat/wrapper.cxx, util/makefile.mk, workben/layout/makefile.mk, workben/layout/recover.cxx, workben/layout/recover.hxx, workben/layout/recover.xml, workben/layout/test.cxx: Stab at new recover dialog. 2008-02-28 Jan Nieuwenhuizen <janneke@gnu.org> * workben/layout/editor.cxx: Do not clear fresh container. Disable debug printing. 2008-02-27 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, workben/layout/localize.sdf: Fix localize.sdf for wordcount. 2008-02-27 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout-pre.hxx, source/layout/dialogbuttonhbox.cxx: Fix ID for displaying dialogs. 2008-02-27 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, workben/layout/localize.sdf, workben/layout/wordcount.xml, workben/layout/zoom.xml: Add strings for all languages. 2008-02-27 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, source/awt/vclxsplitter.cxx, source/awt/vclxsplitter.hxx, source/awt/vclxtabcontrol.cxx, source/awt/vclxtabcontrol.hxx, source/layout/box-base.cxx, source/layout/box-base.hxx, source/layout/box.cxx, source/layout/box.hxx, source/layout/container.cxx, source/layout/dialogbuttonhbox.cxx, source/layout/dialogbuttonhbox.hxx, source/layout/factory.cxx, source/layout/flow.cxx, source/layout/helper.cxx, source/layout/import.hxx, source/layout/makefile.mk, source/layout/proplist.cxx, source/layout/root.cxx, source/layout/table.cxx, source/layout/table.hxx, source/layout/timer.cxx, source/vclcompat/wcontainer.cxx, source/vclcompat/wfield.cxx, source/vclcompat/wrapper.cxx: Clean-up code duplication from layout: new Box_Base class implements addChild, removeChild, getChildren, getChildProperties for Box, Table, VCLXSplitter, VCLXTabControl. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, source/layout/root.cxx: Document more fixmes. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, source/layout/proplist.cxx: Remove m237 workaround. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * source/layout/helper.cxx: More comment cleanups. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * source/awt/vclxtabcontrol.cxx, source/layout/box.cxx, source/layout/container.cxx, source/vclcompat/wrapper.cxx: Commented-out code cleanups. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout-post.hxx, inc/layout/layout-pre.hxx, inc/layout/layout.hxx, inc/layout/layoutcore.hxx, source/awt/forward.hxx, source/awt/vclxbutton.cxx, source/awt/vclxbutton.hxx, source/awt/vclxdialog.cxx, source/awt/vclxdialog.hxx, source/awt/vclxfixedline.cxx, source/awt/vclxfixedline.hxx, source/awt/vclxscroller.cxx, source/awt/vclxscroller.hxx, source/awt/vclxsplitter.cxx, source/awt/vclxsplitter.hxx, source/awt/vclxtabcontrol.cxx, source/awt/vclxtabcontrol.hxx, source/layout/bin.cxx, source/layout/bin.hxx, source/layout/box.cxx, source/layout/box.hxx, source/layout/container.cxx, source/layout/container.hxx, source/layout/dialogbuttonhbox.cxx, source/layout/dialogbuttonhbox.hxx, source/layout/factory.cxx, source/layout/factory.hxx, source/layout/flow.cxx, source/layout/flow.hxx, source/layout/helper.cxx, source/layout/helper.hxx, source/layout/import.cxx, source/layout/import.hxx, source/layout/makefile.mk, source/layout/precompiled_xmlscript.hxx, source/layout/proplist.cxx, source/layout/proplist.hxx, source/layout/root.cxx, source/layout/root.hxx, source/layout/table.cxx, source/layout/table.hxx, source/layout/timer.cxx, source/layout/timer.hxx, source/layout/translate.cxx, source/layout/translate.hxx, source/vclcompat/makefile.mk, source/vclcompat/wbutton.cxx, source/vclcompat/wcontainer.cxx, source/vclcompat/wfield.cxx, source/vclcompat/wrapper.cxx, source/vclcompat/wrapper.hxx, workben/layout/editor.cxx, workben/layout/editor.hxx, workben/layout/makefile.mk, workben/layout/simple-paragraph.cxx, workben/layout/simple-paragraph.hxx, workben/layout/test.cxx, workben/layout/uno.hxx, workben/layout/zoom_def.hxx: Add licence headers. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * workben/layout/meekfile.mk: Junk meekfile.mk 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO: Update TODO. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * inc/toolkit/awt/vclxwindows.hxx, source/awt/vclxwindow.cxx, source/awt/vclxwindows.cxx: Move VCLXScrollBar's getMinimumSize() from VCLXWindow's switch to method. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * inc/toolkit/awt/vclxwindows.hxx, source/awt/vclxwindow.cxx, source/awt/vclxwindows.cxx: Move VCLXMessageBox's getMinimumSize() from VCLXWindow's switch to method. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, inc/toolkit/awt/vclxtopwindow.hxx, source/awt/vclxdialog.cxx, source/awt/vclxdialog.hxx, source/awt/vclxtopwindow.cxx: Remove code duplication from VCLXDialog. 2008-02-26 Jan Nieuwenhuizen <janneke@gnu.org> * source/awt/vclxdialog.cxx, source/vclcompat/wbutton.cxx, source/vclcompat/wcontainer.cxx, source/vclcompat/wrapper.hxx: Comment cleanup. 2008-02-21 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, source/layout/helper.hxx, workben/layout/editor.cxx, workben/layout/wordcountdialog.cxx: Fix remaining SUN warnings. 2008-02-21 Jan Nieuwenhuizen <janneke@gnu.org> * inc/layout/layout.hxx, source/awt/vclxfixedline.hxx, source/layout/byteseq.cxx, source/layout/helper.hxx, source/layout/import.cxx, source/layout/makefile.mk, source/layout/proplist.cxx, source/layout/translate.hxx, source/vclcompat/wbutton.cxx, source/vclcompat/wcontainer.cxx, source/vclcompat/wfield.cxx, source/vclcompat/wrapper.cxx, source/vclcompat/wrapper.hxx, workben/layout/editor.cxx: Fix some sunstudio12 warnings. 2008-02-20 Jan Nieuwenhuizen <janneke@gnu.org> * doc/layout/TODO, source/awt/makefile.mk, source/awt/vclxbutton.cxx, source/awt/vclxbutton.hxx, source/awt/vclxproxy.cxx, source/awt/vclxproxy.hxx, source/layout/helper.cxx: Junk VCLXProxy. 2008-02-20 Jan Nieuwenhuizen <janneke@gnu.org> * inc/toolkit/awt/vclxwindows.hxx, inc/toolkit/helper/listenermultiplexer.hxx, source/awt/vclxbutton.cxx, source/awt/vclxbutton.hxx, source/awt/vclxtabcontrol.cxx, source/awt/vclxtabcontrol.hxx, source/layout/helper.cxx: Hello world on AWTVCLXCancelButton() label and images. 2008-02-20 Jan Nieuwenhuizen <janneke@gnu.org> * .gitignore, source/awt/forward.hxx, source/awt/makefile.mk, source/awt/vclxdialog.cxx, source/awt/vclxdialog.hxx, source/awt/vclxfixedline.cxx, source/awt/vclxfixedline.hxx, source/awt/vclxscroller.cxx, source/awt/vclxscroller.hxx, source/awt/vclxsplitter.cxx, source/awt/vclxsplitter.hxx, source/awt/vclxtabcontrol.cxx, source/awt/vclxtabcontrol.hxx, source/layout/makefile.mk, workben/layout/localize-de.sdf, workben/layout/localize-nl.sdf: Cleanup of includes, namespace in headers in awt.
Diffstat (limited to 'toolkit/workben')
-rw-r--r--toolkit/workben/layout/editor.cxx211
1 files changed, 146 insertions, 65 deletions
diff --git a/toolkit/workben/layout/editor.cxx b/toolkit/workben/layout/editor.cxx
index b93907b718e1..c8e44a9c9180 100644
--- a/toolkit/workben/layout/editor.cxx
+++ b/toolkit/workben/layout/editor.cxx
@@ -1,3 +1,34 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: editor.cxx,v $
+ *
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
#include "editor.hxx"
#undef NDEBUG
@@ -29,7 +60,7 @@ using rtl::OUString;
//#define FILEDLG
// somewhat of a hack unfortunately ...
-#include "layoutcore.hxx"
+#include "layout/layoutcore.hxx"
#include "root.hxx"
#include "helper.hxx"
@@ -73,7 +104,7 @@ namespace layoutimpl {
const rtl::OUString &rName, long nProps, bool bToplevel );
uno::Any anyFromString (const rtl::OUString &value, const uno::Type &type);
-};
+}
using namespace layout;
using namespace layoutimpl;
@@ -117,7 +148,7 @@ static rtl::OUString anyToString (uno::Any value)
}
static inline long anyToNatural (uno::Any value)
-{ return anyToString( value ).toInt64(); }
+{ return sal::static_int_cast<long>(anyToString( value ).toInt64()); }
static inline double anyToDecimal (uno::Any value)
{ return anyToString( value ).toDouble(); }
@@ -211,7 +242,9 @@ public:
beans::Property prop = it.next();
rtl::OUString name( prop.Name );
rtl::OUString value( getProperty( name, WINDOW_PROPERTY ) );
-fprintf(stderr, "original property: %s = %s\n", OUSTRING_CSTR(name), OUSTRING_CSTR(value));
+#if DEBUG_PRINT
+ fprintf(stderr, "original property: %s = %s\n", OUSTRING_CSTR(name), OUSTRING_CSTR(value));
+#endif
std::pair< rtl::OUString, rtl::OUString > pair( name, value );
maOriProps.push_back( pair );
}
@@ -372,7 +405,7 @@ fprintf(stderr, "original property: %s = %s\n", OUSTRING_CSTR(name), OUSTRING_CS
pChild->removeChild( *it );
for ( std::vector< Widget *>::const_iterator it = aChildChildren.begin();
- it != aChildChildren.end(); it++ )
+ it != aChildChildren.end(); it++ )
if ( !addChild( *it ) )
{ // failure
for ( std::vector< Widget *>::const_iterator jt = aChildChildren.begin();
@@ -439,7 +472,9 @@ fprintf(stderr, "original property: %s = %s\n", OUSTRING_CSTR(name), OUSTRING_CS
for ( PropList::const_iterator it = props.begin(); it != props.end(); it++ )
if ( it->first.equalsIgnoreAsciiCase( propName ) )
return it->second;
-fprintf(stderr, "Serious error: property '%s' not found\n", OUSTRING_CSTR(propName));
+#if DEBUG_PRINT
+ fprintf(stderr, "Serious error: property '%s' not found\n", OUSTRING_CSTR(propName));
+#endif
return rtl::OUString();
}
@@ -486,10 +521,14 @@ fprintf(stderr, "Serious error: property '%s' not found\n", OUSTRING_CSTR(propNa
rtl::OUString oriValue = getOriginalProperty( propName, rKind );
rtl::OUString newValue = getProperty( propName, rKind );
bool isTouched = oriValue != newValue;
-fprintf(stderr, "is property '%s' touched? %s (%s vs %s)\n", OUSTRING_CSTR(propName), isTouched ? "yes" : "no", OUSTRING_CSTR(oriValue), OUSTRING_CSTR(newValue));
+#if DEBUG_PRINT
+ fprintf(stderr, "is property '%s' touched? %s (%s vs %s)\n", OUSTRING_CSTR(propName), isTouched ? "yes" : "no", OUSTRING_CSTR(oriValue), OUSTRING_CSTR(newValue));
+#endif
return isTouched;
}
+ using LayoutWidget::setProperty;
+
void setProperty( rtl::OUString rPropName, PropertyKind rKind, uno::Any rValue )
{
switch ( rKind ) {
@@ -717,7 +756,7 @@ namespace FlatLayout
nRet++;
return nRet;
}
-};
+}
//** PropertiesList widget
@@ -743,7 +782,9 @@ class PropertiesList : public layout::Table
virtual ~AnyWidget()
{
+#if DEBUG_PRINT
fprintf(stderr, "~AnyWidget\n");
+#endif
}
void save( uno::Any aValue )
@@ -752,15 +793,15 @@ class PropertiesList : public layout::Table
checkProperty();
}
-void checkProperty()
-{
+ void checkProperty()
+ {
bool flag = mpWidget->isPropertyTouched( maPropName, maPropKind );
- if ( mpFlag && mpFlag->IsChecked() != flag )
+ if ( mpFlag && mpFlag->IsChecked() != (BOOL)flag )
{
CheckFlag( flag, true );
}
-}
+ }
void CheckFlag( bool bValue, bool bBlockCallback )
{
@@ -950,7 +991,9 @@ printf("Remove mpEdit and expand\n");
virtual void store()
{
-fprintf(stderr, "store number: %ld\n", rtl::OUString( GetText() ).toInt64());
+#if DEBUG_PRINT
+ fprintf(stderr, "store number: %ld\n", rtl::OUString( GetText() ).toInt64());
+#endif
save( uno::makeAny( rtl::OUString( GetText() ).toInt64() ) );
}
};
@@ -982,7 +1025,9 @@ fprintf(stderr, "store number: %ld\n", rtl::OUString( GetText() ).toInt64());
virtual ~AnyCheckBox()
{
+#if DEBUG_PRINT
fprintf(stderr, "~AnyCheckBox\n");
+#endif
}
virtual layout::Window *getWindow()
@@ -990,8 +1035,10 @@ fprintf(stderr, "store number: %ld\n", rtl::OUString( GetText() ).toInt64());
virtual void load()
{
-fprintf(stderr, "loading boolean value\n");
- Check( getValue().toInt64() );
+#if DEBUG_PRINT
+ fprintf(stderr, "loading boolean value\n");
+#endif
+ Check( getValue().toInt64() != 0 );
setLabel();
checkProperty();
}
@@ -1022,7 +1069,7 @@ fprintf(stderr, "loading boolean value\n");
virtual void load()
{
- SelectEntryPos( getValue().toInt32() );
+ SelectEntryPos( sal::static_int_cast< USHORT >( getValue().toInt32() ) );
checkProperty();
}
@@ -1108,7 +1155,9 @@ fprintf(stderr, "loading boolean value\n");
~PropertyEntry()
{
- fprintf(stderr, "REMOVING label, flag and value\n");
+#if DEBUG_PRINT
+ fprintf(stderr, "REMOVING label, flag and value\n");
+#endif
delete mpLabel;
delete mpFlag;
delete mpValue;
@@ -1224,7 +1273,7 @@ private:
rtl::OUString name( prop.Name );
if ( toIgnore( name ) )
continue;
- sal_uInt16 type = prop.Type.getTypeClass();
+ sal_uInt16 type = static_cast< sal_uInt16 >( prop.Type.getTypeClass() );
PropertyEntry *propEntry = PropertyEntry::construct(
pWidget, name, rKind, type, mpParentWindow );
@@ -1232,6 +1281,7 @@ private:
if ( propEntry )
{
Add( propEntry->mpLabel, false, false );
+
// HACK: one of these will return Null...
Add( propEntry->mpValue->getWindow(), true, false );
Add( propEntry->mpValue->getContainer(), true, false );
@@ -1246,6 +1296,7 @@ public:
void selectedWidget( Widget *pWidget )
{
clear();
+
if ( !pWidget )
return;
@@ -1262,6 +1313,7 @@ public:
void clear()
{
+ ///FIXME: crash
Container::Clear();
for ( std::list< PropertyEntry* >::iterator it = maPropertiesList.begin();
@@ -1283,26 +1335,34 @@ IMPL_LINK( PropertiesList::PropertyEntry::AnyWidget, ApplyPropertyHdl, layout::W
IMPL_LINK( PropertiesList::PropertyEntry::AnyWidget, FlagToggledHdl, layout::CheckBox *, pCheck )
{
-fprintf(stderr, "Property flag pressed -- is: %d\n", pCheck->IsChecked());
+#if DEBUG_PRINT
+ fprintf(stderr, "Property flag pressed -- is: %d\n", pCheck->IsChecked());
+#endif
if ( !mbBlockFlagCallback )
{
bool checked = pCheck->IsChecked();
if ( !checked ) // revert
-{
-fprintf(stderr, "revert\n");
+ {
+#if DEBUG_PRINT
+ fprintf(stderr, "revert\n");
+#endif
load();
-}
+ }
else
{
-fprintf(stderr, "user can't dirty the flag!\n");
+#if DEBUG_PRINT
+ fprintf(stderr, "user can't dirty the flag!\n");
+#endif
// User can't flag the property as dirty
// Actually, we may want to allow the designer to force a property to be stored.
// Could be useful when the default value of some new property wasn't yet decided...
CheckFlag( false, true );
}
}
-else
-fprintf(stderr, "Property flag pressed -- BLOCKED\n");
+#if DEBUG_PRINT
+ else
+ fprintf(stderr, "Property flag pressed -- BLOCKED\n");
+#endif
return 0;
}
@@ -1392,15 +1452,17 @@ public:
itemSelected( LISTBOX_ENTRY_NOTFOUND );
}
- ~SortListBox()
- {
- delete mpListBox;
- delete mpUpButton;
- delete mpDownButton;
- delete mpRemoveButton;
- }
+ virtual ~SortListBox();
};
+SortListBox::~SortListBox()
+{
+ delete mpListBox;
+ delete mpUpButton;
+ delete mpDownButton;
+ delete mpRemoveButton;
+}
+
IMPL_LINK( SortListBox, UpPressedHdl, layout::Button *, pBtn )
{
(void) pBtn;
@@ -1463,10 +1525,7 @@ public:
mpRootWidget = new Widget( xWidget, "root" );
}
- ~LayoutTree()
- {
- delete mpRootWidget;
- }
+ virtual ~LayoutTree();
Widget *getWidget( int nPos )
{
@@ -1489,7 +1548,7 @@ public:
if ( pos == -1 )
// if asked to select hidden root, select visible root
pos = 0;
- mpListBox->SelectEntryPos( pos );
+ mpListBox->SelectEntryPos( sal::static_int_cast< USHORT >( pos ) );
}
void rebuild()
@@ -1522,23 +1581,23 @@ public:
// print in XML format...
-static rtl::OUString toXMLNaming (const rtl::OUString &string)
-{
- rtl::OUStringBuffer buffer (string.getLength());
- sal_Unicode *str = string.pData->buffer;
- for (int i = 0; i < string.getLength(); i++) {
- if ( str[i] >= 'A' && str[i] <= 'Z' )
- {
- if ( i > 0 )
- buffer.append ((sal_Unicode) '-');
- buffer.append ((sal_Unicode) (str[i] - 'A' + 'a'));
+ static rtl::OUString toXMLNaming (const rtl::OUString &string)
+ {
+ rtl::OUStringBuffer buffer (string.getLength());
+ sal_Unicode *str = string.pData->buffer;
+ for (int i = 0; i < string.getLength(); i++) {
+ if ( str[i] >= 'A' && str[i] <= 'Z' )
+ {
+ if ( i > 0 )
+ buffer.append ((sal_Unicode) '-');
+ buffer.append ((sal_Unicode) (str[i] - 'A' + 'a'));
+ }
+ else
+ buffer.append ((sal_Unicode) str[i]);
}
- else
- buffer.append ((sal_Unicode) str[i]);
- }
- return buffer.makeStringAndClear();
-}
+ return buffer.makeStringAndClear();
+ }
void print()
{
@@ -1622,6 +1681,11 @@ protected:
}
};
+LayoutTree::~LayoutTree()
+{
+ delete mpRootWidget;
+}
+
//** EditorImpl
class EditorImpl : public LayoutTree::Listener
@@ -1656,7 +1720,7 @@ public:
EditorImpl( layout::Dialog *dialog,
// we should probable open this channel (or whatever its called) ourselves
uno::Reference< lang::XMultiServiceFactory > xMSF );
- ~EditorImpl();
+ virtual ~EditorImpl();
void loadFile( const rtl::OUString &aTestFile );
};
@@ -1669,7 +1733,9 @@ EditorImpl::EditorImpl( layout::Dialog *dialog,
//dialog->getContext()->getRoot(), uno::UNO_QUERY )
// dialog->GetPeer(), uno::UNO_QUERY )
{
-fprintf (stderr, "EditorImpl()\n");
+#if DEBUG_PRINT
+ fprintf (stderr, "EditorImpl()\n");
+#endif
// framework
mxToolkit = uno::Reference< awt::XToolkit >(
mxFactory->createInstance(
@@ -1678,7 +1744,9 @@ fprintf (stderr, "EditorImpl()\n");
assert( mxToolkit.is() );
// custom widgets
-fprintf (stderr, "custom widgets\n");
+#if DEBUG_PRINT
+ fprintf (stderr, "custom widgets\n");
+#endif
mpPropertiesList = new PropertiesList( dialog );
mpLayoutTree = new LayoutTree( dialog );
@@ -1710,11 +1778,11 @@ fprintf (stderr, "custom widgets\n");
}
#ifdef FILEDLG
-fprintf(stderr,"creating file dialog\n");
+ fprintf(stderr,"creating file dialog\n");
pImportDialog = new FileDialog( NULL/*(layout::Window *) dialog*/, 0 );
-fprintf(stderr,"connecting it\n");
+ fprintf(stderr,"connecting it\n");
pImportDialog->SetFileSelectHdl( LINK( this, EditorImpl, ImportDialogHdl ) );
-fprintf(stderr,"done file dialog\n");
+ fprintf(stderr,"done file dialog\n");
#endif
/* pImportButton = new layout::PushButton( dialog, "import-button" );
@@ -1755,7 +1823,10 @@ mxMSF->createInstance
uno::Reference< uno::XInterface >() );
}
-fprintf( stderr, "TEST: initing root\n" );
+#if DEBUG_PRINT
+ fprintf( stderr, "TEST: initing root\n" );
+#endif
+
uno::Reference< lang::XInitialization > xInit( xRoot, uno::UNO_QUERY );
if ( !xInit.is() )
{
@@ -1764,12 +1835,18 @@ fprintf( stderr, "TEST: initing root\n" );
uno::Reference< uno::XInterface >() );
}
-fprintf( stderr, "TEST: running parser\n" );
+#if DEBUG_PRINT
+ fprintf( stderr, "TEST: running parser\n" );
+#endif
uno::Sequence< uno::Any > aParams( 1 );
aParams[0] <<= aTestFile;
-fprintf( stderr, "TEST: do it\n" );
+#if DEBUG_PRINT
+ fprintf( stderr, "TEST: do it\n" );
+#endif
xInit->initialize( aParams );
-fprintf( stderr, "TEST: file loaded\n" );
+#if DEBUG_PRINT
+ fprintf( stderr, "TEST: file loaded\n" );
+#endif
mpLayoutTree->rebuild();
}
@@ -1829,7 +1906,9 @@ IMPL_LINK( EditorImpl, CreateWidgetHdl, layout::Button *, pBtn )
IMPL_LINK( EditorImpl, ImportButtonHdl, layout::PushButton *, pBtn )
{
(void) pBtn;
-fprintf(stderr, "IMPORT!\n");
+#if DEBUG_PRINT
+ fprintf(stderr, "IMPORT!\n");
+#endif
#ifdef FILEDLG
pImportDialog->Execute();
#endif
@@ -1840,10 +1919,12 @@ fprintf(stderr, "IMPORT!\n");
#ifdef FILEDLG
IMPL_LINK( EditorImpl, ImportDialogHdl, FileDialog *, pDialog )
{
+ UniString path = pDialog->GetPath();
//fprintf(stderr, "Executing import dialog!\n");
- UniString path = pDialog->GetPath();
-fprintf(stderr, "got import file: %s\n",rtl::OUStringToOString( path, RTL_TEXTENCODING_ASCII_US ).getStr() );
+#if DEBUG_PRINT
+ fprintf(stderr, "got import file: %s\n",rtl::OUStringToOString( path, RTL_TEXTENCODING_ASCII_US ).getStr() );
+#endif
return 0;
}