original_string: private function writeDefinedNameForNamedRange(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_NamedRange $pNamedRange)
      {
          // definedName for named range
          $objWriter->startElement('definedName');
          $objWriter->writeAttribute('name', $pNamedRange->getName());
          if ($pNamedRange->getLocalOnly()) {
              $objWriter->writeAttribute('localSheetId', $pNamedRange->getScope()->getParent()->getIndex($pNamedRange->getScope()));
          }
  
          // Create absolute coordinate and write as raw text
          $range = PHPExcel_Cell::splitRange($pNamedRange->getRange());
          for ($i = 0; $i < count($range); $i++) {
              $range[$i][0] = '\'' . str_replace("'", "''", $pNamedRange->getWorksheet()->getTitle()) . '\'!' . PHPExcel_Cell::absoluteReference($range[$i][0]);
              if (isset($range[$i][1])) {
                  $range[$i][1] = PHPExcel_Cell::absoluteReference($range[$i][1]);
              }
          }
          $range = PHPExcel_Cell::buildRange($range);
  
          $objWriter->writeRawData($range);
  
          $objWriter->endElement();
      }
code: private function writeDefinedNameForNamedRange(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_NamedRange $pNamedRange)
      {
          // definedName for named range
          $objWriter->startElement('definedName');
          $objWriter->writeAttribute('name', $pNamedRange->getName());
          if ($pNamedRange->getLocalOnly()) {
              $objWriter->writeAttribute('localSheetId', $pNamedRange->getScope()->getParent()->getIndex($pNamedRange->getScope()));
          }
  
          // Create absolute coordinate and write as raw text
          $range = PHPExcel_Cell::splitRange($pNamedRange->getRange());
          for ($i = 0; $i < count($range); $i++) {
              $range[$i][0] = '\'' . str_replace("'", "''", $pNamedRange->getWorksheet()->getTitle()) . '\'!' . PHPExcel_Cell::absoluteReference($range[$i][0]);
              if (isset($range[$i][1])) {
                  $range[$i][1] = PHPExcel_Cell::absoluteReference($range[$i][1]);
              }
          }
          $range = PHPExcel_Cell::buildRange($range);
  
          $objWriter->writeRawData($range);
  
          $objWriter->endElement();
      }
code_tokens: private function writeDefinedNameForNamedRange ( PHPExcel_Shared_XMLWriter $ objWriter = null , PHPExcel_NamedRange $ pNamedRange ) { // definedName for named range $ objWriter -> startElement ( 'definedName' ) ; $ objWriter -> writeAttribute ( 'name' , $ pNamedRange -> getName ( ) ) ; if ( $ pNamedRange -> getLocalOnly ( ) ) { $ objWriter -> writeAttribute ( 'localSheetId' , $ pNamedRange -> getScope ( ) -> getParent ( ) -> getIndex ( $ pNamedRange -> getScope ( ) ) ) ; } // Create absolute coordinate and write as raw text $ range = PHPExcel_Cell :: splitRange ( $ pNamedRange -> getRange ( ) ) ; for ( $ i = 0 ; $ i < count ( $ range ) ; $ i ++ ) { $ range [ $ i ] [ 0 ] = '\'' . str_replace ( "'" , "''" , $ pNamedRange -> getWorksheet ( ) -> getTitle ( ) ) . '\'!' . PHPExcel_Cell :: absoluteReference ( $ range [ $ i ] [ 0 ] ) ; if ( isset ( $ range [ $ i ] [ 1 ] ) ) { $ range [ $ i ] [ 1 ] = PHPExcel_Cell :: absoluteReference ( $ range [ $ i ] [ 1 ] ) ; } } $ range = PHPExcel_Cell :: buildRange ( $ range ) ; $ objWriter -> writeRawData ( $ range ) ; $ objWriter -> endElement ( ) ; }
docstring: Write Defined Name for named range
  
  @param     PHPExcel_Shared_XMLWriter    $objWriter         XML Writer
  @param     PHPExcel_NamedRange            $pNamedRange
  @throws     PHPExcel_Writer_Exception
docstring_tokens: Write Defined Name for named range