diff options
author | Povilas Kanapickas <povilas.kanapickas@gmail.com> | 2010-10-18 16:52:05 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2010-10-18 16:52:27 +0100 |
commit | 849a713ffd29a58ae79e48f80835c28bbd9d5a72 (patch) | |
tree | 7d2c662f43a00f3bc04a0d51c685544074538a5c /toolkit/source/layout | |
parent | f7cbde525450a1a9427873c264791c65056c4f2a (diff) |
remove non-compiled code
Diffstat (limited to 'toolkit/source/layout')
-rw-r--r-- | toolkit/source/layout/core/container.cxx | 41 | ||||
-rw-r--r-- | toolkit/source/layout/core/helper.cxx | 69 | ||||
-rw-r--r-- | toolkit/source/layout/core/import.hxx | 48 | ||||
-rw-r--r-- | toolkit/source/layout/core/proplist.cxx | 25 | ||||
-rw-r--r-- | toolkit/source/layout/core/root.cxx | 18 | ||||
-rw-r--r-- | toolkit/source/layout/vcl/wrapper.cxx | 63 |
6 files changed, 0 insertions, 264 deletions
diff --git a/toolkit/source/layout/core/container.cxx b/toolkit/source/layout/core/container.cxx index 7c7556a79929..f5822bc4569a 100644 --- a/toolkit/source/layout/core/container.cxx +++ b/toolkit/source/layout/core/container.cxx @@ -104,10 +104,6 @@ Container::setChildParent( const uno::Reference< awt::XLayoutConstrains >& xChil if ( xContChild.is() ) { xContChild->setParent( uno::Reference< awt::XLayoutContainer >( this ) ); -#if 0 - assert( !mxLayoutUnit.is() ); - xContChild->setLayoutUnit( mxLayoutUnit ); -#endif } } @@ -118,46 +114,9 @@ Container::unsetChildParent( const uno::Reference< awt::XLayoutConstrains >& xCh if ( xContChild.is() ) { xContChild->setParent( uno::Reference< awt::XLayoutContainer >() ); -#if 0 - xContChild->setLayoutUnit( uno::Reference< awt::XLayoutUnit >() ); -#endif } } -#if 0 -std::string -Container::getLabel() // debug label -{ - std::string depth; - uno::Reference< awt::XLayoutContainer > xContainer( this ); - while ( xContainer.is() ) - { - int node = 0; // child nb - uno::Reference< awt::XLayoutContainer > xParent = xContainer->getContainerParent(); - if ( xParent.is() ) - { - - uno::Sequence< uno::Reference< awt::XLayoutConstrains > > aChildren; - aChildren = xParent->getChildren(); - for ( node = 0; node < aChildren.getLength(); node++ ) - if ( aChildren[ node ] == xContainer ) - break; - } - - char str[ 8 ]; - snprintf( str, 8, "%d", node ); - if ( depth.empty() ) - depth = std::string( str ); - else - depth = std::string( str ) + ":" + depth; - - xContainer = xParent; - } - - return std::string( getName() ) + " (" + depth + ")"; -} -#endif - void Container::propertiesChanged() { // cl: why this assertion? This is also called to set properties at the top level widget which has no parent!? diff --git a/toolkit/source/layout/core/helper.cxx b/toolkit/source/layout/core/helper.cxx index 70e1f82dce51..1434054d8cf9 100644 --- a/toolkit/source/layout/core/helper.cxx +++ b/toolkit/source/layout/core/helper.cxx @@ -70,26 +70,6 @@ getParent( uno::Reference< uno::XInterface > xRef ) return uno::Reference< awt::XWindowPeer >(); } -#if 0 -static uno::Reference< awt::XWindowPeer > -getToplevel( uno::Reference< uno::XInterface > xRef ) -{ - uno::Reference< awt::XWindowPeer > xTop, i; - while ( ( i = uno::Reference< awt::XWindowPeer >( xRef, uno::UNO_QUERY ) ).is() ) - { - xTop = i; - - uno::Reference< awt::XLayoutContainer > xCont( xRef, uno::UNO_QUERY ); - if ( xCont.is() ) - xRef = xCont->getParent(); - else - xRef = uno::Reference< awt::XWindowPeer >(); - } - - return xTop; -} -#endif - } #include "bin.hxx" @@ -142,13 +122,7 @@ uno::Reference <awt::XLayoutConstrains> WidgetFactory::toolkitCreateWidget (uno: { desc.Type = awt::WindowClass_SIMPLE; -#if 0 - // top container -- a wrapper for framewindow -- is de-coupled - // from awt::XWindowPeer. So, getParent() fails at it. - uno::Reference< awt::XWindowPeer > xWinParent = getParent( xParent ); -#else uno::Reference< awt::XWindowPeer > xWinParent( xParent, uno::UNO_QUERY ); -#endif assert( xParent.is() ); assert( xWinParent.is() ); /* @@ -197,18 +171,6 @@ uno::Reference <awt::XLayoutConstrains> WidgetFactory::toolkitCreateWidget (uno: return uno::Reference< awt::XLayoutConstrains >(); } -#if 0 // This shadows the show="false" property and seems otherwise - // unnecessary - - // default to visible, let then people change it on properties - if ( ! bToplevel ) - { - uno::Reference< awt::XWindow> xWindow( xPeer, uno::UNO_QUERY ); - if ( xWindow.is() ) - xWindow->setVisible( true ); - } -#endif - return xPeer; } @@ -325,25 +287,6 @@ PropHelper::getFastPropertyValue( uno::Any& rValue, { OSL_ASSERT( nHandle >= 0 && nHandle < (sal_Int32) maDetails.size() ); const PropDetails &rInfo = maDetails[ nHandle ]; -#if 0 - switch ( rInfo.aType.getTypeClass() ) - { -#define MAP(classtype,ctype) \ - case uno::TypeClass_##classtype: \ - rValue <<= *(ctype *)(rInfo.pValue); \ - break - MAP( DOUBLE, double ); - MAP( SHORT, sal_Int16 ); - MAP( LONG, sal_Int32 ); - MAP( UNSIGNED_SHORT, sal_uInt16 ); - MAP( UNSIGNED_LONG, sal_uInt32 ); - MAP( STRING, ::rtl::OUString ); - default: - DBG_ERROR( "ERROR: unknown type to map!" ); - break; - } -#undef MAP -#endif rValue.setValue( rInfo.pValue, rInfo.aType ); } @@ -598,14 +541,9 @@ Window* WidgetFactory::layoutCreateWindow (VCLXWindow** component, Window *paren } else if ( name.equalsAscii( "tabpage" ) ) { -#if 0 - if ( !parent ) - parent = layout::TabPage::global_parent; -#else if (layout::TabPage::global_parent) parent = layout::TabPage::global_parent; layout::TabPage::global_parent = 0; -#endif //window = new TabPage( parent, ImplGetWinBits( attributes, 0 ) ); attributes ^= awt::WindowAttribute::SHOW; WinBits nStyle = ImplGetWinBits( attributes, 0 ); @@ -629,13 +567,6 @@ Window* WidgetFactory::layoutCreateWindow (VCLXWindow** component, Window *paren window = new Window( parent, ImplGetWinBits( attributes, 0 ) ); *component = new layoutimpl::LocalizedString(); } -#if 0 // parent paranoia - else if ( name.equalsAscii( "listbox" ) ) - { - window = new ListBox (parent, ImplGetWinBits (attributes, 0)); - *component = new VCLXListBox (); - } -#endif else if (name.equalsAscii ("svxfontlistbox") || name.equalsAscii ("svxlanguagebox")) { diff --git a/toolkit/source/layout/core/import.hxx b/toolkit/source/layout/core/import.hxx index 0b49c559dd92..2eea1b0975ee 100644 --- a/toolkit/source/layout/core/import.hxx +++ b/toolkit/source/layout/core/import.hxx @@ -89,54 +89,6 @@ private: RadioGroupsMap mxRadioGroups; }; -#if 0 -// generator -class Widget -{ -public: - Widget( css::uno::Reference< css::awt::XToolkit > xToolkit, - css::uno::Reference< css::awt::XWindow > xToplevel, - rtl::OUString unoName, long attrbs ); - virtual ~Widget(); - - virtual void setProperties( const PropList &rProps ); - - virtual bool addChild( Widget *pChild ); - virtual void setChildProperties( Widget *pChild, const PropList &rProps ); - - inline css::uno::Reference< css::awt::XLayoutConstrains > getPeer() - { return mxWidget; } - - inline css::uno::Reference< css::awt::XLayoutConstrains > getContainer() - { return mxContainer; } - -protected: - css::uno::Reference< css::awt::XLayoutConstrains > mxWidget; - css::uno::Reference< css::awt::XLayoutContainer > mxContainer; -}; - -class Root -{ -public: - Root( css::uno::Reference< css::awt::XToolkit > xToolkit ) - : mxToolkit( xToolkit ) {} - ~Root(); - - virtual Widget *create( rtl::OUString id, const rtl::OUString unoName, long attrbs ); - - css::uno::Reference< css::awt::XLayoutConstrains > getById( rtl::OUString id ); - inline css::uno::Reference< css::awt::XLayoutConstrains > getToplevel(); - -protected: - css::uno::Reference< css::awt::XToolkit > mxToolkit; - Widget *mpToplevel; - - typedef std::hash_map< rtl::OUString, css::uno::Reference< css::awt::XLayoutConstrains >, - rtl::OUStringHash > ItemHash; - ItemHash maItems; -}; -#endif - // parser class ImportContext : public ::cppu::WeakImplHelper1< css::xml::input::XRoot > { diff --git a/toolkit/source/layout/core/proplist.cxx b/toolkit/source/layout/core/proplist.cxx index d1b6a9b9f4ea..24c9bc471833 100644 --- a/toolkit/source/layout/core/proplist.cxx +++ b/toolkit/source/layout/core/proplist.cxx @@ -349,31 +349,6 @@ static const AttributesMap attribsMap[] = }; static const int attribsMapLen = sizeof( attribsMap ) / sizeof( AttributesMap ); -#if 0 -long getAttribute( const OUString &rName, bool bTopWindow ) -{ - - int min = 0, max = attribsMapLen - 1, mid, cmp; - do - { - mid = min +( max - min )/2; - cmp = rName.compareToAscii( attribsMap[ mid ].name ); - if ( cmp > 0 ) - min = mid+1; - else if ( cmp < 0 ) - max = mid-1; - else - { - if ( bTopWindow || attribsMap[ mid ].value ) - return attribsMap[ mid ].windowAttr; - return 0; - } - } - while ( min <= max ); - return 0; -} -#endif - void propsFromAttributes( const uno::Reference<xml::input::XAttributes> & xAttributes, PropList &rProps, sal_Int32 nNamespace ) { diff --git a/toolkit/source/layout/core/root.cxx b/toolkit/source/layout/core/root.cxx index b360595aebec..f5b96d94d5ae 100644 --- a/toolkit/source/layout/core/root.cxx +++ b/toolkit/source/layout/core/root.cxx @@ -330,24 +330,6 @@ LayoutWidget *LayoutRoot::create( OUString id, const OUString unoName, long attr return pWidget; } -#if 0 -uno::Reference< awt::XLayoutConstrains > LayoutRoot::getToplevel() -{ - if ( mpToplevel ) - return mpToplevel->getPeer(); - return uno::Reference< awt::XLayoutConstrains > (); -} - -uno::Reference< awt::XLayoutConstrains > LayoutRoot::getById( OUString id ) -{ - uno::Reference< awt::XLayoutConstrains > rRef = 0; - ItemHash::iterator it = maItems.find( id ); - if ( it != maItems.end() ) - rRef = it->second; - return rRef; -} -#endif - LayoutWidget::LayoutWidget( uno::Reference< awt::XToolkit > xToolkit, uno::Reference< awt::XLayoutContainer > xParent, OUString unoName, long attrbs ) diff --git a/toolkit/source/layout/vcl/wrapper.cxx b/toolkit/source/layout/vcl/wrapper.cxx index 9b210925f25c..3acb946f7545 100644 --- a/toolkit/source/layout/vcl/wrapper.cxx +++ b/toolkit/source/layout/vcl/wrapper.cxx @@ -1126,25 +1126,6 @@ void TabControl::InsertPage (sal_uInt16 id, OUString const& title, sal_uInt16 po #else GetTabPage (id)->SetText (title); #endif - -#if 0 - /// This so seems the right solution, but it makes the buttons of the - /// tabdialog move up - - ::TabPage *page = GetTabPage (id); - if (Window *w = dynamic_cast <Window*> (page)) - { - w->SetParent (this); - //GetVCLXTabControl ()->Box_Base::addChild (uno::Reference <awt::XLayoutConstrains> (w->GetPeer (), uno::UNO_QUERY)); - //GetVCLXTabControl ()->Box_Base::AddChild (uno::Reference <awt::XLayoutConstrains> (w->GetPeer (), uno::UNO_QUERY)); - //GetVCLXTabControl ()->AddChild (w); - //GetVCLXTabControl ()->AddChild (uno::Reference <awt::XLayoutConstrains> (w->GetPeer (), uno::UNO_QUERY)); - //uno::Reference <uno::XInterface> x (page->GetWindowPeer()); - //GetVCLXTabControl ()->AddChild (uno::Reference <awt::XLayoutConstrains> (page->::Window::GetWindowPeer (), uno::UNO_QUERY)); - //GetVCLXTabControl ()->AddChild (uno::Reference <awt::XLayoutConstrains> (page->GetComponentInterface (), uno::UNO_QUERY)); - } - getImpl ().redraw (); -#endif } void TabControl::RemovePage (sal_uInt16 id) { @@ -1175,21 +1156,6 @@ sal_uInt16 TabControl::GetCurPageId () const void TabControl::SetTabPage (sal_uInt16 id, ::TabPage* page) { GetTabControl ()->SetTabPage (id, page); - -#if 0 - /// This so seems the right solution, but it makes the buttons of the - /// tabdialog move up - if (Window *w = dynamic_cast <Window*> (page)) - { - w->SetParent (this); - //GetVCLXTabControl ()->Box_Base::addChild (uno::Reference <awt::XLayoutConstrains> (w->GetPeer (), uno::UNO_QUERY)); - //GetVCLXTabControl ()->Box_Base::AddChild (uno::Reference <awt::XLayoutConstrains> (w->GetPeer (), uno::UNO_QUERY)); - //GetVCLXTabControl ()->AddChild (w); - //GetVCLXTabControl ()->AddChild (uno::Reference <awt::XLayoutConstrains> (w->GetPeer (), uno::UNO_QUERY)); - //GetVCLXTabControl ()->AddChild (uno::Reference <awt::XLayoutConstrains> (page->GetWindowPeer (), uno::UNO_QUERY)); - //GetVCLXTabControl ()->AddChild (uno::Reference <awt::XLayoutConstrains> (page->GetComponentInterface (), uno::UNO_QUERY)); - } -#endif getImpl ().redraw (); } ::TabPage* TabControl::GetTabPage (sal_uInt16 id) const @@ -1223,17 +1189,6 @@ void TabControl::SetTabPageSizePixel (Size const& size) } Size TabControl::GetTabPageSizePixel () const { -#if 0 - //return GetTabControl ()->GetTabPageSizePixel (); - static size_t const tab_page_first_index = 1; - for (size_t i = 0; i < GetPageCount (); i++) - { - ::TabPage *p = GetTabPage (i + tab_page_first_index); - //if (dynamic_cast<Windowt*> (p)) - if (i) // URG - return p->GetOptimalSize (WINDOWSIZE_MINIMUM); - } -#endif return GetTabControl ()->GetTabPageSizePixel (); } @@ -1391,10 +1346,6 @@ public: { DBG_ERROR( "ERROR: failed to load image: `%s'" /*, pName*/ ); } -#if 0 - else - getImpl().mxGraphic->...(); -#endif } }; @@ -1410,20 +1361,6 @@ void FixedImage::setImage( ::Image const& i ) //getImpl().mxGraphic = } -#if 0 - -FixedImage::FixedImage( const char *pName ) - : pImpl( new FixedImageImpl( pName ) ) -{ -} - -FixedImage::~FixedImage() -{ - delete pImpl; -} - -#endif - IMPL_CONSTRUCTORS( ProgressBar, Control, "ProgressBar" ); IMPL_GET_IMPL( ProgressBar ); |