LCOV - code coverage report
Current view: top level - libreoffice/autodoc/source/display/toolkit - hf_linachain.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 35 35 100.0 %
Date: 2012-12-27 Functions: 7 8 87.5 %
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 <precomp.h>
      21             : #include <toolkit/hf_linachain.hxx>
      22             : 
      23             : 
      24             : // NOT FULLY DEFINED SERVICES
      25             : #include <toolkit/out_position.hxx>
      26             : 
      27             : 
      28             : 
      29        4253 : HF_LinkedNameChain::HF_LinkedNameChain( Xml::Element & o_rOut )
      30             :     :   HtmlMaker( o_rOut
      31        4253 :                         >> *new Html::Paragraph
      32        8506 :                             << new Html::ClassAttr("namechain") )
      33             : {
      34        4253 : }
      35             : 
      36        4253 : HF_LinkedNameChain::~HF_LinkedNameChain()
      37             : {
      38        4253 : }
      39             : 
      40             : void
      41        4134 : HF_LinkedNameChain::Produce_CompleteChain( const output::Position & i_curPosition,
      42             :                                            F_LinkMaker              i_linkMaker ) const
      43             : {
      44        4134 :     produce_Level(i_curPosition.RelatedNode(), i_curPosition, i_linkMaker);
      45        4134 : }
      46             : 
      47             : void
      48         118 : HF_LinkedNameChain::Produce_CompleteChain_forModule( const output::Position &  i_curPosition,
      49             :                                                      F_LinkMaker               i_linkMaker ) const
      50             : {
      51         118 :     if (i_curPosition.Depth() == 0)
      52         118 :         return;
      53         118 :     produce_Level(*i_curPosition.RelatedNode().Parent(), i_curPosition, i_linkMaker);
      54             : }
      55             : 
      56             : 
      57             : 
      58             : namespace
      59             : {
      60             : 
      61           1 : StreamStr aLinkBuf(200);
      62             : 
      63             : }
      64             : 
      65             : void
      66       21906 : HF_LinkedNameChain::produce_Level( output::Node &           i_levelNode,
      67             :                                    const output::Position & i_startPosition,
      68             :                                    F_LinkMaker              i_linkMaker ) const
      69             : {
      70       21906 :     if ( i_levelNode.Depth() > 0 )
      71             :     {
      72       17654 :         produce_Level( *i_levelNode.Parent(),
      73             :                        i_startPosition,
      74       17654 :                        i_linkMaker );
      75             :     }
      76             : 
      77       21906 :     aLinkBuf.reset();
      78             : 
      79             :     String
      80       21906 :         sFileName = (*i_linkMaker)(i_levelNode.Name());
      81             :     output::Position
      82       21906 :         aLevelPos(i_levelNode, sFileName);
      83             : 
      84       21906 :     i_startPosition.Get_LinkTo(aLinkBuf, aLevelPos);
      85             : 
      86       21906 :     if ( i_levelNode.Depth() > 0 )
      87             :     {
      88       17654 :         CurOut()
      89       52962 :         >> *new Html::Link(aLinkBuf.c_str())
      90       52962 :             << new Html::ClassAttr("namechain")
      91       35308 :             << i_levelNode.Name();
      92       17654 :         CurOut() << " :: ";
      93             :     }
      94             :     else
      95             :     {
      96        4252 :         CurOut()
      97       12756 :         >> *new Html::Link(aLinkBuf.c_str())
      98       12756 :             << new Html::ClassAttr("namechain")
      99        4252 :             << "::";
     100        4252 :         CurOut() << " ";
     101       21906 :     }
     102       21909 : }
     103             : 
     104             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10