LCOV - code coverage report
Current view: top level - chart2/source/controller/dialogs - res_Titles.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 1 96 1.0 %
Date: 2014-11-03 Functions: 2 10 20.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       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/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      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 .
      18             :  */
      19             : 
      20             : #include "res_Titles.hxx"
      21             : #include "ResId.hxx"
      22             : #include "TitleDialogData.hxx"
      23             : #include <svtools/controldims.hrc>
      24             : 
      25             : namespace chart
      26             : {
      27             : 
      28           0 : TitleResources::TitleResources( VclBuilderContainer& rBuilder, bool bShowSecondaryAxesTitle )
      29             : {
      30           0 :     rBuilder.get( m_pFT_Main, "labelMainTitle" );
      31           0 :     rBuilder.get( m_pFT_Sub, "labelSubTitle" );
      32           0 :     rBuilder.get( m_pEd_Main, "maintitle" );
      33           0 :     rBuilder.get( m_pEd_Sub, "subtitle" );
      34             : 
      35           0 :     rBuilder.get( m_pFT_XAxis, "labelPrimaryXaxis" );
      36           0 :     rBuilder.get( m_pFT_YAxis, "labelPrimaryYaxis" );
      37           0 :     rBuilder.get( m_pFT_ZAxis, "labelPrimaryZaxis" );
      38           0 :     rBuilder.get( m_pEd_XAxis, "primaryXaxis" );
      39           0 :     rBuilder.get( m_pEd_YAxis, "primaryYaxis" );
      40           0 :     rBuilder.get( m_pEd_ZAxis, "primaryZaxis" );
      41             : 
      42           0 :     rBuilder.get( m_pFT_SecondaryXAxis, "labelSecondaryXAxis" );
      43           0 :     rBuilder.get( m_pFT_SecondaryYAxis, "labelSecondaryYAxis" );
      44           0 :     rBuilder.get( m_pEd_SecondaryXAxis, "secondaryXaxis" );
      45           0 :     rBuilder.get( m_pEd_SecondaryYAxis, "secondaryYaxis" );
      46             : 
      47           0 :     m_pFT_SecondaryXAxis->Show( bShowSecondaryAxesTitle );
      48           0 :     m_pFT_SecondaryYAxis->Show( bShowSecondaryAxesTitle );
      49           0 :     m_pEd_SecondaryXAxis->Show( bShowSecondaryAxesTitle );
      50           0 :     m_pEd_SecondaryYAxis->Show( bShowSecondaryAxesTitle );
      51           0 : }
      52             : 
      53           0 : TitleResources::~TitleResources()
      54             : {
      55           0 : }
      56             : 
      57           0 : void TitleResources::SetUpdateDataHdl( const Link& rLink )
      58             : {
      59           0 :     sal_uLong nTimeout = 4*EDIT_UPDATEDATA_TIMEOUT;
      60             : 
      61           0 :     m_pEd_Main->EnableUpdateData( nTimeout );
      62           0 :     m_pEd_Main->SetUpdateDataHdl( rLink );
      63             : 
      64           0 :     m_pEd_Sub->EnableUpdateData( nTimeout );
      65           0 :     m_pEd_Sub->SetUpdateDataHdl( rLink );
      66             : 
      67           0 :     m_pEd_XAxis->EnableUpdateData( nTimeout );
      68           0 :     m_pEd_XAxis->SetUpdateDataHdl( rLink );
      69             : 
      70           0 :     m_pEd_YAxis->EnableUpdateData( nTimeout );
      71           0 :     m_pEd_YAxis->SetUpdateDataHdl( rLink );
      72             : 
      73           0 :     m_pEd_ZAxis->EnableUpdateData( nTimeout );
      74           0 :     m_pEd_ZAxis->SetUpdateDataHdl( rLink );
      75             : 
      76           0 :     m_pEd_SecondaryXAxis->EnableUpdateData( nTimeout );
      77           0 :     m_pEd_SecondaryXAxis->SetUpdateDataHdl( rLink );
      78             : 
      79           0 :     m_pEd_SecondaryYAxis->EnableUpdateData( nTimeout );
      80           0 :     m_pEd_SecondaryYAxis->SetUpdateDataHdl( rLink );
      81           0 : }
      82             : 
      83           0 : bool TitleResources::IsModified()
      84             : {
      85           0 :     return m_pEd_Main->IsModified()
      86           0 :         || m_pEd_Sub->IsModified()
      87           0 :         || m_pEd_XAxis->IsModified()
      88           0 :         || m_pEd_YAxis->IsModified()
      89           0 :         || m_pEd_ZAxis->IsModified()
      90           0 :         || m_pEd_SecondaryXAxis->IsModified()
      91           0 :         || m_pEd_SecondaryYAxis->IsModified();
      92             : }
      93             : 
      94           0 : void TitleResources::ClearModifyFlag()
      95             : {
      96           0 :     m_pEd_Main->ClearModifyFlag();
      97           0 :     m_pEd_Sub->ClearModifyFlag();
      98           0 :     m_pEd_XAxis->ClearModifyFlag();
      99           0 :     m_pEd_YAxis->ClearModifyFlag();
     100           0 :     m_pEd_ZAxis->ClearModifyFlag();
     101           0 :     m_pEd_SecondaryXAxis->ClearModifyFlag();
     102           0 :     m_pEd_SecondaryYAxis->ClearModifyFlag();
     103           0 : }
     104             : 
     105           0 : void TitleResources::writeToResources( const TitleDialogData& rInput )
     106             : {
     107           0 :     m_pFT_Main->Enable( rInput.aPossibilityList[0] );
     108           0 :     m_pFT_Sub->Enable( rInput.aPossibilityList[1] );
     109           0 :     m_pFT_XAxis->Enable( rInput.aPossibilityList[2] );
     110           0 :     m_pFT_YAxis->Enable( rInput.aPossibilityList[3] );
     111           0 :     m_pFT_ZAxis->Enable( rInput.aPossibilityList[4] );
     112           0 :     m_pFT_SecondaryXAxis->Enable( rInput.aPossibilityList[5] );
     113           0 :     m_pFT_SecondaryYAxis->Enable( rInput.aPossibilityList[6] );
     114             : 
     115           0 :     m_pEd_Main->Enable( rInput.aPossibilityList[0] );
     116           0 :     m_pEd_Sub->Enable( rInput.aPossibilityList[1] );
     117           0 :     m_pEd_XAxis->Enable( rInput.aPossibilityList[2] );
     118           0 :     m_pEd_YAxis->Enable( rInput.aPossibilityList[3] );
     119           0 :     m_pEd_ZAxis->Enable( rInput.aPossibilityList[4] );
     120           0 :     m_pEd_SecondaryXAxis->Enable( rInput.aPossibilityList[5] );
     121           0 :     m_pEd_SecondaryYAxis->Enable( rInput.aPossibilityList[6] );
     122             : 
     123           0 :     m_pEd_Main->SetText(rInput.aTextList[0]);
     124           0 :     m_pEd_Sub->SetText(rInput.aTextList[1]);
     125           0 :     m_pEd_XAxis->SetText(rInput.aTextList[2]);
     126           0 :     m_pEd_YAxis->SetText(rInput.aTextList[3]);
     127           0 :     m_pEd_ZAxis->SetText(rInput.aTextList[4]);
     128           0 :     m_pEd_SecondaryXAxis->SetText(rInput.aTextList[5]);
     129           0 :     m_pEd_SecondaryYAxis->SetText(rInput.aTextList[6]);
     130           0 : }
     131             : 
     132           0 : void TitleResources::readFromResources( TitleDialogData& rOutput )
     133             : {
     134           0 :     rOutput.aExistenceList[0] = !m_pEd_Main->GetText().isEmpty();
     135           0 :     rOutput.aExistenceList[1] = !m_pEd_Sub->GetText().isEmpty();
     136           0 :     rOutput.aExistenceList[2] = !m_pEd_XAxis->GetText().isEmpty();
     137           0 :     rOutput.aExistenceList[3] = !m_pEd_YAxis->GetText().isEmpty();
     138           0 :     rOutput.aExistenceList[4] = !m_pEd_ZAxis->GetText().isEmpty();
     139           0 :     rOutput.aExistenceList[5] = !m_pEd_SecondaryXAxis->GetText().isEmpty();
     140           0 :     rOutput.aExistenceList[6] = !m_pEd_SecondaryYAxis->GetText().isEmpty();
     141             : 
     142           0 :     rOutput.aTextList[0] = m_pEd_Main->GetText();
     143           0 :     rOutput.aTextList[1] = m_pEd_Sub->GetText();
     144           0 :     rOutput.aTextList[2] = m_pEd_XAxis->GetText();
     145           0 :     rOutput.aTextList[3] = m_pEd_YAxis->GetText();
     146           0 :     rOutput.aTextList[4] = m_pEd_ZAxis->GetText();
     147           0 :     rOutput.aTextList[5] = m_pEd_SecondaryXAxis->GetText();
     148           0 :     rOutput.aTextList[6] = m_pEd_SecondaryYAxis->GetText();
     149           0 : }
     150             : 
     151         102 : } //namespace chart
     152             : 
     153             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10