Version 4.3.0.0.beta1, tag libreoffice-4.3.0.0.beta1
[LibreOffice.git] / svx / source / sidebar / paragraph / ParaLineSpacingPopup.cxx
blob8f50dd867fe2de74a6ef7c03a678566553d4dea5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #include "ParaLineSpacingPopup.hxx"
20 #include "ParaLineSpacingControl.hxx"
21 #include <boost/bind.hpp>
22 #include <unotools/viewoptions.hxx>
24 namespace svx { namespace sidebar {
26 ParaLineSpacingPopup::ParaLineSpacingPopup (
27 Window* pParent,
28 const ::boost::function<PopupControl*(PopupContainer*)>& rControlCreator)
29 : Popup(
30 pParent,
31 rControlCreator,
32 OUString( "Paragraph Line Spacing"))
34 SetPopupModeEndHandler(::boost::bind(&ParaLineSpacingPopup::PopupModeEndCallback, this));
40 ParaLineSpacingPopup::~ParaLineSpacingPopup (void)
47 void ParaLineSpacingPopup::Rearrange (SfxItemState currSPState,FieldUnit currMetricUnit,SvxLineSpacingItem* currSPItem,const ::sfx2::sidebar::EnumContext currentContext)
49 ProvideContainerAndControl();
51 ParaLineSpacingControl* pControl = dynamic_cast<ParaLineSpacingControl*>(mpControl.get());
52 if (pControl != NULL)
53 pControl->Rearrange(currSPState,currMetricUnit, currSPItem,currentContext);
56 void ParaLineSpacingPopup::PopupModeEndCallback (void)
58 ProvideContainerAndControl();
59 ParaLineSpacingControl* pControl = dynamic_cast<ParaLineSpacingControl*>(mpControl.get());
60 if (pControl == NULL)
61 return;
63 pControl->PopupModeEndCallback();
65 /*if( pControl->GetLastCustomState() == SPACING_CLOSE_BY_CUS_EDIT)
67 SvtViewOptions aWinOpt( E_WINDOW, SIDEBAR_SPACING_GLOBAL_VALUE );
68 ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq(1);
69 aSeq[0].Name = "Spacing";
70 aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt32( pControl->GetLastCustomValue() ));
71 aWinOpt.SetUserData( aSeq );
73 }*/
77 } } // end of namespace svx::sidebar
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */