Files
libreoffice/cui/source/options/optctl.cxx

155 lines
5.1 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: clarify Option->Language UI option Patch contributed by Herbert Duerr http://svn.apache.org/viewvc?view=revision&revision=1173991 cws mba34issues01: #i117712#: fix several resource errors introduced by IAccessible2 implementation Patch contributed by Mathias Bauer http://svn.apache.org/viewvc?view=revision&revision=1173991 cws mba34issues01: #i117709#: add missing string resource Patch contributed by Mathias Bauer http://svn.apache.org/viewvc?view=revision&revision=1172348 cws mba34issues01: #i117716#: fix missing resources my removing unused code Patch contributed by Mathias Bauer http://svn.apache.org/viewvc?view=revision&revision=1172345 re-add Crystal, Tango, Oxygen icon theme listings. correct method signature Patch contributed by Jean-Louis 'Hans' Fuchs http://svn.apache.org/viewvc?view=revision&revision=1306725 i#119063 - correct serf integration Patch contributed by Oliver-Rainer Wittmann http://svn.apache.org/viewvc?view=revision&revision=1300521 i#119036 - adapt serf integration -- use transfer-encoding 'chunked' on HTTPS -- switch transfer-encoding between 'chunked' and none on 413 HTTP status code -- refactoring -- improve user experience of certification dialog - only shown once Patch contributed by Oliver-Rainer Wittmann http://svn.apache.org/viewvc?view=revision&revision=1299727 118569: Use whole certification chain for verification. Patch contributed by Andre Fischer http://svn.apache.org/viewvc?view=revision&revision=1295493 serf integration: improve credential input handling Patch contributed by Oliver-Rainer Wittmann http://svn.apache.org/viewvc?view=revision&revision=1294557 warning-free ucb/source/ucp/webdav Patch contributed by Pavel Janik http://svn.apache.org/viewvc?view=revision&revision=1294086 some refactoring to PROPPATCH and PROPFIND requests Patch contributed by Oliver-Rainer Wittmann http://svn.apache.org/viewvc?view=revision&revision=1293281 i#118569: Replace neon with serf Patch contributed by Oliver-Rainer Wittmann http://svn.apache.org/viewvc?view=revision&revision=1292832 http://svn.apache.org/viewvc?view=revision&revision=1292794 remove OS/2 conditionals for now. re-enable webdav unit tests.
2012-10-04 11:25:41 +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 .
*/
2009-10-31 00:36:06 +01:00
#include "optctl.hxx"
#include <dialmgr.hxx>
#include <cuires.hrc>
2009-10-31 00:36:06 +01:00
#include <svl/ctloptions.hxx>
// class SvxCTLOptionsPage -----------------------------------------------------
IMPL_LINK_NOARG(SvxCTLOptionsPage, SequenceCheckingCB_Hdl)
2009-10-31 00:36:06 +01:00
{
bool bIsSequenceChecking = m_pSequenceCheckingCB->IsChecked();
m_pRestrictedCB->Enable( bIsSequenceChecking );
m_pTypeReplaceCB->Enable( bIsSequenceChecking );
2009-10-31 00:36:06 +01:00
// #i48117#: by default restricted and type&replace have to be switched on
if(bIsSequenceChecking)
{
m_pTypeReplaceCB->Check( true );
m_pRestrictedCB->Check( true );
2009-10-31 00:36:06 +01:00
}
return 0;
}
SvxCTLOptionsPage::SvxCTLOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet ) :
2009-10-31 00:36:06 +01:00
SfxTabPage( pParent, "OptCTLPage", "cui/ui/optctlpage.ui", &rSet )
2009-10-31 00:36:06 +01:00
{
get( m_pSequenceCheckingCB, "sequencechecking");
get( m_pRestrictedCB, "restricted");
get( m_pTypeReplaceCB, "typeandreplace");
get( m_pMovementLogicalRB, "movementlogical");
get( m_pMovementVisualRB, "movementvisual");
get( m_pNumeralsLB, "numerals");
2009-10-31 00:36:06 +01:00
m_pSequenceCheckingCB->SetClickHdl( LINK( this, SvxCTLOptionsPage, SequenceCheckingCB_Hdl ) );
2009-10-31 00:36:06 +01:00
m_pNumeralsLB->SetDropDownLineCount( m_pNumeralsLB->GetEntryCount() );
2009-10-31 00:36:06 +01:00
}
2009-10-31 00:36:06 +01:00
SvxCTLOptionsPage::~SvxCTLOptionsPage()
{
}
SfxTabPage* SvxCTLOptionsPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
2009-10-31 00:36:06 +01:00
{
return new SvxCTLOptionsPage( pParent, *rAttrSet );
2009-10-31 00:36:06 +01:00
}
bool SvxCTLOptionsPage::FillItemSet( SfxItemSet* )
2009-10-31 00:36:06 +01:00
{
bool bModified = false;
2009-10-31 00:36:06 +01:00
SvtCTLOptions aCTLOptions;
// Sequence checking
bool bChecked = m_pSequenceCheckingCB->IsChecked();
if ( m_pSequenceCheckingCB->IsValueChangedFromSaved() )
2009-10-31 00:36:06 +01:00
{
aCTLOptions.SetCTLSequenceChecking( bChecked );
bModified = true;
2009-10-31 00:36:06 +01:00
}
bChecked = m_pRestrictedCB->IsChecked();
if( m_pRestrictedCB->IsValueChangedFromSaved() )
2009-10-31 00:36:06 +01:00
{
aCTLOptions.SetCTLSequenceCheckingRestricted( bChecked );
bModified = true;
2009-10-31 00:36:06 +01:00
}
bChecked = m_pTypeReplaceCB->IsChecked();
if( m_pTypeReplaceCB->IsValueChangedFromSaved())
2009-10-31 00:36:06 +01:00
{
aCTLOptions.SetCTLSequenceCheckingTypeAndReplace(bChecked);
bModified = true;
2009-10-31 00:36:06 +01:00
}
bool bLogicalChecked = m_pMovementLogicalRB->IsChecked();
if ( m_pMovementLogicalRB->IsValueChangedFromSaved() ||
m_pMovementVisualRB->IsValueChangedFromSaved() )
2009-10-31 00:36:06 +01:00
{
SvtCTLOptions::CursorMovement eMovement =
bLogicalChecked ? SvtCTLOptions::MOVEMENT_LOGICAL : SvtCTLOptions::MOVEMENT_VISUAL;
aCTLOptions.SetCTLCursorMovement( eMovement );
bModified = true;
2009-10-31 00:36:06 +01:00
}
if ( m_pNumeralsLB->IsValueChangedFromSaved() )
2009-10-31 00:36:06 +01:00
{
sal_uInt16 nPos = m_pNumeralsLB->GetSelectEntryPos();
2009-10-31 00:36:06 +01:00
aCTLOptions.SetCTLTextNumerals( (SvtCTLOptions::TextNumerals)nPos );
bModified = true;
2009-10-31 00:36:06 +01:00
}
return bModified;
}
void SvxCTLOptionsPage::Reset( const SfxItemSet* )
2009-10-31 00:36:06 +01:00
{
SvtCTLOptions aCTLOptions;
m_pSequenceCheckingCB->Check( aCTLOptions.IsCTLSequenceChecking() );
m_pRestrictedCB->Check( aCTLOptions.IsCTLSequenceCheckingRestricted() );
m_pTypeReplaceCB->Check( aCTLOptions.IsCTLSequenceCheckingTypeAndReplace() );
2009-10-31 00:36:06 +01:00
SvtCTLOptions::CursorMovement eMovement = aCTLOptions.GetCTLCursorMovement();
switch ( eMovement )
{
case SvtCTLOptions::MOVEMENT_LOGICAL :
m_pMovementLogicalRB->Check();
2009-10-31 00:36:06 +01:00
break;
case SvtCTLOptions::MOVEMENT_VISUAL :
m_pMovementVisualRB->Check();
2009-10-31 00:36:06 +01:00
break;
default:
SAL_WARN( "cui.options", "SvxCTLOptionsPage::Reset(): invalid movement enum" );
2009-10-31 00:36:06 +01:00
}
sal_uInt16 nPos = (sal_uInt16)aCTLOptions.GetCTLTextNumerals();
DBG_ASSERT( nPos < m_pNumeralsLB->GetEntryCount(), "SvxCTLOptionsPage::Reset(): invalid numerals enum" );
m_pNumeralsLB->SelectEntryPos( nPos );
m_pSequenceCheckingCB->SaveValue();
m_pRestrictedCB->SaveValue();
m_pTypeReplaceCB->SaveValue();
m_pMovementLogicalRB->SaveValue();
m_pMovementVisualRB->SaveValue();
m_pNumeralsLB->SaveValue();
bool bIsSequenceChecking = m_pSequenceCheckingCB->IsChecked();
m_pRestrictedCB->Enable( bIsSequenceChecking );
m_pTypeReplaceCB->Enable( bIsSequenceChecking );
2009-10-31 00:36:06 +01:00
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */