2010-10-12 15:59:00 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-07-17 12:30:48 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2006-09-17 12:00:18 +00:00
|
|
|
|
2003-10-06 08:58:36 +00:00
|
|
|
#include "tp_TitleRotation.hxx"
|
|
|
|
|
|
|
|
#include "ResId.hxx"
|
|
|
|
#include "TabPages.hrc"
|
2007-05-22 16:49:40 +00:00
|
|
|
#include "chartview/ChartSfxItemIds.hxx"
|
2008-11-26 15:19:48 +00:00
|
|
|
#include "HelpIds.hrc"
|
2014-04-21 10:54:54 +02:00
|
|
|
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/eeitem.hxx>
|
|
|
|
#include <editeng/frmdiritem.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/intitem.hxx>
|
2003-10-06 08:58:36 +00:00
|
|
|
|
|
|
|
namespace chart
|
|
|
|
{
|
|
|
|
|
|
|
|
SchAlignmentTabPage::SchAlignmentTabPage(Window* pWindow,
|
2008-11-26 15:19:48 +00:00
|
|
|
const SfxItemSet& rInAttrs, bool bWithRotation) :
|
2013-09-01 15:28:18 +03:00
|
|
|
SfxTabPage(pWindow, "TitleRotationTabPage","modules/schart/ui/titlerotationtabpage.ui", rInAttrs)
|
2003-10-06 08:58:36 +00:00
|
|
|
{
|
2013-09-01 15:28:18 +03:00
|
|
|
get(m_pCtrlDial,"dialCtrl");
|
|
|
|
get(m_pFtRotate,"degreeL");
|
|
|
|
get(m_pNfRotate,"OrientDegree");
|
|
|
|
get(m_pCbStacked,"stackedCB");
|
|
|
|
get(m_pFtTextDirection,"textdirL");
|
|
|
|
get(m_pLbTextDirection,"textdirLB");
|
|
|
|
get(m_pFtABCD,"labelABCD");
|
|
|
|
m_pCtrlDial->SetText(m_pFtABCD->GetText());
|
|
|
|
m_pOrientHlp = new svx::OrientationHelper(*m_pCtrlDial, *m_pNfRotate, *m_pCbStacked);
|
|
|
|
|
2014-02-21 12:53:51 +01:00
|
|
|
m_pCbStacked->EnableTriState( false );
|
2014-01-28 20:02:54 +01:00
|
|
|
m_pOrientHlp->Enable( true );
|
2014-02-24 12:25:02 +01:00
|
|
|
m_pOrientHlp->AddDependentWindow( *m_pFtRotate, TRISTATE_TRUE );
|
2008-11-26 15:19:48 +00:00
|
|
|
|
|
|
|
if( !bWithRotation )
|
|
|
|
{
|
2013-09-01 15:28:18 +03:00
|
|
|
m_pOrientHlp->Hide();
|
2008-11-26 15:19:48 +00:00
|
|
|
}
|
2003-10-06 08:58:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SchAlignmentTabPage::~SchAlignmentTabPage()
|
|
|
|
{
|
2013-09-01 15:28:18 +03:00
|
|
|
delete m_pOrientHlp;
|
2003-10-06 08:58:36 +00:00
|
|
|
}
|
|
|
|
|
2008-11-26 15:19:48 +00:00
|
|
|
SfxTabPage* SchAlignmentTabPage::Create(Window* pParent,
|
|
|
|
const SfxItemSet& rInAttrs)
|
|
|
|
{
|
|
|
|
return new SchAlignmentTabPage(pParent, rInAttrs);
|
|
|
|
}
|
|
|
|
|
|
|
|
SfxTabPage* SchAlignmentTabPage::CreateWithoutRotation(Window* pParent,
|
|
|
|
const SfxItemSet& rInAttrs)
|
2003-10-06 08:58:36 +00:00
|
|
|
{
|
2008-11-26 15:19:48 +00:00
|
|
|
return new SchAlignmentTabPage(pParent, rInAttrs, false);
|
2003-10-06 08:58:36 +00:00
|
|
|
}
|
|
|
|
|
2014-06-10 17:23:12 +02:00
|
|
|
bool SchAlignmentTabPage::FillItemSet(SfxItemSet* rOutAttrs)
|
2003-10-06 08:58:36 +00:00
|
|
|
{
|
2011-01-03 14:04:34 +01:00
|
|
|
//Since 04/1998 text can be rotated by an arbitrary angle: SCHATTR_TEXT_DEGREES
|
2014-02-24 12:25:02 +01:00
|
|
|
bool bStacked = m_pOrientHlp->GetStackedState() == TRISTATE_TRUE;
|
2014-06-10 17:23:12 +02:00
|
|
|
rOutAttrs->Put( SfxBoolItem( SCHATTR_TEXT_STACKED, bStacked ) );
|
2003-10-06 08:58:36 +00:00
|
|
|
|
2013-09-01 15:28:18 +03:00
|
|
|
sal_Int32 nDegrees = bStacked ? 0 : m_pCtrlDial->GetRotation();
|
2014-06-10 17:23:12 +02:00
|
|
|
rOutAttrs->Put( SfxInt32Item( SCHATTR_TEXT_DEGREES, nDegrees ) );
|
2008-11-26 15:19:48 +00:00
|
|
|
|
2013-09-01 15:28:18 +03:00
|
|
|
SvxFrameDirection aDirection( m_pLbTextDirection->GetSelectEntryValue() );
|
2014-06-10 17:23:12 +02:00
|
|
|
rOutAttrs->Put( SfxInt32Item( EE_PARA_WRITINGDIR, aDirection ) );
|
2008-11-26 15:19:48 +00:00
|
|
|
|
2014-03-26 15:34:49 +02:00
|
|
|
return true;
|
2003-10-06 08:58:36 +00:00
|
|
|
}
|
|
|
|
|
2014-06-11 10:35:24 +02:00
|
|
|
void SchAlignmentTabPage::Reset(const SfxItemSet* rInAttrs)
|
2003-10-06 08:58:36 +00:00
|
|
|
{
|
2014-06-11 10:35:24 +02:00
|
|
|
const SfxPoolItem* pItem = GetItem( *rInAttrs, SCHATTR_TEXT_DEGREES );
|
2003-10-06 08:58:36 +00:00
|
|
|
|
2004-08-20 07:46:38 +00:00
|
|
|
sal_Int32 nDegrees = pItem ? ((const SfxInt32Item*)pItem)->GetValue() : 0;
|
2013-09-01 15:28:18 +03:00
|
|
|
m_pCtrlDial->SetRotation( nDegrees );
|
2003-10-06 08:58:36 +00:00
|
|
|
|
2014-06-11 10:35:24 +02:00
|
|
|
pItem = GetItem( *rInAttrs, SCHATTR_TEXT_STACKED );
|
2004-08-20 07:46:38 +00:00
|
|
|
bool bStacked = pItem && ((const SfxBoolItem*)pItem)->GetValue();
|
2014-02-24 12:25:02 +01:00
|
|
|
m_pOrientHlp->SetStackedState( bStacked ? TRISTATE_TRUE : TRISTATE_FALSE );
|
2008-11-26 15:19:48 +00:00
|
|
|
|
2014-06-11 10:35:24 +02:00
|
|
|
if( rInAttrs->GetItemState(EE_PARA_WRITINGDIR, true, &pItem) == SFX_ITEM_SET)
|
2013-09-01 15:28:18 +03:00
|
|
|
m_pLbTextDirection->SelectEntryValue( SvxFrameDirection(((const SvxFrameDirectionItem*)pItem)->GetValue()) );
|
2003-10-06 08:58:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} //namespace chart
|
|
|
|
|
2010-10-12 15:59:00 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|