merge the formfield patch from ooo-build
[ooovba.git] / toolkit / source / layout / core / localized-string.cxx
blob9bc9df372832ad0e485280adb6f6e6e1e8595158
1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
5 * $RCSfile$
7 * $Revision$
9 * last change: $Author$ $Date$
11 * The Contents of this file are made available subject to
12 * the terms of GNU Lesser General Public License Version 2.1.
15 * GNU Lesser General Public License Version 2.1
16 * =============================================
17 * Copyright 2005 by Sun Microsystems, Inc.
18 * 901 San Antonio Road, Palo Alto, CA 94303, USA
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License version 2.1, as published by the Free Software Foundation.
24 * This library is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 * Lesser General Public License for more details.
29 * You should have received a copy of the GNU Lesser General Public
30 * License along with this library; if not, write to the Free Software
31 * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston,
32 * MA 02110-1301 USA
34 ************************************************************************/
36 #include "localized-string.hxx"
38 #include <toolkit/helper/property.hxx>
39 #include <vcl/window.hxx>
41 namespace layoutimpl
44 namespace css = ::com::sun::star;
45 using namespace css;
46 using rtl::OUString;
48 LocalizedString::LocalizedString()
49 : VCLXWindow()
53 void LocalizedString::ImplGetPropertyIds( std::list< sal_uInt16 > &ids )
55 PushPropertyIds( ids, BASEPROPERTY_TEXT, 0);
56 VCLXWindow::ImplGetPropertyIds( ids );
59 // XInterface
60 uno::Any LocalizedString::queryInterface( uno::Type const& rType )
61 throw(uno::RuntimeException)
63 uno::Any aRet = ::cppu::queryInterface( rType,
64 SAL_STATIC_CAST( awt::XFixedText*, this ) );
65 return (aRet.hasValue() ? aRet : VCLXWindow::queryInterface( rType ));
68 void LocalizedString::setText( OUString const& s )
69 throw(uno::RuntimeException)
71 ::vos::OGuard aGuard( GetMutex() );
73 if ( Window *w = GetWindow() )
74 return w->SetText( s );
77 OUString LocalizedString::getText()
78 throw(uno::RuntimeException)
80 ::vos::OGuard aGuard( GetMutex() );
82 if ( Window *w = GetWindow() )
83 return w->GetText();
84 return OUString();
87 } // namespace layoutimpl